Security-focused code scan. Checks for hardcoded secrets, vulnerable dependencies, and common security issues.
Scans code for hardcoded secrets, vulnerable dependencies, and security issues.
/plugin marketplace add CloudAI-X/claude-workflow/plugin install project-starter@claude-workflowSecurity-focused code scanning. Run before commits and PRs to catch vulnerabilities.
Scan for hardcoded credentials:
# Common secret patterns
grep -rn "password\s*[=:]\s*['\"]" --include="*.{js,ts,py,go,java,rb}" . 2>/dev/null | grep -v node_modules | grep -v ".git"
grep -rn "api[_-]?key\s*[=:]\s*['\"]" --include="*.{js,ts,py,go,java,rb}" . 2>/dev/null | grep -v node_modules
grep -rn "secret\s*[=:]\s*['\"]" --include="*.{js,ts,py,go,java,rb}" . 2>/dev/null | grep -v node_modules
grep -rn "token\s*[=:]\s*['\"]" --include="*.{js,ts,py,go,java,rb}" . 2>/dev/null | grep -v node_modules
# AWS keys
grep -rn "AKIA[0-9A-Z]{16}" . 2>/dev/null | grep -v node_modules
# Private keys
find . -name "*.pem" -o -name "*.key" -o -name "id_rsa" 2>/dev/null | grep -v node_modules
Check for vulnerable dependencies:
npm audit --json 2>/dev/null | head -100
# or
yarn audit --json 2>/dev/null | head -100
pip-audit 2>/dev/null || safety check 2>/dev/null
govulncheck ./... 2>/dev/null
cargo audit 2>/dev/null
Check for dangerous patterns:
exec, system, subprocess)innerHTML with user datadangerouslySetInnerHTML without sanitization.. checksVerify security settings:
## Security Scan: [PASS/FAIL/WARNINGS]
### Secrets Detected: [count]
1. **CRITICAL** - `file:line`
- Type: [API key/password/token/private key]
- Action: Remove immediately and rotate credential
### Vulnerable Dependencies: [count]
1. **[package@version]** - Severity: [Critical/High/Medium/Low]
- CVE: [CVE number if available]
- Fixed in: [version]
- Action: Update to [version]
### Code Vulnerabilities: [count]
1. **[Vulnerability Type]** - `file:line`
- Risk: [description]
- Fix: [remediation steps]
### Configuration Issues: [count]
1. **[Issue]**
- Current: [state]
- Recommended: [secure state]
### Recommendations
1. [Prioritized action items]
Copy to your project:
cp templates/subagents/security-scan.md .claude/commands/
Invoke with: /project:security-scan