comeonoliver/skillshub/when-auditing-security-use-security-analyzer

Claude Code and agent skill by comeonoliver/skillshub

Trust tier 2
  • community
  • ext:[{"type":"config","description":"Configuration overrides"}]
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Comprehensive security auditing across static analysis, dynamic testing, dependency vulnerabilities, secrets detection, and OWASP compliance

Install

npx vskill@latest install comeonoliver/skillshub/when-auditing-security-use-security-analyzer

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as aiskillstore/marketplace/when-auditing-security-use-security-analyzer.

Security Analyzer - Comprehensive Security Auditing Skill

Overview

This skill provides multi-vector security analysis combining static code analysis, dynamic testing, dependency auditing, secrets detection, and OWASP Top 10 compliance checking. Uses coordinated agents with validation gates between phases.

Architecture

Security Manager (Coordinator)
├─→ Phase 1: Static Analysis (Code Analyzer)
├─→ Phase 2: Dynamic Testing (Tester)
├─→ Phase 3: Dependency Audit (Security Manager)
├─→ Phase 4: Secrets Detection (Code Analyzer)
└─→ Phase 5: Compliance Check (Security Manager)

Phase 1: Static Code Analysis

Objective

Identify code-level vulnerabilities, security anti-patterns, and unsafe practices.

