secrets-scanner — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited secrets-scanner (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill covers three scenarios: an active leak (incident), preventive scanning, and setting up prevention. The action order differs sharply per scenario, so phase 1 explicitly asks which one you're doing.
Triggers:
.env, .env.*, config/*.yaml, docker-compose*.yml, helm/values*.yaml, *.pem, *.key, credentials.json, or new files under secrets/, vault/.security-review phase 3 (automated scan) that needs further triage.k8s-security and container-hardening.iac-security.secure-coding phase 4.cve-triage.ir-runbook and forensics-assist.For an active leak this skill doesn't stop — rotation is its job. But escalate to ir-runbook as soon as there's evidence of misuse (CloudTrail hits, abnormal API traffic, data egress).
Seven phases. Phase 1 sets the order for the rest: an active leak goes straight to phase 4 (rotation), 2/3/5/6 follow. For scan/prevention: normal order.
One question: is there a credential that may right now be in the wrong hands? The clock starts the moment the secret is out of control.
Classification:
Note the classification explicitly. It determines whether phase order can wait for deliberate analysis or whether speed beats thoroughness.
Tools in order of preference:
--only-verified actively tests detected keys against the provider API (AWS STS, Stripe, GitHub, etc.) and separates dead keys from live ones. Required during incident triage where "does this still work?" is the critical question..secrets.baseline that's git-diffable. New findings stand out; old known-safe ones don't get re-reported every run.Detection methods in combination:
AKIA for AWS access keys, ghp_ / gho_ / ghs_ for GitHub, xox[abpr]- for Slack, sk_live_ for Stripe, AIza for Google API keys, sk-ant-api03- for Anthropic, npm_ for npm). High precision. Reference list: GitHub Secret Scanning patterns documentation.password\s*=, api_key:, BEGIN PRIVATE KEY). Catches hardcoded-in-source and README accidents.Command reference:
# gitleaks — full repo, working tree + history
gitleaks detect --source . --verbose --report-path gitleaks-report.json
# gitleaks — staged only (pre-commit usage)
gitleaks protect --staged --verbose
# trufflehog — git history, only verified live credentials
trufflehog git file://. --only-verified
# trufflehog — GitHub org scan (incident context)
trufflehog github --org=<org> --only-verified
# detect-secrets — baseline + audit
detect-secrets scan > .secrets.baseline
detect-secrets audit .secrets.baselineFor non-git sources (logs, tarballs, backup dumps): gitleaks has detect --no-git, trufflehog has filesystem and s3 subcommands. Same rule sets, different source.
Each hit becomes a finding only after you've determined:
--only-verified or a manual call against a read-only provider endpoint (e.g. aws sts get-caller-identity with the key configured).git log -p --all -S '<unique-part-of-secret>'. Or git blame on the file if it's still present. End time: now, or the moment of revocation.Severity (parallel to security-review phase 6):
Order is law. Rotate first, then communicate, then clean up. Anti-pattern: cleaning up git history and forgetting to rotate. That's cosmetics for a credential that's already been harvested.
aws iam delete-access-key + create new, or roll via aws iam update-access-key. GitHub: Settings → Developer settings → PAT → Revoke. Stripe: Dashboard → Developers → API keys → Roll. Anthropic/OpenAI: console → revoke + generate new. DB: ALTER USER … WITH PASSWORD … or drop and recreate user. For signing/KMS keys: schedule deletion with a window, not instant-delete.userIdentity.accessKeyId, GitHub Audit Log on PAT-owner, Stripe events, SaaS audit exports. On confirmed misuse: escalate to ir-runbook (the secret is no longer the story; the breach is).ir-runbook when there's evidence of misuse.Only run when all three are true: the credential is verifiably revoked, the repo is private or the exposure window was short enough for removal to be meaningful, and the team accepts a force-push plus coordination moment.
Tools:
git filter-branch, which is deprecated.Commands:
# git-filter-repo — remove a file completely from history
git filter-repo --invert-paths --path path/to/secret-file
# git-filter-repo — replace text (patterns.txt: one regex per line)
git filter-repo --replace-text patterns.txt
# BFG — same idea
bfg --replace-text patterns.txt
git reflog expire --expire=now --all && git gc --prune=now --aggressive
# Then synchronize
git push --force --all
git push --force --tagsCoordination: every collaborator must re-clone or do a careful reset. Old clones still hold the history. Public forks on GitHub keep the history. You can ask GitHub Support to invalidate caches, but there's no guarantee.
Reality check. For public repos or images: GitHub events, the Wayback Machine, GH-Archive.org, scraped copies on third-party sites. History cleanup only reduces casual-discovery surface; it doesn't undo the leak. Compliance or policy may still require cleanup despite this reality.
Layered. One barrier always fails; the combination catches most mistakes.
Pre-commit hook (developer machine, first line). Uses the pre-commit framework (Python) or husky (Node):
# .pre-commit-config.yaml
repos:
- repo: https://github.com/gitleaks/gitleaks
rev: v8.x.y # pin to latest stable at install
hooks:
- id: gitleaksDevelopers can always run git commit --no-verify. Pre-commit is helpful, not a gate. CI is the backstop.
CI gate (GitHub Actions example):
- name: secret scan
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Make the step fail on findings. Whitelist only via .gitleaksignore with commit hash plus reason per entry. No wildcards or path globs that skip whole directories.
Repo settings:
.gitlab-ci.yml..gitignore explicitly for .env, .env.* (except .env.example), *.pem, *.key, *.p12, id_rsa*, credentials.json, config/local.*, **/secrets/**..env.example committed with empty/placeholder values so developers know which env vars exist without seeing the real ones.Runtime secret store (does not belong in source, also not in CI config as plain text):
k8s-security.Onboarding checklist:
Incident mode: Layer 1 scope check (all systems rotated? all team members notified? all CI pipelines updated?), assumptions (credential genuinely revoked or just "I clicked revoke"?), gaps (backups, read replicas, cached configs included?). Layer 2 red flags especially on claims: "key is dead" only when verified via trufflehog or a provider test; no assumed rotation.
Prevention mode: Layer 1 gaps (do the gates cover both staging and prod? do they work on new branches?), Layer 2 source quality (regex from GitHub Secret Scanning docs, not from a random blog).
Incident mode:
Secret leak incident — <short ID>
Detected: YYYY-MM-DD HH:MM | Status: <active | contained | closed>
Credential:
Type: <AWS access key | GitHub PAT | Stripe live key | ...>
Scope/blast radius: <known detail | assumed maximum>
Exposure window: <first commit SHA/date> → <detected or removed>
Exposure surface: <private repo | public repo | image | log | ...>
Verified active: <yes | no | unknown — method>
Action path:
[x] Rotate/revoke at provider — YYYY-MM-DD HH:MM by <actor>
[x] Provider logs checked — <clean | attachment with hits>
[x] Replaced in <CI, hosts, team-member configs>
[x|-] Git-history cleanup — <done | skip with reason | in progress>
[ ] Incident retrospective
Verification-loop:
Verdict: <pass | revise | rewrite>
Security verdict: <no red flags | red flag — ...>Prevention mode: concrete deliverables, not a narrative report. Artifacts produced:
.pre-commit-config.yaml (or husky equivalent)..github/workflows/secret-scan.yml or .gitlab-ci.yml fragment)..gitignore additions..gitleaks.toml if org-specific patterns (internal prefixes, domain names) are needed..secrets.baseline for the detect-secrets path.AKIAIOSFODNN7EXAMPLE (AWS's own documentation placeholder) and verify that pre-commit and CI both block the push.Don't deliver a report on incidents without the rotation status. Without rotation it's not remediation, and that needs to be in the report explicitly.
--only-verified for active validation during incidents.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.