secrets
This skill should be used when the user asks to "check for secrets", "find hardcoded credentials", "scan for API keys", "detect leaked tokens", "find…
от florianbuetow★ 22 звезды на GitHub
Установить secrets в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Secrets Detection (SEC)
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.
Supported Flags
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. |
Detection Patterns
Read references/detection-patterns.md for the full pattern catalog with
language-specific examples, regex heuristics, and false positive guidance.
Pattern Summary:
- API keys and tokens hardcoded in source code
- Passwords and credentials in configuration files
- .env files committed to version control
- Private keys (RSA, EC, PGP) in repository
- Database connection strings with embedded credentials
- High-entropy strings matching secret patterns
Workflow
Step 1: Determine Scope
- Parse
--scopeflag (default:changed). - Resolve to a concrete file list.
- Include ALL file types -- secrets can appear anywhere:
.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. - Check for
.gitignorecoverage of sensitive file patterns.
Step 2: Check for Scanners
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."
Step 3: Run Scanners
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.
Step 4: Claude Analysis
Read each scoped file and analyze for secret patterns not caught by scanners:
- Identify secret-like values: Look for strings matching API key formats, base64-encoded credentials, high-entropy strings in assignment contexts.
- Check context: Is the value in a variable named
key,secret,token,password,credential,api_key, or similar? - Verify not placeholder: Exclude values like
YOUR_API_KEY_HERE,changeme,xxx,dummy,test,example,placeholder. - Check .gitignore: Are
.env,*.pem,*.key,credentials.jsonpatterns in.gitignore? Flag missing patterns. - Deduplicate: Merge Claude findings with scanner findings.
At --depth deep or --depth expert:
- Trace secret usage across files to map exposure surface.
- Check if secrets are loaded from environment variables (good) vs hardcoded (bad).
- Verify secret rotation practices (key age, rotation infrastructure).
Step 5: Report
Output findings using the format from ../../shared/schemas/findings.md.
Each finding must include:
- id:
SEC-001,SEC-002, etc. - title: Secret type and location (e.g., "AWS access key in config.py").
- severity: Based on secret type, exposure scope, and verification status.
- location: File, line, and masked snippet (NEVER include the full secret).
- description: What type of secret was found and how it is exposed.
- impact: What an attacker can access with this secret.
- fix: Remove from code, add to .gitignore, rotate credenti
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/detection-patterns.md
FAQ
Что делает скилл secrets?
This skill should be used when the user asks to "check for secrets", "find hardcoded credentials", "scan for API keys", "detect leaked tokens", "find passwords in code", "check for committed .env files", "scan for private keys", or mentions "secrets", "credentials", "API keys", or "leaked tokens" in a security context. Also triggers for git history secret scanning and high-entropy string detection.
Как установить скилл secrets?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл secrets запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…