Security Manager Setup
bash
# Initialize security audit session
npx claude-flow@alpha hooks pre-task --description "Security static analysis initialization"
npx claude-flow@alpha hooks session-restore --session-id "security-audit-${DATE}"
# Set up memory namespace
npx claude-flow@alpha memory store \
--key "swarm/security/config" \
--value '{
"scan_type": "static",
"severity_threshold": "medium",
"frameworks": ["owasp", "cwe"],
"timestamp": "'$(date -Iseconds)'"
}'
Code Analyzer Execution
bash
# Spawn code analyzer agent for static analysis
# Agent performs:
# 1. SQL Injection Detection
npx claude-flow@alpha hooks pre-task --description "SQL injection vulnerability scan"
# Scan patterns:
# ❌ VULNERABLE:
# const query = "SELECT * FROM users WHERE id = " + userId;
# db.query("SELECT * FROM " + tableName);
#
# ✅ SECURE:
# const query = "SELECT * FROM users WHERE id = ?";
# db.query(query, [userId]);
grep -rn "\.query\|\.exec" --include="*.js" --include="*.ts" . | \
grep -v "?" | grep -v "\$[0-9]" > /tmp/sql-findings.txt
# 2. XSS Vulnerability Detection
# ❌ VULNERABLE:
# element.innerHTML = userInput;
# eval(userInput);
# new Function(userInput)();
#
# ✅ SECURE:
# element.textContent = userInput;
# JSON.parse(sanitizedInput);
grep -rn "innerHTML\|eval\|new Function" --include="*.js" --include="*.jsx" . > /tmp/xss-findings.txt
# 3. Path Traversal Detection
# ❌ VULNERABLE:
# fs.readFile(userPath);
# require(userInput);
#
# ✅ SECURE:
# const safePath = path.join(baseDir, path.normalize(userPath));
# if (!safePath.startsWith(baseDir)) throw new Error('Invalid path');
grep -rn "readFile\|writeFile\|require.*\+" --include="*.js" . > /tmp/path-traversal-findings.txt
# 4. Insecure Cryptography
# ❌ VULNERABLE:
# crypto.createHash('md5');
# crypto.createCipher('des', key);
#
# ✅ SECURE:
# crypto.createHash('sha256');
# crypto.createCipheriv('aes-256-gcm', key, iv);
grep -rn "md5\|sha1\|des\|rc4" --include="*.js" --include="*.ts" . > /tmp/crypto-findings.txt
# Store findings in memory
npx claude-flow@alpha memory store \
--key "swarm/security/static-analysis" \
--value "$(cat /tmp/*-findings.txt | jq -Rs '{findings: ., timestamp: now}')"
npx claude-flow@alpha hooks post-task --task-id "static-analysis"
Validation Gate 1
bash
# Check if critical vulnerabilities found
CRITICAL_COUNT=$(cat /tmp/*-findings.txt | grep -c ".")
if [ "$CRITICAL_COUNT" -gt 0 ]; then
echo "⚠️ GATE FAILED: $CRITICAL_COUNT potential vulnerabilities found"
npx claude-flow@alpha hooks notify --message "Static analysis found $CRITICAL_COUNT issues - review required"
# Continue but flag for review
fi

Phase 2: Dynamic Security Testing

Objective

Runtime vulnerability detection through active testing and fuzzing.

Tester Agent Execution
bash
npx claude-flow@alpha hooks pre-task --description "Dynamic security testing"
# 1. Authentication Bypass Testing
cat > /tmp/auth-test.js << 'EOF'
// Test suite for authentication vulnerabilities
const axios = require('axios');
async function testAuthBypass() {
const tests = [
// SQL Injection in auth
{ username: "admin'--", password: "anything" },
{ username: "admin' OR '1'='1", password: "" },
// JWT manipulation
{ token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0..." }, // None algorithm
// Session fixation
{ session: "../../admin-session" },
// NoSQL injection
{ username: { "$ne": null }, password: { "$ne": null } }
];
const vulnerabilities = [];
for (const test of tests) {
try {
const response = await axios.post('http://localhost:3000/login', test);
if (response.status === 200) {
vulnerabilities.push({
type: 'AUTH_BYPASS',
severity: 'CRITICAL',
payload: test,
description: 'Authentication bypass successful'
});
}
} catch (e) {
// Expected - auth failed
}
}
return vulnerabilities;
}
module.exports = { testAuthBypass };
EOF
# 2. CSRF Testing
cat > /tmp/csrf-test.js << 'EOF'
async function testCSRF() {
const response = await axios.post('http://localhost:3000/api/transfer', {
to: 'attacker',
amount: 1000
}, {
headers: {
'Origin': 'http://evil.com',
'Referer': 'http://evil.com'
}
});
// Should be rejected without CSRF token
if (response.status === 200) {
return {
type: 'CSRF',
severity: 'HIGH',
description: 'Missing CSRF protection on state-changing operation'
};
}
}
EOF
# 3. Rate Limiting Test
cat > /tmp/rate-limit-test.js << 'EOF'
async function testRateLimit() {
const requests = [];
for (let i = 0; i < 1000; i++) {
requests.push(axios.get('http://localhost:3000/api/data'));
}
const responses = await Promise.all(requests);
const successCount = responses.filter(r => r.status === 200).length;
if (successCount > 100) {
return {
type: 'NO_RATE_LIMIT',
severity: 'MEDIUM',
description: `No rate limiting detected - ${successCount}/1000 requests succeeded`
};
}
}
EOF
# Execute dynamic tests
node /tmp/auth-test.js > /tmp/dynamic-findings.json
node /tmp/csrf-test.js >> /tmp/dynamic-findings.json
node /tmp/rate-limit-test.js >> /tmp/dynamic-findings.json
npx claude-flow@alpha memory store \
--key "swarm/security/dynamic-testing" \
--value "$(cat /tmp/dynamic-findings.json)"
npx claude-flow@alpha hooks post-task --task-id "dynamic-testing"
Validation Gate 2
bash
CRITICAL_RUNTIME=$(jq '[.[] | select(.severity == "CRITICAL")] | length' /tmp/dynamic-findings.json)
if [ "$CRITICAL_RUNTIME" -gt 0 ]; then
echo "🚨 GATE FAILED: $CRITICAL_RUNTIME critical runtime vulnerabilities"
exit 1 # Hard stop for critical runtime issues
fi

Phase 3: Dependency Security Audit

Objective

Identify known vulnerabilities (CVEs) in dependencies and supply chain risks.

Security Manager Execution
bash
npx claude-flow@alpha hooks pre-task --description "Dependency vulnerability scan"
# 1. NPM Audit
npm audit --json > /tmp/npm-audit.json 2>&1 || true
# 2. Check for outdated packages with known vulnerabilities
npm outdated --json > /tmp/outdated.json 2>&1 || true
# 3. License compliance check
npx license-checker --json > /tmp/licenses.json 2>&1 || true
# 4. Check for malicious packages (typosquatting)
cat package.json | jq -r '.dependencies | keys[]' | while read pkg; do
# Check against known malicious package database
if grep -q "$pkg" /tmp/malicious-packages.txt 2>/dev/null; then
echo "⚠️ MALICIOUS PACKAGE DETECTED: $pkg"
fi
done > /tmp/malicious-check.txt
# 5. SBOM (Software Bill of Materials) generation
npx @cyclonedx/cyclonedx-npm --output-file /tmp/sbom.json
# Analyze CVE severity
jq '{
critical: [.vulnerabilities | to_entries[] | select(.value.severity == "critical")],
high: [.vulnerabilities | to_entries[] | select(.value.severity == "high")],
moderate: [.vulnerabilities | to_entries[] | select(.value.severity == "moderate")],
low: [.vulnerabilities | to_entries[] | select(.value.severity == "low")],
total: .metadata.vulnerabilities
}' /tmp/npm-audit.json > /tmp/dependency-summary.json
npx claude-flow@alpha memory store \
--key "swarm/security/dependencies" \
--value "$(cat /tmp/dependency-summary.json)"
npx claude-flow@alpha hooks post-task --task-id "dependency-audit"
Validation Gate 3
bash
CRITICAL_DEPS=$(jq '.critical | length' /tmp/dependency-summary.json)
HIGH_DEPS=$(jq '.high | length' /tmp/dependency-summary.json)
if [ "$CRITICAL_DEPS" -gt 0 ]; then
echo "🚨 GATE FAILED: $CRITICAL_DEPS critical dependency vulnerabilities"
npx claude-flow@alpha hooks notify --message "Critical CVEs detected in dependencies"
exit 1
fi
if [ "$HIGH_DEPS" -gt 5 ]; then
echo "⚠️ WARNING: $HIGH_DEPS high-severity dependency vulnerabilities"
fi

Phase 4: Secrets Detection

Objective

Identify exposed secrets, API keys, credentials, and sensitive data.

Code Analyzer Execution
bash
npx claude-flow@alpha hooks pre-task --description "Secrets and credentials detection"
# 1. Pattern-based secret detection
cat > /tmp/secret-patterns.txt << 'EOF'
# API Keys
AKIA[0-9A-Z]{16} # AWS Access Key
AIza[0-9A-Za-z_-]{35} # Google API Key
[REDACTED-EXAMPLE-PATTERN] # Stripe Secret Key pattern
xox[baprs]-[0-9]{10,12}-[0-9]{10,12}-[a-zA-Z0-9]{24} # Slack Token
# Passwords
password\s*=\s*['"]\w+['"]
api_key\s*=\s*['"]\w+['"]
secret\s*=\s*['"]\w+['"]
# Private Keys
-----BEGIN (RSA|DSA|EC|OPENSSH) PRIVATE KEY-----
# Database Credentials
(mongodb|postgres|mysql):\/\/[^:]+:[^@]+@
# JWT Tokens
eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}
EOF
# Scan codebase
grep -rEn -f /tmp/secret-patterns.txt \
--include="*.js" --include="*.ts" --include="*.json" --include="*.yaml" --include="*.env*" \
--exclude-dir=node_modules --exclude-dir=.git \
. > /tmp/secrets-found.txt 2>&1 || true
# 2. Entropy-based detection (random strings likely to be secrets)
find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.json" \) \
-not -path "*/node_modules/*" -not -path "*/.git/*" \
-exec grep -Eon '[A-Za-z0-9+/]{40,}' {} \; | \
awk 'length($0) > 40' > /tmp/high-entropy-strings.txt
# 3. Environment variable exposure check
grep -rn "process\.env\." --include="*.js" --include="*.ts" . | \
grep -v "process\.env\.NODE_ENV" | \
grep -v "\/\/" > /tmp/env-usage.txt
# 4. Hardcoded IP addresses and URLs
grep -rEon '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' \
--include="*.js" --include="*.ts" --include="*.json" \
. > /tmp/hardcoded-ips.txt
# Generate report
cat > /tmp/secrets-report.json << EOF
{
"secrets_found": $(wc -l < /tmp/secrets-found.txt),
"high_entropy_strings": $(wc -l < /tmp/high-entropy-strings.txt),
"env_exposures": $(wc -l < /tmp/env-usage.txt),
"hardcoded_ips": $(wc -l < /tmp/hardcoded-ips.txt),
"findings": $(cat /tmp/secrets-found.txt | jq -Rs 'split("\n") | map(select(length > 0))')
}
EOF
npx claude-flow@alpha memory store \
--key "swarm/security/secrets" \
--value "$(cat /tmp/secrets-report.json)"
npx claude-flow@alpha hooks post-task --task-id "secrets-detection"
Validation Gate 4
bash
SECRETS_COUNT=$(jq '.secrets_found' /tmp/secrets-report.json)
if [ "$SECRETS_COUNT" -gt 0 ]; then
echo "🚨 GATE FAILED: $SECRETS_COUNT potential secrets detected"
echo "Review findings in /tmp/secrets-found.txt"
exit 1
fi

Phase 5: OWASP Top 10 Compliance Check

Objective

Verify compliance with OWASP Top 10 security standards.

Security Manager Execution
bash
npx claude-flow@alpha hooks pre-task --description "OWASP Top 10 compliance audit"

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Extension points

  • configConfiguration overrides

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/comeonoliver/skillshub/when-auditing-security-use-security-analyzer/badge)](https://verified-skill.com/skills/comeonoliver/skillshub/when-auditing-security-use-security-analyzer)

Something wrong with this skill or its page? Tell us.