Security analysis and hardening guide. Scan code for vulnerabilities and suggest fixes.
When this skill is invoked, perform a comprehensive security analysis of the codebase.
# Detect framework/language
[ -f package.json ] && echo "Node.js project"
[ -f requirements.txt ] && echo "Python project"
[ -f go.mod ] && echo "Go project"
# Search for potential secrets
grep -rn --include="*.ts" --include="*.js" --include="*.py" \
-E "(password|secret|api_key|apikey|token|credential).*=.*['\"][^'\"]{8,}" \
. 2>/dev/null | head -20
# Check for AWS keys
grep -rn --include="*.ts" --include="*.js" --include="*.env*" \
-E "AKIA[0-9A-Z]{16}" . 2>/dev/null
# Check for private keys
grep -rn "BEGIN.*PRIVATE KEY" . 2>/dev/null | head -10
# String concatenation in queries
grep -rn --include="*.ts" --include="*.js" \
-E "query.*\`.*\$\{|execute.*\+.*var" . 2>/dev/null | head -10
# dangerouslySetInnerHTML in React
grep -rn "dangerouslySetInnerHTML" --include="*.tsx" --include="*.jsx" . 2>/dev/null
# innerHTML assignments
grep -rn "innerHTML.*=" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
# exec, spawn without sanitization
grep -rn --include="*.ts" --include="*.js" \
-E "exec\(|spawn\(|execSync\(" . 2>/dev/null | head -10
# Run npm audit
npm audit 2>/dev/null | head -50
# Check for outdated packages with known vulnerabilities
npm outdated 2>/dev/null | head -20
# Look for helmet usage (Node.js)
grep -rn "helmet" --include="*.ts" --include="*.js" . 2>/dev/null | head -5
# Check for CORS configuration
grep -rn "cors\|Access-Control" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
# Look for authentication middleware
grep -rn --include="*.ts" --include="*.js" \
-E "authenticate|requireAuth|isAuthenticated|passport" . 2>/dev/null | head -10
# Check for JWT handling
grep -rn "jwt\|jsonwebtoken" --include="*.ts" --include="*.js" . 2>/dev/null | head -10
=== Security Analysis Report ===
Scan completed: 156 files analyzed
HIGH SEVERITY (Fix immediately):
1. Hardcoded API key found
File: src/config.ts:15
Issue: API_KEY = 'sk-1234...'
Fix: Move to environment variable
2. SQL Injection vulnerability
File: src/db/users.ts:42
Issue: query(`SELECT * FROM users WHERE id = ${id}`)
Fix: Use parameterized query
MEDIUM SEVERITY:
3. Missing rate limiting
File: src/routes/auth.ts
Fix: Add rate limiting middleware
LOW SEVERITY:
4. Outdated dependency
Package: lodash@4.17.15
Fix: Update to 4.17.21
Summary:
High: 2 issues
Medium: 1 issue
Low: 1 issue
Run `/ccmesh-fix` to auto-fix some issues.
--quick - Fast scan (secrets and critical vulnerabilities only)--deps - Only check dependencies--full - Complete OWASP Top 10 analysisSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer