Skip to content

Commit f0f5969

Browse files
authored
Merge pull request #15 from advanced-security/copilot/implement-paradigm-in-python-harness
Script to show Secret Scanning progress
2 parents 97521a8 + 9121860 commit f0f5969

File tree

4 files changed

+546
-1
lines changed

4 files changed

+546
-1
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
*.pdf
55
__pycache__/
66
.mypy_cache/
7-
*.pyc
7+
*.pyc
8+
.venv/

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,49 @@ This is a set of scripts that use these APIs to access and manage alerts. The sc
2424

2525
A note on common arguments: generally, the date in `--since` can be specified as `YYYY-MM-DD` or as `Nd` where `N` is the number of days ago. Full ISO formats are also supported. If a timezone is not specified, the date is assumed to be in UTC (`Z` timezone).
2626

27+
### Get secret scanning scan history progress
28+
29+
This script retrieves the secret scanning scan history for repositories across an Enterprise, organization, or single repo. It queries the `GET /repos/{owner}/{repo}/secret-scanning/scan-history` endpoint for each repo concurrently and displays a summary with progress bars showing backfill, incremental, pattern update, and custom pattern scan completion status. Optionally outputs a detailed markdown table.
30+
31+
```text
32+
usage: get_secret_scanning_scan_history_progress.py [-h] (--enterprise ENTERPRISE | --org ORG | --repo REPO)
33+
[--detailed] [--concurrency CONCURRENCY] [--hostname HOSTNAME]
34+
[--ca-cert-bundle CA_CERT_BUNDLE] [--no-verify-tls] [--quiet]
35+
[--debug]
36+
37+
options:
38+
-h, --help show this help message and exit
39+
--enterprise ENTERPRISE
40+
GitHub Enterprise slug. Lists all orgs, then all repos per org.
41+
--org ORG GitHub Organization name. Lists all repos in the org.
42+
--repo REPO A single repository in owner/repo format.
43+
--detailed Show full markdown table with per-repo scan details instead of summary progress bars.
44+
--concurrency CONCURRENCY
45+
Number of concurrent API requests (default: 10).
46+
--hostname HOSTNAME GitHub Enterprise hostname (defaults to github.com)
47+
--ca-cert-bundle CA_CERT_BUNDLE, -C CA_CERT_BUNDLE
48+
Path to CA certificate bundle in PEM format (e.g. for self-signed server certificates)
49+
--no-verify-tls Do not verify TLS connection certificates (warning: insecure)
50+
--quiet, -q Suppress non-error log messages
51+
--debug, -d Enable debug logging
52+
```
53+
54+
Examples:
55+
56+
```bash
57+
# Single repo
58+
GITHUB_TOKEN=$(gh auth token) python3 get_secret_scanning_scan_history_progress.py --repo octocat/Hello-World
59+
60+
# Organization
61+
GITHUB_TOKEN=$(gh auth token) python3 get_secret_scanning_scan_history_progress.py --org my-org
62+
63+
# Enterprise (requires read:enterprise scope)
64+
GITHUB_TOKEN=$(gh auth token) python3 get_secret_scanning_scan_history_progress.py --enterprise my-enterprise
65+
66+
# With detailed markdown table
67+
GITHUB_TOKEN=$(gh auth token) python3 get_secret_scanning_scan_history_progress.py --org my-org --detailed
68+
```
69+
2770
### List secret scanning alerts
2871

2972
This script retrieves secret scanning alerts from GitHub repositories, organizations, or Enterprises and outputs them in CSV or JSON format. It supports filtering by state, date, and push protection bypass status. Use this to audit, analyze, or export secret scanning data for compliance or security purposes.

0 commit comments

Comments
 (0)