From codacy
Comprehensive security review combining Codacy CLI v2 static analysis with AI-powered security insights. Analyzes code for vulnerabilities, provides remediation guidance, and generates security reports.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codacy:security-reviewThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are performing a comprehensive security review that combines Codacy's static analysis tools with your AI-powered security expertise. **This review is enhanced by project-specific profiles and security patterns generated during setup.**
You are performing a comprehensive security review that combines Codacy's static analysis tools with your AI-powered security expertise. This review is enhanced by project-specific profiles and security patterns generated during setup.
The user may provide: $ARGUMENTS
path: Specific file or directory to analyze (default: entire project)--tool <tool>: Focus on specific tool (eslint, trivy, semgrep, pylint, etc.)--severity <level>: Minimum severity to report (info, warning, error, critical)--sarif: Generate SARIF output file for integrationCRITICAL: Before running any analysis, check for and load the project profile:
# Check for project profile
ls -la .codacy/project-profile.yaml 2>/dev/null
ls -la .codacy/security-patterns.yaml 2>/dev/null
If the profile exists, read it to understand:
If the profile does NOT exist, suggest running /codacy:setup first for a more targeted analysis.
codacy-cli-v2):~/.local/bin/codacy-cli-v2 version 2>/dev/null || codacy-cli-v2 version
ls -la .codacy/ 2>/dev/null || echo "Not configured"
If not configured, suggest running /codacy:setup first.
Note: Use ~/.local/bin/codacy-cli-v2 for all commands if the binary is not in PATH.
Execute the full analysis suite:
All tools (default):
~/.local/bin/codacy-cli-v2 analyze 2>&1
Specific tool (if requested):
~/.local/bin/codacy-cli-v2 analyze --tool <tool> 2>&1
With SARIF output (if requested):
~/.local/bin/codacy-cli-v2 analyze --format sarif -o security-report.sarif 2>&1
If .codacy/security-patterns.yaml exists, use it to guide additional checks:
Based on detected languages, search for patterns using Grep:
For JavaScript/TypeScript projects:
Search for patterns like:
- eval\s*\(
- innerHTML\s*=
- dangerouslySetInnerHTML
- child_process\.exec
- new Function\s*\(
For Python projects:
Search for patterns like:
- exec\s*\(|eval\s*\(
- pickle\.loads?
- subprocess.*shell\s*=\s*True
- yaml\.load\s*\(
For Go projects:
Search for patterns like:
- fmt\.Sprintf.*sql
- exec\.Command.*\+
- template\.HTML
If frameworks are detected in the profile, search for framework-specific vulnerabilities:
React:
dangerouslySetInnerHTML usagehref attributes with user inputExpress:
req.body, req.query, req.paramsres.redirectDjango:
| safe filter usageFlask:
| safe in templatessend_file path traversal risksFastAPI:
allow_origins=["*"]Based on detected security components, perform targeted analysis:
If Authentication detected:
If Database detected:
If File Handling detected:
If External APIs detected:
Scan for secrets using patterns from security-patterns.yaml:
Search for:
- AWS keys: AKIA[0-9A-Z]{16}
- GitHub tokens: gh[pousr]_[A-Za-z0-9_]{36,}
- Generic API keys: api[_-]?key.*[:=].*['"][a-zA-Z0-9]{20,}
- Database URLs: (mysql|postgres|mongodb)://
- Private keys: -----BEGIN.*PRIVATE KEY-----
From the project profile or patterns, identify and review critical files:
**/auth/**, **/login/**)**/middleware/**)**/config/**, **/.env*)**/Dockerfile*, **/kubernetes/**, **/terraform/**)For each critical file found, perform a brief security-focused review.
For each significant finding from Codacy AND custom pattern matching, provide:
Severity Assessment: Evaluate the real-world risk considering:
Root Cause Analysis: Explain WHY this is a vulnerability, not just WHAT it is
Remediation Guidance: Provide specific, actionable fixes with code examples
Related Concerns: Identify similar patterns that might exist elsewhere
Beyond static analysis, perform intelligent code review focusing on areas identified in the project profile:
Authentication & Authorization (if detected)
Input Validation (at detected entry points)
Cryptography
Data Exposure
Error Handling
Business Logic
Create a structured report with project context:
# Security Review Report
## Project Context
- **Project**: <from profile>
- **Type**: <web-app|api|library|cli>
- **Architecture**: <monolith|microservices|serverless>
- **Primary Language**: <language>
- **Frameworks**: <list>
## Executive Summary
- Total issues found: X
- Critical: X | High: X | Medium: X | Low: X
- Overall risk assessment
- Key areas of concern based on project type
## Critical Findings
[List critical issues with full details]
### Issue 1: <Title>
- **Severity**: Critical
- **Location**: `file:line`
- **CWE**: CWE-XXX
- **Description**: What the issue is
- **Impact**: What could happen if exploited
- **Remediation**: How to fix it
- **Code Example**:
```<lang>
// Before (vulnerable)
...
// After (fixed)
...
[List high priority issues with same format]
[List medium priority issues]
[List low priority issues]
Based on project profile, the following patterns were specifically checked:
| File | Reason | Issues Found |
|---|---|---|
| src/auth/jwt.ts | Authentication logic | 2 |
| src/middleware/auth.ts | Request processing | 1 |
| config/config.yaml | Configuration | 0 |
## Output Guidelines
1. **Be Specific**: Include file paths, line numbers, and code snippets
2. **Be Actionable**: Every finding should have a clear remediation path
3. **Prioritize**: Help the user focus on what matters most
4. **Context Matters**: Consider the project type and architecture from the profile
5. **No False Positives**: If uncertain, investigate further before reporting
6. **Leverage Profile**: Use project-specific knowledge for more accurate assessment
## OWASP Top 10 Checklist
Ensure coverage of:
- A01: Broken Access Control
- A02: Cryptographic Failures
- A03: Injection
- A04: Insecure Design
- A05: Security Misconfiguration
- A06: Vulnerable Components
- A07: Authentication Failures
- A08: Data Integrity Failures
- A09: Logging Failures
- A10: SSRF
## Example Workflow
```bash
# Load project profile first
cat .codacy/project-profile.yaml
# Run full analysis
~/.local/bin/codacy-cli-v2 analyze
# For specific concerns based on profile:
# - If Python + Flask detected:
~/.local/bin/codacy-cli-v2 analyze --tool pylint
~/.local/bin/codacy-cli-v2 analyze --tool semgrep
# - If JavaScript + React detected:
~/.local/bin/codacy-cli-v2 analyze --tool eslint
~/.local/bin/codacy-cli-v2 analyze --tool semgrep
# - For dependency vulnerabilities:
~/.local/bin/codacy-cli-v2 analyze --tool trivy
After Codacy analysis:
npx claudepluginhub jaimefjorge/codacy-plugin --plugin codacyOrchestrates parallel agents for security code audits (OWASP/CWE), secrets scanning, and dependency CVE checks on codebases, staged changes, or PRs.
Scans local projects for dependency vulnerabilities (SCA), code security patterns (SAST), leaked secrets, auth/crypto flaws, misconfigs, supply chain risks, CI/CD issues. Generates prioritized report with remediation guidance.
Performs full security code reviews on target repositories using Project CodeGuard core rules and stack-specific OWASP rules, producing markdown reports with prioritized findings, impacts, and remediations.