kingfisher-scanning
Configures and runs Kingfisher for secret scanning with access mapping: discovers leaked credentials AND maps them to the IAM identities and cloud resources they expose (S3 buckets, RDS instances, etc.); Intel Hyperscan regex engine makes it the fastest option for large monorepos; 950 built-in rules (largest of the OSS scanners); multi-target (local files / Git history / GitHub / GitLab / AWS S3 / Docker images); live API validation plus offline checksum verification; suppression via `--skip-regex` / `--skip-word` / `--baseline-file` / inline `kingfisher:ignore`. Use when cloud-blast-radius context matters or scan time on a large repo is blocking. Front-loads access-mapping and Hyperscan speed to differentiate from trufflehog-scanning, which also does multi-target scanning and live validation but offers no IAM access mapping.
Install with skills.sh (any agent)
npx skills add testland/qa --skill kingfisher-scanningkingfisher-scanning
Overview
Per github.com/mongodb/kingfisher (opens in new window):
"Kingfisher is an open source secret scanner and live secret validation tool built in Rust."
Three differentiating capabilities:
When to use
For battle-tested defaults, gitleaks-scanning or trufflehog-scanning are lower-risk picks.
Step 1 - Install
Per kf-gh (opens in new window):
# Homebrew (Linux/macOS)
brew install kingfisher
# PyPI via uv
uv tool install kingfisher-bin
# Install script (Linux/macOS)
curl -sSL https://raw.githubusercontent.com/mongodb/kingfisher/main/scripts/install-kingfisher.sh | bash
# Docker
docker run --rm -v "$PWD":/src ghcr.io/mongodb/kingfisher:latest scan /srcStep 2 - Basic scan
Per kf-gh (opens in new window):
kingfisher scan /path/to/code --view-reportThe --view-report flag opens results in the browser viewer (useful for triage; less useful in CI).
For CI:
kingfisher scan /path/to/code --output kingfisher-report.json --format jsonMulti-target scanning per kf-gh (opens in new window):
# Git history
kingfisher git /path/to/repo
# GitHub organization
kingfisher github --org=acme
# AWS S3
kingfisher s3 --bucket my-bucket
# Docker image
kingfisher docker my-image:latest(Verify exact subcommand syntax against current Kingfisher release - the surface evolves.)
Step 3 - Live validation
Per kf-gh (opens in new window): "Confirms discovered secrets against provider APIs to reduce false positives."
Same model as TruffleHog's verification - discovered candidates are tested against the provider API to confirm they're real, unexpired credentials. The output distinguishes verified vs unverified findings; CI gating typically uses verified-only for PR-blocking.
Plus per kf-gh (opens in new window): "Validates tokens with built-in checksums offline, eliminating many false positives." Some providers (AWS keys, Stripe keys) include checksums that Kingfisher validates without making API calls - fast + no audit-log impact.
Step 4 - Access mapping (Kingfisher-distinctive)
Per kf-gh (opens in new window): "Maps discovered credentials to their effective cloud identities and exposed resources."
When a leaked AWS key is discovered, Kingfisher can (with appropriate permissions) report:
This turns a finding from "leaked AWS key" into "leaked AWS key that could s3:GetObject from prod-customer-data bucket" - a much sharper severity signal.
This requires Kingfisher to have read-only API access to the cloud account; configure via standard cloud-SDK credential mechanisms.
Step 5 - False-positive triage (MANDATORY)
Per kf-gh (opens in new window) suppression options:
| Mechanism | Use |
|---|---|
--skip-regex '(?i)PATTERN' | Skip matches matching a regex pattern |
--skip-word WORD | Exclude specific words from detection |
--baseline-file <path> | Suppress known findings tracked in a baseline |
Inline kingfisher:ignore | In-code per-line suppression |
Baseline workflow:
# Create baseline (current state of findings)
kingfisher scan /path/to/code --output kingfisher-baseline.json
# Apply baseline (only NEW findings fail)
kingfisher scan /path/to/code --baseline-file kingfisher-baseline.jsonJustification template (mandatory in baseline file or sibling REASONS.md):
# kingfisher-baseline-reasons.md
# Each entry in kingfisher-baseline.json should have an entry here.
GHSA-2024-aws-key-fixture:
files: [tests/fixtures/aws-credentials.json]
reason: "Test fixture; uses dummy AWS credentials for SDK init tests"
approved-by: alice@example.com
re-review-date: 2026-09-15For inline:
# kingfisher:ignore
# Reason: SDK initialization fixture; not a real credential
# Approved-by: alice@example.com
# Re-review-date: 2026-09-15
DUMMY_AWS_KEY = "AKIAIOSFODNN7EXAMPLE"Cadence: every quarter, audit kingfisher-baseline-reasons.md + inline kingfisher:ignore comments; expired re-review dates removed.
Step 6 - CI integration
Kingfisher is newer; first-party CI integrations are still maturing. Pattern (verify against current docs):
jobs:
kingfisher:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with: { fetch-depth: 0 }
- run: |
curl -sSL https://raw.githubusercontent.com/mongodb/kingfisher/main/scripts/install-kingfisher.sh | bash
- run: kingfisher scan . --baseline-file .kingfisher-baseline.json --format json --output kingfisher.json
- uses: actions/upload-artifact@v4
if: always()
with: { name: kingfisher-report, path: kingfisher.json }Step 7 - Cross-tool layering
Three secret scanners overlap deliberately:
| Tool | Sweet spot |
|---|---|
| gitleaks | Pre-commit (fastest, mature) |
| trufflehog | High-precision verified findings, multi-source |
| kingfisher | Largest rule set + access mapping; modern stack |
For maximum coverage, run all three in CI and combine output via a unified triager. For minimum coverage, gitleaks (pre-commit) + trufflehog (CI verified-only) is the conservative pick.
Anti-patterns
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Run kingfisher without baseline | Legacy findings flood PR | Baseline + diff (Step 5) |
| Suppress without REASONS doc | No audit trail | Mandatory template (Step 5) |
| Skip access-mapping config | Findings lack severity context | Configure cloud read-only access (Step 4) |
| Trust unverified findings as real | False positives drown signal | Verified-only filter (when supported by current version) |
Pin to kingfisher:latest Docker tag | Breaking changes mid-release | Pin specific version (v0.5.0 etc.) |
Limitations
References
Related skills
gitleaks-scanning
Configures and runs gitleaks - Go-based secret scanner with `gitleaks git` (scan local git via `git log -p`), `gitleaks dir` (filesystem), `gitleaks stdin` (pipe); 100+ built-in rules + custom rules in `.gitleaks.toml` ([[rules]] with regex / entropy / keywords / tags); allowlist via [[rules.allowlists]] (commits / paths / stopwords); pre-commit hook + GitHub Action integration; baseline file for legacy debt. Use when the team needs OSS secret scanning at commit time + CI gate.
secrets-baseline-manager
Builds and maintains a unified secrets baseline/allowlist across gitleaks (.gitleaksignore + --baseline-path), TruffleHog (--results=verified filter + trufflehog:ignore), and Kingfisher (--baseline-file + --exclude/--skip-* flags); adopts legacy findings without blocking PRs; enforces a waiver lifecycle (expires + approved_by + reason) stored in .secrets-waivers.yaml; prevents baseline rot via quarterly audit + expiry enforcement. Use when onboarding secrets scanning onto a repo that already has historical findings, or when per-scanner ignore configs have drifted out of sync and need consolidating into one governed allowlist.
secrets-rotation-runner
Build-an-X for the secret-rotation workflow after detection - detect via gitleaks/trufflehog/kingfisher → identify provider via verifier → rotate via provider API (AWS IAM / GitHub PAT / Stripe / GCP / Azure / Twilio / Slack / etc.) → invalidate old secret → audit log via observability stack → post-mortem cross-ref. Use when a secret is detected in code (or proactively for periodic rotation) - assume git-history scrub does NOT prevent compromise.
trufflehog-scanning
Configures and runs TruffleHog v3 - secret scanner with **live verification** (validates discovered secrets against provider APIs to confirm actual exposure vs entropy false positive); supports per-source subcommands (`git`, `github`, `gitlab`, `filesystem`, `s3`, `docker`, `gcs`, `postman`); `--results=verified` filter for high-precision output; `--exclude-detectors=TYPE` for noise reduction; exits 183 on findings via `--fail`. Use when the team needs verified secret findings (low false-positive rate) or scans across cloud + repo + container surfaces.