Defense

From ariadoss/superskills · View interactive version

Defense is an AI agent skill from the GitHub repository ariadoss/superskills. Defense-in-depth security validation — multi-layered checks for OWASP Top 10, secrets, auth, crypto, and data protection.

How to use this skill

Skill file

Defense in Depth — Security Validation

Multi-layered security audit for web applications. Runs checks across 8 security layers.

Workflow

Run each layer sequentially. Report findings with severity (CRITICAL / HIGH / MEDIUM / LOW) and file:line references.

Layer 1: Secrets Scanning

Search for hardcoded secrets, API keys, tokens, and credentials.

grep -rn "API_KEY\|SECRET_KEY\|DATABASE_URL\|PRIVATE_KEY\|password\s*=\|sk_live\|sk_test" . \
  --include="*.ts" --include="*.tsx" --include="*.js" --include="*.py" --include="*.env" \
  | grep -v node_modules | grep -v ".next" | grep -v ".env.example" | grep -v __pycache__

Check:

Layer 2: Authentication & Authorization

# Find potentially unprotected API routes
find . -path "*/api/*/route.ts" -o -path "*/api/*/route.js" | xargs grep -L "auth\|session\|token\|verify" 2>/dev/null

Layer 3: Input Validation

# Check for template literal SQL or shell commands
grep -rn "exec(\`\|sql\`\|query(\`" . --include="*.ts" --include="*.js" | grep -v node_modules

Layer 4: Encryption

Layer 5: OWASP Top 10

| # | Risk | What to Check |

|---|------|---------------|

| A01 | Broken Access Control | Resource isolation, role checks, IDOR |

| A02 | Cryptographic Failures | PII encryption, key management |

| A03 | Injection | SQL, command, template injection |

| A04 | Insecure Design | Business logic flaws |

| A05 | Security Misconfiguration | Default creds, verbose errors, debug mode |

| A06 | Vulnerable Components | npm audit, outdated dependencies |

| A07 | Auth Failures | Session management, brute force protection |

| A08 | Data Integrity | Webhook signatures, CSRF tokens |

| A09 | Logging Failures | Audit trail, no PII in logs |

| A10 | SSRF | URL validation on server-side requests |

# Dependency vulnerabilities
npm audit --production 2>/dev/null | head -50

Layer 6: API Security

Layer 7: Rate Limiting & DoS Protection

Layer 8: Sensitive Data Protection

# Check for PII in logs
grep -rn "console\.\(log\|error\|warn\).*\(password\|ssn\|social\|secret\|token\)" . \
  --include="*.ts" --include="*.js" | grep -v node_modules

Report Format

## Security Audit Report

### Critical Findings
- [CRITICAL] Description — file:line

### High Findings
- [HIGH] Description — file:line

### Medium/Low Findings
- [MEDIUM/LOW] Description — file:line

### Passed Checks
- [PASS] Layer description
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.