Skip to content

Instantly share code, notes, and snippets.

View Lbrewbaker's full-sized avatar

Luke Brewbaker Lbrewbaker

View GitHub Profile
select
da.ip_address,
da.host_name,
dos.name as OS,
dos.version as OS_Version,
dp.title as Policy_Title,
dpr.title as Rule_Name,
dpr.description as Rule_Description,
dprs.description as Complaince_Status
from fact_asset_policy_rule as fpr
#!/bin/bash
LOGFILE="/var/log/clamav/clamav-$(date +'%Y-%m-%d').log";
DIRTOSCAN="/home/brewbs";
for S in ${DIRTOSCAN}; do
DIRSIZE=$(du -sh "$S" 2>/dev/null | cut -f1);
echo "Starting a daily scan of "$S" directory.
Amount of data to be scanned is "$DIRSIZE".";
@Lbrewbaker
Lbrewbaker / insightvm_vulnerabilities_withproof.sql
Last active March 11, 2022 20:01
Queries vulnerabilities by Asset and displays proof of where they exist.
WITH remediations AS (
SELECT DISTINCT fr.solution_id AS ultimate_soln_id, summary, fix, estimate, riskscore, dshs.solution_id AS solution_id
FROM fact_remediation(10,'riskscore DESC') fr
JOIN dim_solution ds USING (solution_id)
JOIN dim_solution_highest_supercedence dshs ON (fr.solution_id = dshs.superceding_solution_id AND ds.solution_id = dshs.superceding_solution_id)
),
assets AS (
@Lbrewbaker
Lbrewbaker / elk.sh
Last active April 1, 2019 15:35
Automated elastic stack install for RHEL and Debian systems
#!/bin/bash
# Credit: https://gist.github.com/kydouglas
# Updated for ELK Stack v6.6.2
# sudo wget -Nnv 'https://gist.github.com/Lbrewbaker/8a679ae532d58373c0979a7b08c284d6' && bash elk.sh && rm -f elk.sh
# Checking whether user has enough permission to run this script
sudo -n true
if [ $? -ne 0 ]