TAM-H-STG-048 · Human · Stage: Getting ready · New in TAM
Scraping Runner Secrets
The insider uses a CI job to print, encode or send out the secrets that the pipeline holds.
CI/CD runners get cloud keys, deploy tokens, signing keys and database passwords as environment variables. Anyone who can change a workflow file, or open a pull request that runs on a trusted runner, can usually read them.
Platforms mask secrets in logs, but masking is easy to beat. Base64-encoding a value, splitting it into pieces, or posting it to a webhook all slip past. Self-hosted runners make it worse because files and credentials from earlier jobs may still be on disk.
This is often a staging step. The insider collects production credentials through the pipeline so they can use them later from outside, where the access no longer looks like the CI role.
What it looks like
- A developer adds a step that runs `env | base64` in a branch build and copies the output from the log.
- A workflow is changed to curl the contents of `toJSON(secrets)` to an outside URL.
- An engineer reads cached cloud credentials from a self-hosted runner's home directory.
Detections (3)
- DET-097Pipeline Definition ChangesReview every change to CI/CD workflow files, shared templates and runner settings.Confidence MediumSaaSLinux
- DET-126Runner Egress to New DestinationsBaseline where CI runners connect and alert on new hosts, especially from jobs holding secrets.Confidence MediumLinuxNetworkAWS
- DET-129Secret Dumping in Build LogsSearch CI job definitions and logs for steps that print, encode or ship out secrets.Confidence HighSaaSLinux
Controls (3)
- CTL-039Environment Secrets With ApprovalsPut production secrets in protected environments that need a reviewer and only run from protected branches.TechnicalEffort LowEffect High
- CTL-040Ephemeral, Egress-Limited RunnersRun CI jobs on fresh runners that are destroyed after each job and can only reach approved hosts.TechnicalEffort MediumEffect High
- CTL-094Short-Lived Cloud Credentials for CIReplace static cloud keys in CI with OIDC federation scoped to repo, branch and environment.TechnicalEffort MediumEffect High