This tool filters GitHub audit log exports to show only events from repositories with the sox:true custom property.
- Python 3.6+
- GitHub CLI (
gh) installed and authenticated - Organization admin access to view audit logs and custom properties
- Go to your organization settings → Audit log
- Apply filters (see "Recommended Filters" below)
- Export as CSV
Alternatively, use the GitHub CLI:
gh api "/orgs/YOUR_ORG/audit-log?phrase=created:2025-07-01%20-action:team_sync_tenant.enabled%20..." --paginate > audit.jsonpython filter_audit_log.py input.csv --org YOUR_ORG -o filtered.csv# Filter the audit log export
python filter_audit_log.py ~/Downloads/audit-export.csv \
--org myorg \
-o sox_audit_filtered.csvWhen querying the audit log, use these filters to exclude noisy events:
-action:team_sync_tenant.enabled
-action:pull_request.*
-action:org.register_self_hosted_runner
-action:issue_comment.*
-action:pull_request_review_comment.*
-action:pull_request_review.*
-action:workflows.*
-action:repo.download_zip
-action:protected_branch.rejected_ref_update
-action:custom_property_value.*
-action:integration_installation.*
-action:org_credential_authorization.*
-action:*.*actions_secret
-action:environment.create
-action:repo.create_actions_secret
-action:repository_vulnerability_alert.*
-action:repo.remove_actions_secret
-action:repo.update_actions_secret
-action:team.add_repository
These filters remove:
- Pull request and issue comment activity
- Workflow runs and secrets management
- Integration installations
- Other high-volume, low-risk events
You can customize these filters based on your compliance requirements.
- Queries GitHub for all repositories with
sox:truecustom property - Reads the CSV audit log export
- Filters events to only include those from SOX-compliant repos
- Outputs a new CSV with only relevant events
The script provides a summary:
Found 42 repositories with sox:true
Processed 15000 events
Skipped 8000 events without a repo
Kept 2500 events from sox:true repos
Filtered 4500 events from non-sox repos
Filtered output written to: sox_audit_filtered.csv
To share your configuration files (README, filter script, etc.) as a public gist:
make gistThis will:
- Create a new public gist with all non-JSON, non-CSV files (first run)
- Save the gist ID to
.gist_id(committed to version control) - Update the existing gist on subsequent runs
Everyone using this repo will update the same gist since .gist_id is tracked in version control.