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

FedRAMP POAM Exporter

This script is used to export Plan of Actions and Milestones (POAM) items from a Security Plan (SSP) in the RegScale system to an Excel file in the FedRAMP v5 format.

Requirements

  • Python 3.9+
  • openpyxl
  • regscale-cli
@bryaneaton
bryaneaton / gist:301ea871a857971eb28502517a8f5da1
Created December 3, 2024 19:10
Asset - Issue Test Script
#!/usr/bin/env python
import argparse
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
from rich.text import Text
from regscale.models.regscale_models.asset import Asset
from regscale.models.regscale_models.issue import Issue
@bryaneaton
bryaneaton / fix_borked_json.py
Last active March 1, 2024 12:50
Fix Broken JSON
import json
import re
with open("somefile.json", 'r', encoding='utf-8) as f:
s = f.read()
# Original code here by tobias_k: https://stackoverflow.com/questions/18514910/how-do-i-automatically-fix-an-invalid-json-string
while True:
try:
@bryaneaton
bryaneaton / asyncio.py
Created November 3, 2023 18:36
Asyncio and Click
import asyncio
# Async operation definition remains the same
async def async_operation():
print("Starting async operation")
await asyncio.sleep(1)
print("Async operation completed")
@bryaneaton
bryaneaton / banips.sh
Created September 17, 2023 14:19
Grep TarSSH log for ips and add to fail2ban list
#!/bin/bash
set -euo pipefail
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
GWX 3.0
Once you created a symlink with no space in its name, you can install GWX using its installer, pointing to that symlink instead of the default silent hunter 3 install location (which contains spaces, and other characters nobody should use)
If you just install GWX, it will start in 4:3 resolution ; to make it work in proper 1920x1080 resolution, i tried multiple widescreen "mods" (dll + GUI) ; the only one that worked and gave me a UI that i like is ahnenerbe's one.
0. downloads
- download "Ahnenerbe WideGui 1920 x 1080 Final" from
http://www.subsim.com/radioroom/showthread.php?t=215433
- download GWX from
import com.helger.schematron.ISchematronResource;
import com.helger.schematron.svrl.SVRLFailedAssertAndReport;
import com.helger.schematron.xslt.SchematronResourceSCH;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
import java.util.List;
public class SchematronValidator {
<xs:schema xmlns="http://csrc.nist.gov/ns/oscal/1.0"
xmlns:m="http://csrc.nist.gov/ns/oscal/metaschema/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
elementFormDefault="qualified"
targetNamespace="http://csrc.nist.gov/ns/oscal/1.0"
version="1.1.0">
<xs:annotation>
<xs:appinfo>
<m:schema-name>OSCAL System Security Plan (SSP) Model</m:schema-name>
@bryaneaton
bryaneaton / risk_issues.py
Created April 25, 2023 19:23
risk_issues.py
# Python 3.6+
# pip(3) install requests
import requests
# Standard headers
HEADERS_AUTH = {"Content-Type": "application/x-www-form-urlencoded"}
HEADERS = {"Content-Type": "application/json"}
client_id = "SERVICE_ACCOUNT_CLIENT_ID"
client_secret = "SERVICE_ACCOUNT_CLIENT_SECRET"
#!/usr/bin/env python3
import sys
from lxml import etree
from pathlib import Path
import random
stig_folder = "./tests/test_data"