Resource 03 · Credential exposure
Secret scanner
Find credentials exposed through source code, committed environment files, browser bundles, logs, examples, and build output.
What it examines
A focused review with evidence boundaries.
The skill is intentionally read-only. It separates confirmed findings from missing evidence and never treats an absent file as proof that a control exists.
Committed environment files
Frontend and mobile bundles
CI/CD configuration
Logs, fixtures, and examples
Git history when available
Run the skill
Paste it into your AI coding assistant.
Open the repository in your preferred coding assistant, give it read access to the project, then paste this instruction. Review its evidence before acting on any recommendation.
Act as an incident-aware secrets exposure reviewer. Scan this repository and available local git metadata without modifying files, checking out revisions, installing tools, contacting providers, testing credentials, or printing secret values.
Safety rules
- Never output a complete credential, token, private key, connection string, cookie, authorization header, recovery code, or sensitive record—even if it is already committed.
- Never run commands that expand environment variables or print process environments. Do not open opaque binary databases or credential stores.
- Redact findings as TYPE + first 3 characters + ellipsis + last 2 characters only when that fingerprint can be generated without exposing the value in command output. Otherwise use a stable hash prefix or simply [REDACTED].
- Do not validate a suspected secret against a live API. Validity is UNKNOWN unless repository evidence establishes the environment and capability.
Scan procedure
1. Establish scope. Identify tracked files, ignored-file rules, build/output directories, frontend/mobile targets, CI/CD systems, infrastructure code, container definitions, serverless configuration, examples, fixtures, logs, and local git history availability.
2. Search by structure and context, not one regex. Look for provider-specific prefixes, private-key headers, JWTs, database and broker URLs, DSNs, OAuth client secrets, signing/encryption keys, webhook secrets, cloud access keys, payment/email/SMS credentials, package tokens, cookies, bearer headers, and high-entropy assignments near sensitive variable names.
3. Inspect common exposure surfaces: committed .env variants, configuration fallbacks, test snapshots, debug logs, seed data, documentation, shell scripts, CI variables embedded in YAML, Docker build arguments, IaC defaults/outputs/state references, source maps, generated bundles, mobile resources, public directories, and error-reporting setup.
4. Distinguish server-only references from values shipped to browsers or mobile applications. Treat any production-capable secret in a client artifact as Critical because obfuscation and environment naming do not protect it.
5. When git history is available, search deleted and renamed content using safe metadata-aware commands. Report the earliest and latest observed commit identifiers without reproducing the value. Check whether later removal left deploy artifacts, releases, caches, images, packages, or forks exposed.
6. For each candidate, classify it before reporting:
- CONFIRMED SECRET: format and context strongly indicate an operational credential.
- PROBABLE SECRET: strong signal but environment or authenticity is uncertain.
- PLACEHOLDER/EXAMPLE: clearly non-operational sample value.
- FALSE POSITIVE: ordinary identifier, hash, test fixture, or public key.
7. Trace blast radius from evidence: provider/system, likely environment, permissions suggested by use, client/server exposure, git history, build/deploy propagation, logs, and dependent secrets that may need rotation.
Severity
- Critical: production-capable credential in public/client output, private key, privileged cloud/database/payment key, or secret preserved in public history/artifacts.
- High: likely operational server-side secret committed or logged with meaningful access.
- Medium: lower-environment credential, weak secret handling, or exposure requiring restricted repository access.
- Low: unsafe example or prevention gap with no credible live credential.
Output exactly these sections
1. Incident verdict — whether immediate containment is required, affected systems, and confidence.
2. Redacted findings table — ID, severity, classification, secret type, file:line or commit, exposure surface, environment, redacted fingerprint, confidence. Never include the value.
3. Propagation map — source, git history, CI, build artifacts, containers/packages, client bundles, logs/caches, downstream systems.
4. Containment and rotation order — revoke/disable, rotate authoritative credential, update dependents, redeploy, invalidate artifacts/caches, verify. Explain ordering to avoid locking out recovery.
5. Repository repair — exact files or patterns to remove, history-cleaning decision and coordination risks, safe example-variable replacements.
6. CI prevention — pre-commit and CI controls, allowlist process, baseline handling, artifact scanning, ownership, and pass/fail criteria. Recommend tools only when compatible with the detected stack.
7. Verification — safe searches and artifact checks that demonstrate the old credential fingerprint is absent and the application references the replacement without printing it.
8. False positives and evidence gaps — candidates reviewed but excluded, plus the precise evidence needed to resolve uncertainty.
Do not equate removal from the latest commit with containment. Do not advise committing a replacement secret. When a real exposure is plausible, prioritize revocation and blast-radius control over code cleanup.Expected output
A decision-ready result, not a vague code review.
Use the result as a starting point. High-risk findings still need human review before production changes are made.
- 01Redacted findings grouped by severity
- 02Whether each value appears live, test-only, or uncertain
- 03Where the secret can be read or executed
- 04Rotation and containment order
- 05Prevention checks for CI
Choose the next useful step
Use the result to ask a better engineering question.
The skill gives you a structured first pass. A senior review turns the evidence into an accountable decision.