Description
The GitHub scanner does currently not download and scan artifacts for secrets. Secrets are oftentimes found in artifiacts, e.g. GitHub Actions workflows that stores Terraform output in state, even though variables are set to sensitive.
Preferred Solution
An opt-in --include-artifacts flag on the github subcommand, and a process to:
- Enumerates GET /repos/{owner}/{repo}/actions/artifacts, skipping entries with expired: true.
- Download each artifact zip via the /zip endpoint.
- Feed the zip into the existing archive handler in pkg/handlers, that handles nested archives.
- Deduplicate by artifact digest to ensure output are scanned once rather than once per run.
- Add artifact ID, run ID, workflow name, and in-zip path to message Github in proto/source_metadata.proto, to make a finding traceable back to a specific run.
Additional Context
- Auth is mandatory even for public repos, the artifact download endpoint requires a token with actions:read.
- There's a default 90 days retention for artifacts, meaning all scans will be a point-in-time and not necessarily reproducible.
References
Description
The GitHub scanner does currently not download and scan artifacts for secrets. Secrets are oftentimes found in artifiacts, e.g. GitHub Actions workflows that stores Terraform output in state, even though variables are set to sensitive.
Preferred Solution
An opt-in --include-artifacts flag on the github subcommand, and a process to:
Additional Context
References