Secrets exposed in CI/CD — hardcoded credentials in pipeline config, build logs, artifacts, environment variables, and git history. Hunt with trufflehog and gitleaks, then validate and assess blast radius. Tier 1 (detection/validation). Use when CI config, repos, build logs, or artifacts are accessible.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Cicd Secrets?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/anandjogawade-cicd-secrets)
---
name: cicd-secrets
description: Secrets exposed in CI/CD — hardcoded credentials in pipeline config, build logs, artifacts, environment variables, and git history. Hunt with trufflehog and gitleaks, then validate and assess blast radius. Tier 1 (detection/validation). Use when CI config, repos, build logs, or artifacts are accessible.
---
# CI/CD Secret Exposure (trufflehog / gitleaks)
Pipelines are secret-dense: tokens in YAML, printed in logs, baked into artifacts, or committed to history. Find them, validate the live ones, and scope the damage.
## Trigger phrases
`cicd secrets, trufflehog, gitleaks, hardcoded credentials, build log secrets, env secrets, leaked token, api key, git history secrets`
## Method
1. **Scan source + full git history:**
```
trufflehog git file://./repo --only-verified
gitleaks detect --source ./repo --report-format json
```
`--only-verified` (trufflehog) live-checks creds against the provider to cut false positives. History matters — secrets deleted in HEAD persist in old commits.
2. **Pipeline config:** grep `.github/workflows`, `.gitlab-ci.yml`, `Jenkinsfile`, Azure/Circle YAML for inline tokens, `echo $SECRET`, base64 blobs, `env:` with literals, and secrets referenced in a way that prints them.
3. **Build logs & artifacts:** download job logs and build artifacts (`gh run download`, GitLab job artifacts, Jenkins console) — grep for keys; log-masking is name-based and misses echoed/encoded/transformed secrets. Scan container images (`trivy image`, history layers) and published packages for embedded creds.
4. **Env & context leaks:** `printenv`/`env` steps, debug mode dumping context, `${{ toJSON(secrets) }}` anti-patterns, `.env` committed, Docker `ARG`/`ENV` secrets in image history.
5. **Validate & scope:** verify each live secret's type and privileges (cloud key → `aws sts get-caller-identity` within RoE; VCS PAT → scopes; registry token → push rights). Map blast radius without using the access beyond confirmation.
## Modern / rare techniques
- **Masking bypass evidence:** show a secret split/encoded across log lines to demonstrate masking is insufficient (don't exfil the real value).
- **Artifact & cache secrets:** test caches/artifacts shared with less-trusted jobs (fork PRs) — chain `cicd-pipeline`.
- **OIDC vs long-lived keys:** flag static cloud keys where OIDC should be used; a leaked OIDC-less key is immediate cloud access.
- **High-entropy + provider-specific regex:** AWS `AKIA`/`ASIA`, GitHub `ghp_`/`gho_`/`ghs_`, Slack `xox`, GCP service-account JSON, private keys (`-----BEGIN`), JWTs.
## Bypass / evasion
N/A (detection). Validate creds minimally and within RoE; never persist/exfiltrate live secrets.
## Escalation / chaining
Live cloud key → `cloud-pentest`; VCS PAT → repo write/`supply-chain`/`cicd-pipeline`; DB creds → `database-enumeration`; APP_KEY/JWT secret → `jwt`.
## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP). trufflehog, gitleaks, `gh`/`glab` CLI, trivy, noseyparker. See `zazy-orchestrator`.
## Verification (background, before reporting)
Confirm a secret is live (verified scan or a single minimal auth check) before reporting as active; distinguish active vs stale/rotated. Reproduce the finding. Report true positives only.
## Evidence
Secret type + location (file:line / log / artifact / commit hash), validation result (active/revoked, privileges), blast radius. Remediation: rotate immediately, move to a secrets manager/OIDC, scrub git history (BFG/filter-repo), add pre-commit + CI secret scanning gates, least-priv tokens, never echo secrets.