Skip to content

Instantly share code, notes, and snippets.

View bryaneaton's full-sized avatar
🏖️
Tis the season

Bryan Eaton bryaneaton

🏖️
Tis the season
  • Maryville, TN
View GitHub Profile
@bryaneaton
bryaneaton / nist-formatted.json
Last active March 2, 2023 01:51
nist-formatted.json
[
{
"ID": "ac-1",
"TITLE": "Access Control Policy and Procedures",
"Confidentiality": "Low",
"Integrity": "Low",
"Availability": "Low"
},
{
"ID": "ac-2",
## AlienVault CLI
This CLI is provided to ingest pulses from [AlienVault](https://otx.alienvault.com/). The RegScale CLI tool will convert this data feed into threats for use within the RegScale platform. It is commonly used to support Threat-Hunting and Threat-Based Risk Modeling for RegScale customers.
### Init.yaml Configuration
There is one required variable that will configure the AlienVault integration. The AlienVault user API key will allow pulses to pull from all subscribed feeds within AlienVault and into the RegScale platform.
- `otx` - enter AlienVault API key here
@bryaneaton
bryaneaton / build_platform.sh
Last active February 22, 2023 18:27
Build Platform script
#!/usr/bin/env bash
REGSCALE_DIR=/home/bryan/Sync/regscale/regscale
DOCKER_DIR=/home/bryan/Sync/regscale/standalone
cd $REGSCALE_DIR
REPO_STATUS="Unknown"
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
@bryaneaton
bryaneaton / Template.sh
Created October 28, 2022 12:51
Template.sh
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
if [[ "${TRACE-0}" == "1" ]]; then
set -o xtrace
fi
if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then
@bryaneaton
bryaneaton / postgres-cheatsheet.md
Created July 7, 2022 22:44 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@bryaneaton
bryaneaton / app.py
Created May 31, 2022 17:43
Celery Task Example, using Flask.
#!/usr/bin/env python3
from flask import Flask, jsonify
from celery import Celery
app = Flask(__name__)
app.config["CELERY_BROKER_URL"] = "redis://redis:6379"
celery = Celery(app.name, broker=app.config["CELERY_BROKER_URL"])
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# import required module
import os
import pandas as pd
# assign directory
directory = './match_files'
@bryaneaton
bryaneaton / gist:33a9d8eda62fefe94627c44f36a5d029
Created November 10, 2021 19:28
Dump Access Queries to Text file
Public Sub ListQueries()
' Modified from André Bernardes
Dim i As Integer
Dim ff As Long
ff = FreeFile()
Open "C:\temp\Queries.txt" For Output As #ff
On Error Resume Next
For i = 0 To CurrentDb.QueryDefs.Count - 1
Debug.Print "|" & CurrentDb.QueryDefs(i).Name & ":"
@bryaneaton
bryaneaton / logz.py
Created July 22, 2021 13:27
Useful logging class for python!
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# standard python imports
import logging
from rich.logging import RichHandler
from rich.traceback import install
import os
install()
@bryaneaton
bryaneaton / build.sh
Created July 15, 2021 15:14 — forked from sempervent/build.sh
Docker build script
#!/usr/bin/env bash
# ex: set fdm=marker
# usage {{{1
#/ Usage:
#/ ./build.sh -r "REGISTRY/NAME" [OPTIONS]
#/
#/ -r|--registry)
#/ the name of the image or registry to push to [required]
#/
#/ -t|--tag)