/appsec:secretsfrom appsec
Scans source code, config files, and git history for hardcoded credentials, API keys, tokens, and private keys. Uses gitleaks and trufflehog for automated detection.
Ships in appsec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Analyze source code, configuration files, and git history for hardcoded credentials, API keys, tokens, private keys, and other sensitive material that should never appear in version control. Secrets in code are among the most immediately exploitable vulnerabilities -- a single leaked API key can lead to full account compromise within minutes.
Read ../../shared/schemas/flags.md for the full flag specification. This skill
supports all cross-cutting flags. Key behaviors:
| Flag | Secrets-Specific Behavior |
|---|---|
--scope | Default changed. Secrets analysis scans all file types including config, YAML, JSON, .env, scripts, and source code. |
--depth quick | Scanners only (gitleaks/trufflehog), no manual pattern analysis. |
--depth standard | Full file read of scoped files + Grep heuristics for patterns scanners miss. |
--depth deep | Standard + scan git history for previously committed and removed secrets. |
--depth expert | Deep + verify whether detected secrets are still active/valid, DREAD scoring. |
--severity | Filter output. Most secrets findings are critical or high. |
--fix | Generate remediation: remove secret, add to .gitignore, rotate credential. |
Read references/detection-patterns.md for the full pattern catalog with
language-specific examples, regex heuristics, and false positive guidance.
Pattern Summary:
--scope flag (default: changed)..py, .js, .ts,
.java, .go, .env, .yml, .yaml, .json, .xml, .toml, .ini,
.cfg, .conf, .properties, .tf, .tfvars, .sh, .bash, .zsh,
.dockerfile, docker-compose.*, *.pem, *.key..gitignore coverage of sensitive file patterns.Detect available scanners in priority order:
| Scanner | Detect | Secrets Coverage |
|---|---|---|
| gitleaks | which gitleaks | 150+ secret patterns, git history scanning, custom rules |
| trufflehog | which trufflehog | 700+ credential detectors, live verification of found secrets |
| trivy | which trivy | Secrets detection as part of broader filesystem scan |
Record which scanners are available and which are missing. If none are available, note: "No scanner available -- findings based on code pattern analysis only."
For each available scanner, run against the scoped files:
gitleaks detect --source <target> --report-format json --report-path /dev/stdout --no-banner
trufflehog filesystem --json <target>
At --depth deep, also scan git history:
gitleaks detect --source <target> --report-format json --report-path /dev/stdout --no-banner --log-opts="--all"
trufflehog git --json file://<target>
Normalize scanner output to the findings schema (see ../../shared/schemas/findings.md).
Use the severity mapping from ../../shared/schemas/scanners.md.
Read each scoped file and analyze for secret patterns not caught by scanners:
key, secret, token,
password, credential, api_key, or similar?YOUR_API_KEY_HERE,
changeme, xxx, dummy, test, example, placeholder..env, *.pem, *.key, credentials.json
patterns in .gitignore? Flag missing patterns.At --depth deep or --depth expert:
Output findings using the format from ../../shared/schemas/findings.md.
Each finding must include:
SEC-001, SEC-002, etc.CRITICAL: Never output the actual secret value in findings. Always mask
the middle portion: AKIA****XMPL.
These are the primary secret patterns to detect. Each has detailed examples
and regex heuristics in references/detection-patterns.md.
AKIA[0-9A-Z]{16} patterns in source codepassword = "...", DB_PASSWORD, connection strings-----BEGIN RSA PRIVATE KEY----- and similar PEM headersPrimary: gitleaks (fast, comprehensive pattern matching), trufflehog (live verification)
Secondary: trivy (secrets as part of broader scanning)
Fallback: Grep regex patterns from references/detection-patterns.md
When scanners are available, run them first and use Claude analysis to:
When no scanners are available, Claude performs full pattern-based analysis using
the Grep heuristics from references/detection-patterns.md and contextual code
reading. Report these findings with confidence: medium.
Use finding ID prefix SEC (e.g., SEC-001, SEC-002).
All findings follow the schema in ../../shared/schemas/findings.md with:
references.cwe: "CWE-798" (hardcoded credentials) or "CWE-312" (cleartext storage)references.owasp: "A07:2021" (Identification and Authentication Failures)metadata.tool: "secrets"metadata.framework: "specialized"metadata.category: "SEC"CWE Mapping by Secret Type:
| Secret Type | CWE | Typical Severity |
|---|---|---|
| Hardcoded password | CWE-798 | critical |
| API key in source | CWE-798 | critical |
| Private key committed | CWE-321 | critical |
| .env file committed | CWE-312 | high |
| Connection string with credentials | CWE-798 | critical |
| High-entropy string (unverified) | CWE-798 | medium |
| Missing .gitignore for secret files | CWE-312 | medium |
After all findings, output a summary:
| Secret Type | Critical | High | Medium | Low |
|--------------------|----------|------|--------|-----|
| API Keys/Tokens | | | | |
| Passwords | | | | |
| Private Keys | | | | |
| Connection Strings | | | | |
| .env / Config | | | | |
| Git History | | | | |
Followed by: top 3 priorities, scanner coverage notes, rotation recommendations, and overall assessment.
What SKILL.md sets; muted values are Claude Code's defaults
62 skills in this plugin
/access-controlThis skill should be used when the user asks to "check for access control issues", "analyze authorization", "find IDOR vulnerabilities", "audit CORS configuration", "check for privilege escalation", or mentions "access control", "authorization", "IDOR", "CORS", "JWT tampering", or "directory traversal" in a security context. Maps to OWASP Top 10 2021 A01: Broken Access Control.
/apiThis skill should be used when the user asks to "check API security", "audit REST API", "find BOLA vulnerabilities", "check for mass assignment", "analyze API rate limiting", "detect excessive data exposure", or mentions "API security", "BOLA", "IDOR", "mass assignment", "rate limiting", "broken function-level authorization", "excessive data exposure", or "OWASP API Top 10" in a security context.
/attack-surfaceThis skill should be used when the user asks to "map attack surface", "list entry points", "inventory API endpoints", "find all inputs", "enumerate routes", "discover exposed endpoints", or "map external interfaces". Also triggers when the user asks about exposed APIs, form handlers, file upload endpoints, WebSocket handlers, CLI argument parsers, or wants to understand where external data enters the system.
/authThis skill should be used when the user asks to "check for authentication issues", "analyze auth", "find credential vulnerabilities", "review login security", "check session management", or mentions "authentication", "passwords", "MFA", "sessions", or "brute force" in a security context. Maps to OWASP Top 10 2021 A07: Identification and Authentication Failures.
/business-logicThis skill should be used when the user asks to "check business logic security", "find logic flaws", "audit workflow security", "check for coupon abuse", "detect negative amount exploits", "analyze state machine security", or mentions "business logic", "workflow bypass", "negative amount", "coupon abuse", "self-referral", "state manipulation", or "time-based exploit" in a security context.
/configThis skill should be used when the user asks to "configure security", "appsec settings", "security preferences", or invokes /appsec:config. Manages security tool preferences and thresholds.
npx claudepluginhub florianbuetow/claude-code --plugin appsecOther plugins' skills for the same job