GitHub Secret Scanning Executor¶
Category: Source Code Analysis
Script: github_secrets.py
Integration: GitHub REST API
Faraday Plugin: Raw JSON (no plugin — generates Faraday JSON directly)
Description¶
Fetches all open secret-scanning alerts from a GitHub repository and creates vulnerability entries for each detected secret. All secrets are assigned high severity since GitHub does not provide native severity ratings for secrets.
Prerequisites¶
- GitHub Personal Access Token with
security_eventsscope - GitHub Advanced Security (GHAS) enabled on the repository
- Secret scanning enabled in the repository settings
Configuration¶
Environment Variables (Setup)¶
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
Yes | GitHub Personal Access Token |
GITHUB_OWNER |
Yes | GitHub organization or user owning the repository |
Execution Arguments¶
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
GITHUB_REPOSITORY |
string | Yes | Repository name to query for secret scanning alerts |
Common Agent Parameters Supported¶
AGENT_CONFIG_VULN_TAG, AGENT_CONFIG_HOSTNAME_TAG
YAML Configuration Example¶
executors:
github_secrets_scan:
repo_executor: github_secrets.py
max_size: 65536
varenvs:
GITHUB_TOKEN: "${GITHUB_TOKEN}"
GITHUB_OWNER: my-org
params:
GITHUB_REPOSITORY:
mandatory: true
type: string
base: string
How It Works¶
- Fetches all open secret-scanning alerts from
https://api.github.com/repos/{owner}/{repo}/secret-scanning/alerts(paginated) - For each alert, creates a vulnerability entry with:
- Secret type and provider
- High severity (default for all secrets)
- Auto-tag:
secret_detection - Host is set to
github.com/{owner}/{repo} - Outputs the combined Faraday JSON
Notes¶
- Only open alerts are imported; resolved alerts are excluded
- All secrets are assigned high severity since GitHub provides no native severity for secrets
- Results are automatically tagged with
secret_detectionplus any user-defined tags - This executor does not perform independent scanning — it imports results from GitHub's native Secret Scanning
- Secret scanning is free for public repositories; GitHub Advanced Security is required for private repositories