Skip to content

Instantly share code, notes, and snippets.

@alias454
alias454 / aws_inspector_cron.sh
Created March 17, 2022 02:27 — forked from shokoe/aws_inspector_cron.sh
Executes AWS Inspector run, export full findings csv file from last completed run, compile a concise counters report including severity and package aggregates by hostname. Full and aggregated report are uploaded to S3.
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/snap/bin
log="/var/log/aws_inspector/aws_inspector_export_rep.log"
template_arn='arn:aws:inspector:us-east-1:XXXXXXXXXXXX:target/xxxxxxxxxx/template/xxxxxxxxxx'
wait_sec='5400'
log_out(){
(($verifymon)) &&\
echo -e "`date +'%Y-%m-%d %H:%M:%S'` (pid $$) -- $1" >> $log ||\
echo -e "`date +'%Y-%m-%d %H:%M:%S'` (pid $$) -- $1" | tee -a $log
@alias454
alias454 / inventory.yml
Last active October 25, 2021 17:34
WIP splunk patch and reboot fabric script
---
# list of node groups
service:
splunk:
config:
verify_tls: False
splunk_cm_api_url: 'https://splunk-cluster-master01.domain.tld:8089'
splunk_status_check_path: 'services/cluster/master/status?output_mode=json'
splunk_set_mm_path: 'services/cluster/master/control/default/maintenance?output_mode=json'
roles:
@alias454
alias454 / macro-patch-and-reboot.sls
Created October 12, 2021 06:54
Orchestrate OS patching and reboots using saltstack
# -*- coding: utf-8 -*-
# vim: ft=sls
# Patch and reboot macro
{% macro patch_and_reboot(node, service='salt-minion.service') %}
# Update minion seperately and restart the service
orch-function-update-minion-{{ node }}:
salt.function:
- name: cmd.run
- tgt: {{ node }}
@alias454
alias454 / Bro-2.6-195-Linux-x86_64.rpm
Last active August 10, 2019 01:04
Test rpm upload for bro travis job
This file has been truncated, but you can view the full file.
@alias454
alias454 / cbd_inventory.py
Created August 23, 2018 17:49
Get carbon black inventory using api
#!/usr/bin/env python3
import os
import sys
import json
import csv
import configparser
import datetime
import requests
import urllib
@alias454
alias454 / install_sectools.sh
Last active September 1, 2023 19:21
Modified Bug Bounty Hunting Tools install script for Fedora
#!/usr/bin/env bash
# Modified Bug Bounty Hunting Tools install script for Fedora
# Create this file in ~/scripts and then run
# sudo su <username> -c "~/scripts/install_sectools.sh"
#create a tools folder in ~/
mkdir ~/tools
cd ~/tools/
@alias454
alias454 / check_domain_status.py
Last active September 18, 2026 21:19
Check redirects and return status of active webpages
#!/usr/bin/env python3
"""
Script to check redirects and return status of contacted page.
Input file should be one domain per line
"""
import csv
from urllib.parse import urlparse
@alias454
alias454 / vm_template_prep.sh
Created February 2, 2018 01:29
Prepare RHEL/CentOS 7 VM for template creation
# Script created based on info from
# https://lonesysadmin.net/2013/03/26/preparing-linux-template-vms/
#
# Prepare RHEL/CentOS 7 VM for template creation
#!/bin/bash
# Stop logging services
systemctl stop rsyslog
service auditd stop
@alias454
alias454 / 10-base-config.rules
Last active September 18, 2026 20:58
audit rules
# Linux Audit baseline
# Intended for current 64-bit Debian- and RHEL-family systemd servers.
# Loaded before policy rules to establish a clean audit subsystem state.
## Reset - start from a known ruleset.
-D
## Kernel audit queue - tolerate short bursts without silently losing events.
-b 8192
--backlog_wait_time 60000
@alias454
alias454 / vmlauncher.sh
Last active February 3, 2018 01:40
Generate Groups of VMs from VMware shell
#
# Generate Groups of VMs from VMware shell
#
#!/bin/ash
usage="\n$(basename "$0") [-h] [-n int] [-b basename] [-t tpl_name] [-p /path/to/datastore] \n
Example usage: $(basename "$0") -n 6 -b node -t CENTOS_TPL -p /vmfs/volumes/Datastore
"
while getopts ":hn:b:t:p:" opt; do