/prodsec-skills-ge-core:secrets-detection-patternsfrom prodsec-skills-ge-core
Detects hardcoded secrets (API keys, tokens, passwords, private keys, connection strings) in source code using regex patterns. Use before committing, during code review, or for post-incident history scanning.
Ships in prodsec-skills-ge-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Pattern-based secrets detection for source code. This skill provides regex patterns, false positive filtering criteria, and remediation guidance for detecting hardcoded secrets. It is self-contained — no external tools (trufflehog, gitleaks) are required, though they are recommended as complementary tooling.
Any confirmed secret in code results in a BLOCKED verdict. There is no passing threshold — secrets in code are a critical finding. A secret is either present or it is not.
Reports must NEVER include actual secret values. Report secret type, file path, and line number only. Pattern matches are redacted to show type and location: e.g., "AWS Access Key at src/config.js:42".
Format: AKIA followed by 16 alphanumeric characters.
AKIA[0-9A-Z]{16}
40-character base64-like strings after a known label.
(aws_secret_access_key|aws_secret_key)\s*[=:]\s*[A-Za-z0-9/+=]{40}
Prefixes: ghp_, gho_, ghu_, ghs_, ghr_.
(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9_]{36}
RSA, EC, DSA, and OpenSSH private key headers.
-----BEGIN (RSA |EC |DSA |OPENSSH |PRIVATE )PRIVATE KEY-----
High-confidence labeled password assignments with values >= 8 characters.
(password|passwd|pwd|secret|api_key|apikey|api_secret|client_secret|auth_token|access_token)\s*[=:]\s*['"][^'"]{8,}['"]
Connection strings with embedded credentials.
(mysql|postgresql|postgres|mongodb|redis|amqp|jdbc)://[^@\s]+:[^@\s]+@
Three-part base64url segments separated by dots, starting with eyJ.
eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}
Prefix: xox[bpaso]-.
xox[bpaso]-[A-Za-z0-9-]{10,}
Prefix: AIza.
AIza[0-9A-Za-z_-]{35}
Prefixes: sk_live_, pk_live_, rk_live_, sk_test_.
(sk_live_|pk_live_|rk_live_|sk_test_)[0-9a-zA-Z]{24,}
Classify a match as FALSE POSITIVE if:
test/, tests/, spec/, fixtures/, __tests__/, testdata/).md, .rst, .txt, .adoc) showing an example format# example: AKIA...)AKIAIOSFODNN7… — AWS's documented sample key — your-secret-here, <YOUR_API_KEY>, xxx...xxx).env.example, .env.sample, or .env.template filepassword: 'test' in test files)mock, stub, fake)Classify a match as CONFIRMED if:
When secrets are detected:
example or fixture and use obviously fake valuesIf secrets have been committed to git history, consider:
git filter-branch or BFG Repo-Cleaner to remove from historytrufflehog or gitleaks for comprehensive history reviewFor production use, consider also deploying:
Note: The patterns in this skill use regex-based detection only. Entropy-based detection (for unstructured high-entropy strings) requires external tooling.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skills-ge-core12 skills in this plugin
/ai-code-reviewSecurity-focused review of AI-generated or AI-assisted code. Use when reviewing code produced by AI coding assistants, auditing AI-generated patches, verifying AI-assisted contributions before merge, or when a review needs to account for failure modes specific to AI code generation.
/ai-systems-securitySecure AI-powered products and infrastructure. Use when integrating LLM APIs, deploying model-serving infrastructure, building agent workflows, connecting MCP servers, or reviewing AI system architecture for security gaps.
/authenticationEnforce standard authentication for external data source connections. Use when integrating, configuring, or reviewing connections from AI systems to external databases, APIs, or data services./container-hardeningHarden container images and runtime configuration. Use when building, reviewing, or auditing Containerfiles, Dockerfiles, container compose files, or Kubernetes pod security settings.
/dependency-vulnerability-auditSupply chain security audit using CLI vulnerability scanners, license compliance checks, and supply chain risk assessment. Use when auditing project dependencies for known CVEs, license concerns, and supply chain health.
/input-validation-injectionApply when reviewing or writing code that processes untrusted input, constructs queries or commands, or handles user-supplied data. Covers SQL, LDAP, OS command injection, prototype pollution, and general validation strategy.
Other plugins' skills for the same job