Automation tools for compliance workflows, evidence collection, and configuration auditing. Each script is designed to be run standalone with minimal dependencies.
These scripts help automate common GRC tasks that are time-consuming when done manually:
- Collecting compliance evidence from cloud environments (AWS)
- Auditing development platform configurations (GitHub) against security standards
- Generating customized policy documents from templates
All scripts are designed with security in mind, using read-only access where possible and requiring explicit credentials rather than embedded secrets.
| Script | Purpose | Language | Prerequisites |
|---|---|---|---|
| aws-evidence-collector | Collect SOC 2 evidence from AWS | Python 3.11+ | boto3, AWS credentials |
| github-soc2-checker | Audit GitHub settings for SOC 2 | Bash 5.x | gh CLI, jq |
| template-generator | Generate policies from templates | Bash 5.x | yq |
Collects compliance evidence from AWS services for SOC 2 audit preparation. Evidence includes IAM users/MFA status, encryption configurations, CloudTrail logging, and CloudWatch monitoring.
cd aws-evidence-collector
# Install dependencies
pip install -r requirements.txt
# Collect evidence (using AWS profile)
python collector.py --profile prod --output ./evidence --format json
# Collect evidence (using default credentials)
python collector.py --region us-east-1 --output ./evidence --format csvSOC 2 Controls Covered: CC6.1 (Access Controls), CC6.2 (User Authorization), CC6.3 (Access Removal), CC6.7 (Encryption), CC7.2 (Monitoring), CC7.3 (Logging)
See aws-evidence-collector/README.md for detailed usage.
Audits GitHub organization and repository security configurations against SOC 2 requirements. Checks include MFA enforcement, branch protection, secret scanning, Dependabot, and audit logging.
cd github-soc2-checker
# Check entire organization
./checker.sh --org acme-corp
# Check specific repository
./checker.sh --org acme-corp --repo api-service
# Generate markdown report
./checker.sh --org acme-corp --format markdown > report.mdSOC 2 Controls Covered: CC6.1 (Access Controls), CC6.6 (Secrets Management), CC7.2 (Monitoring), CC8.1 (Change Management), CC3.2 (Risk Assessment)
See github-soc2-checker/README.md for detailed usage.
Generates customized policy documents from templates by replacing {{VARIABLE}} placeholders with organization-specific values. Supports both YAML files and interactive mode.
cd template-generator
# Generate using variables file
./generator.sh \
--template ../../templates/ai-acceptable-use-policy.md \
--vars my-org-vars.yaml \
--output my-policy.md
# Interactive mode (prompts for each variable)
./generator.sh \
--template ../../templates/ai-risk-assessment-framework.md \
--interactive \
--output my-framework.mdTemplates Available:
- AI Acceptable Use Policy
- AI Risk Assessment Framework
- Model Development Lifecycle Standard
See template-generator/README.md for detailed usage.
Used by: aws-evidence-collector
# Python 3.11+ required
python --version
# Install pip packages
pip install boto3>=1.35.0Used by: github-soc2-checker, template-generator
# Bash 5.x (pre-installed on macOS 10.15+)
bash --version
# jq - JSON processor (for GitHub checker)
brew install jq # macOS
apt-get install jq # Linux
# yq - YAML processor (for template generator)
brew install yq # macOS (mikefarah version)# AWS CLI (optional - boto3 can use credentials file)
brew install awscli
aws configure
# GitHub CLI (required for github-soc2-checker)
brew install gh
gh auth login- AWS Evidence Collector: Uses boto3 Session with AWS profile or IAM role. Never hardcode credentials.
- GitHub Checker: Uses
ghCLI authentication. Requires admin/owner access for org-level checks. - Template Generator: No credentials required (operates on local files only).
Each script is designed to request only the minimum permissions needed:
- AWS: IAM policy template provided in
aws-evidence-collector/iam-policy.jsonwith read-only actions - GitHub: Requires
read:org,repo,admin:orgscopes for configuration auditing (no write access needed)
- Evidence files contain sensitive information - Store securely and limit access
- Never commit credentials - Add AWS credentials and GitHub tokens to
.gitignore - Review before sharing - Evidence may contain account IDs, usernames, and configuration details
All scripts follow defensive programming practices:
set -euo pipefailin Bash scripts (fail fast on errors)- Input validation and error handling
- No destructive operations (read-only by design)
- Clear error messages with remediation guidance
- JSON: Complete nested structure, machine-readable, suitable for automated processing
- CSV: Flattened structure, suitable for spreadsheet analysis and auditor review
Both formats include:
- ISO 8601 timestamps
- SOC 2 control mappings (e.g., "CC6.1")
- Evidence metadata (collection time, account, region)
- Text: Colored terminal output with PASS/FAIL/WARN status
- JSON: Machine-readable results for CI/CD integration
- Markdown: Formatted report for documentation
- Markdown: Policy documents with variables replaced
- Optional: Keep or strip YAML frontmatter
- Warnings for unreplaced variables
# .github/workflows/compliance-check.yml
name: SOC 2 Compliance Check
on:
schedule:
- cron: '0 0 * * 1' # Weekly on Monday
workflow_dispatch:
jobs:
github-audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run GitHub SOC 2 Checker
run: |
cd scripts/github-soc2-checker
./checker.sh --org ${{ github.repository_owner }} --format json > results.json
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: compliance-results
path: scripts/github-soc2-checker/results.json#!/bin/bash
# Run weekly via cron: 0 2 * * 1 /path/to/collect-evidence.sh
cd /opt/compliance/scripts/aws-evidence-collector
# Collect evidence
python collector.py \
--profile prod \
--output /opt/compliance/evidence/aws \
--format both
# Archive previous evidence
tar -czf "evidence-$(date +%Y-%m-%d).tar.gz" /opt/compliance/evidence/aws/*.json
echo "Evidence collection complete: $(date)"Error: "Unable to locate credentials"
- Solution: Configure AWS credentials via
aws configureor use--profileflag
Error: "Access Denied" for specific AWS API calls
- Solution: Review IAM policy in
aws-evidence-collector/iam-policy.jsonand attach to IAM role/user
Error: "gh: command not found"
- Solution: Install GitHub CLI:
brew install gh(macOS) or see cli.github.com
Error: "HTTP 404" on organization checks
- Solution: Ensure you have org owner/admin access. Run
gh auth statusto verify.
Error: "yq is not installed"
- Solution: Install mikefarah yq:
brew install yq(macOS) or download binary from GitHub
Warning: "Variables were not replaced"
- Solution: Add missing variables to YAML file or accept manual editing
- Collect AWS evidence weekly during audit period
- Run GitHub configuration checks before auditor arrival
- Generate updated policies from templates for auditor review
- Schedule GitHub checks in CI/CD to detect configuration drift
- Alert on policy violations (MFA disabled, branch protection removed)
- Track compliance posture over time
- Maintain policy templates in git with version control
- Generate organization-specific policies with variables
- Update all policies by modifying templates and re-generating
Contributions welcome! See CONTRIBUTING.md for guidelines.
New scripts should:
- Follow existing patterns (Bash for simple tasks, Python for complex APIs)
- Include comprehensive README with usage examples
- Provide clear error messages and troubleshooting guidance
- Use defensive programming (
set -euo pipefail, input validation) - Map evidence/checks to specific compliance controls (SOC 2, ISO 27001, etc.)
CC0-1.0 (Public Domain) - To the extent possible under law, the authors have waived all copyright and related rights to this work.