agentsclimarketplace

Defense

Skill bg-szy/TOP-SKILLS/skills/superskills/defense

全球最大的 Claude Code 技能聚合库 · 收录 3900+ 来自 12+ 来源的技能,提供在线搜索与趋势分析看板 / The world's largest Claude Code skill aggregation hub — 3900+ skills from 12+ sources with online search and trend dashboard

Install
npx -y skills add bg-szy/TOP-SKILLS --skill defense

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Defense-in-depth security validation — multi-layered checks for OWASP Top 10, secrets, auth, crypto, and data protection.

SKILL.md

4.0 KB, ~1.0k tokens by cl100k_base, as published. Nobody here has run it

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:

  • No secrets in source code (should be in .env only)
  • .env is in .gitignore
  • No secrets in git history: git log --all -p -S "sk_live\|API_KEY\|SECRET" -- . ':!.env*' | head -50

Layer 2: Authentication & Authorization

  • Session handling: Token expiry, httpOnly/secure/sameSite cookies, invalidation on logout
  • Route protection: Every API route checks auth before processing
  • Role enforcement: Different user types can only access their own resources
  • IDOR prevention: Resource access scoped by authenticated user
# 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

  • All user inputs validated (schemas, type checks)
  • No raw SQL — use parameterized queries / ORM only
  • No command injection via string interpolation in shell calls
  • File uploads have type/size restrictions
  • URL parameters sanitized
# Check for template literal SQL or shell commands
grep -rn "exec(\`\|sql\`\|query(\`" . --include="*.ts" --include="*.js" | grep -v node_modules

Layer 4: Encryption

  • At rest: Sensitive data encrypted in database
  • In transit: HTTPS enforced, no HTTP fallbacks
  • Key management: Keys in env vars, not source code, not logged

Layer 5: OWASP Top 10

#RiskWhat to Check
A01Broken Access ControlResource isolation, role checks, IDOR
A02Cryptographic FailuresPII encryption, key management
A03InjectionSQL, command, template injection
A04Insecure DesignBusiness logic flaws
A05Security MisconfigurationDefault creds, verbose errors, debug mode
A06Vulnerable Componentsnpm audit, outdated dependencies
A07Auth FailuresSession management, brute force protection
A08Data IntegrityWebhook signatures, CSRF tokens
A09Logging FailuresAudit trail, no PII in logs
A10SSRFURL validation on server-side requests
# Dependency vulnerabilities
npm audit --production 2>/dev/null | head -50

Layer 6: API Security

  • Webhook signature verification (Stripe, etc.)
  • API keys not exposed to client-side code
  • Rate limiting on public endpoints
  • CORS properly configured
  • Content-Type validation

Layer 7: Rate Limiting & DoS Protection

  • API routes have rate limiting
  • Login endpoints have brute force protection
  • File upload size limits enforced
  • Expensive operations throttled

Layer 8: Sensitive Data Protection

  • PII never logged
  • PII not exposed in error messages
  • Sensitive fields excluded from API responses
  • Data retention policies enforced
# 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

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,984. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.