π Security & Compliance Skills Suite
Skill by
ara.so β Security Skills collection.
This skill suite provides specialized commands and workflows for security audits, vulnerability management, compliance (GDPR/SOC2/ISO27001), and incident response. Derived from hesreallyhim/awesome-claude-code, it offers 10 security-focused commands and 5 multi-step workflows with structured output.
Installation
Local Installation
bash
# Clone the repository
git clone https://github.com/sparkfinderoven/r01-hesreallyhim-awesome-claude-code-security.git
# Copy to Claude skills directory
mkdir -p ~/.claude/skills
cp -r r01-hesreallyhim-awesome-claude-code-security ~/.claude/skills/security-compliance
# Or create symlink for auto-updates
ln -s $(pwd)/r01-hesreallyhim-awesome-claude-code-security ~/.claude/skills/security-compliance
Register with Claude Code
In a Claude Code session:
bash
/read ~/.claude/skills/security-compliance/SKILL.md
Core Commands
/owasp-scan - OWASP Top 10 Security Scan
Scans code for OWASP Top 10 vulnerabilities with exploit descriptions, CVSS scores, and remediation steps.
Usage:
bash
/owasp-scan <target_directory>
/owasp-scan src/ --output json
/owasp-scan . --exclude node_modules,dist
Output Structure:
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OWASP Top 10 Scan β src/ β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ£
β A01 Broken Access Control β 3 checks β
β A02 Cryptographic Failures β 2 checks β
β A03 Injection β 5 checks β
β A04 Insecure Design β 1 check β
β A05 Security Misconfiguration β 4 checks β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
FINDINGS (17 files scanned)
ββββββββ¬βββββββββββββββββββββββββββββββββ¬βββββββββββ¬ββββββββββββββ
β Sev β Vulnerability β CVSS β File:Line β
ββββββββΌβββββββββββββββββββββββββββββββββΌβββββββββββΌββββββββββββββ€
β π΄ β SQL Injection β 9.8 β api.js:45 β
β π΄ β Hardcoded JWT Secret β 9.1 β auth.js:12 β
β π β Insecure Deserialization β 8.1 β parser.js:8 β
β π‘ β Missing CSRF Protection β 6.5 β routes.js:3 β
ββββββββ΄βββββββββββββββββββββββββββββββββ΄βββββββββββ΄ββββββββββββββ
Example Remediation:
javascript
// β VULNERABLE: SQL Injection
const query = `SELECT * FROM users WHERE id = ${req.params.id}`;
// β
FIXED: Parameterized Query
const query = 'SELECT * FROM users WHERE id = ?';
db.query(query, [req.params.id]);
// β VULNERABLE: Hardcoded Secret
const secret = 'my-secret-key-123';
// β
FIXED: Environment Variable
const secret = process.env.JWT_SECRET;
/dep-cve - Dependency CVE Scanner
Analyzes project dependencies for known CVEs with exploitability scores and upgrade paths.
Usage:
bash
/dep-cve
/dep-cve --scope full --output md
/dep-cve --severity high,critical
Example Output:
CVE SCAN RESULTS (234 dependencies checked)
Critical Vulnerabilities: 2
High: 5
Medium: 12
Low: 8
ββββββββββββββ¬ββββββββββββββββββ¬βββββββββββ¬βββββββββββββ¬βββββββββββββββ
β Package β CVE ID β CVSS β Current β Fix Version β
ββββββββββββββΌββββββββββββββββββΌβββββββββββΌβββββββββββββΌβββββββββββββββ€
β lodash β CVE-2021-23337 β 9.8 β 4.17.15 β 4.17.21 β
β express β CVE-2022-24999 β 7.5 β 4.17.1 β 4.18.0 β
ββββββββββββββ΄ββββββββββββββββββ΄βββββββββββ΄βββββββββββββ΄βββββββββββββββ
UPGRADE PATH:
npm update lodash@4.17.21 express@4.18.0
Checking in CI/CD:
yaml
# .github/workflows/security.yml
name: Security Scan
on: [push, pull_request]
jobs:
cve-scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: CVE Scan
run: |
/dep-cve --severity critical,high --output json > cve-report.json
if [ $(jq '.critical + .high' cve-report.json) -gt 0 ]; then
exit 1
fi
/gdpr-audit - GDPR Compliance Audit
Maps data flows, identifies consent gaps, and generates DPA (Data Processing Agreement) checklists.
Usage:
bash
/gdpr-audit
/gdpr-audit --scope full --output pdf
/gdpr-audit --focus consent,data-flow
Example Analysis:
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GDPR Compliance Audit β
β βββββββββββββββββββββββββββββββββββββββββββββββββββ£
β Data Inventory β Complete β
β Consent Mechanisms β 3 gaps found β
β Data Flow Mapping β Complete β
β DPA Requirements β 5 missing β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
DATA FLOWS IDENTIFIED:
User Registration β Database (EU) β Analytics (US) β Email Provider (US)
CONSENT GAPS:
π΄ Analytics tracking: No explicit consent banner
π΄ Email marketing: Opt-out only (requires opt-in)
π‘ Cookie policy: Missing granular control
ACTION ITEMS:
β‘ Implement consent management platform (est: 2 weeks)
β‘ Add cookie consent banner with granular controls (est: 3 days)
β‘ Update privacy policy with Article 13/14 requirements (est: 1 week)
β‘ Establish Data Processing Agreements with US vendors (est: 2 weeks)
Implementation Example:
javascript
// GDPR-compliant consent implementation
class ConsentManager {
constructor() {
this.consent = this.loadConsent();
}
requestConsent(purposes = ['necessary', 'analytics', 'marketing']) {
return {
necessary: true, // Always granted
analytics: this.consent.analytics || false,
marketing: this.consent.marketing || false,
timestamp: new Date().toISOString()
};
}
grantConsent(purpose) {
this.consent[purpose] = true;
this.consent.timestamp = new Date().toISOString();
this.saveConsent();
}
revokeConsent(purpose) {
this.consent[purpose] = false;
this.saveConsent();
this.deleteData(purpose); // Article 17: Right to erasure
}
saveConsent() {
// Store in cookie with 13-month expiry (ePrivacy Directive)
document.cookie = `gdpr_consent=${JSON.stringify(this.consent)}; max-age=${60*60*24*395}; secure; samesite=strict`;
}
}
/soc2-readiness - SOC 2 Type II Readiness Assessment
Gap analysis across all 5 Trust Service Criteria (TSC): Security, Availability, Processing Integrity, Confidentiality, Privacy.
Usage:
bash
/soc2-readiness
/soc2-readiness --tsc security,availability
/soc2-readiness --generate-evidence-list
Example Report:
SOC 2 TYPE II READINESS ASSESSMENT
Overall Readiness: 68% (Medium Risk)
ββββββββββββββββββββββββββββββ¬βββββββββββ¬βββββββββββ¬ββββββββββββββ
β Trust Service Criteria β Score β Gaps β Risk Level β
ββββββββββββββββββββββββββββββΌβββββββββββΌβββββββββββΌββββββββββββββ€
β CC1: Control Environment β 75% β 3 β π‘ Medium β
β CC2: Communication β 80% β 2 β π’ Low β
β CC3: Risk Assessment β 60% β 5 β π High β
β CC4: Monitoring β 70% β 4 β π‘ Medium β
β CC5: Control Activities β 65% β 6 β π High β
β CC6: Logical Access β 55% β 8 β π΄ Criticalβ
β CC7: System Operations β 72% β 3 β π‘ Medium β
ββββββββββββββββββββββββββββββ΄βββββββββββ΄βββββββββββ΄ββββββββββββββ
CRITICAL GAPS (CC6: Logical Access):
π΄ No MFA enforcement for administrative accounts
π΄ Password policy does not meet complexity requirements
π΄ No formal access review process (90-day requirement)
π΄ Service accounts share credentials
REMEDIATION ROADMAP (12 weeks):
Week 1-2: Implement MFA (Okta/Auth0)
Week 3-4: Deploy password manager + rotate service accounts
Week 5-6: Establish quarterly access review process
Week 7-8: Implement SIEM for security monitoring
Week 9-10: Conduct tabletop exercise for incident response
Week 11-12: Evidence collection + documentation
/threat-model - STRIDE Threat Modeling
Generates STRIDE threat models for architecture diagrams with risk matrices.
Usage:
bash
/threat-model <architecture_file>
/threat-model design.drawio --output md
/threat-model --interactive
Example Analysis:
STRIDE THREAT MODEL: E-Commerce API
ARCHITECTURE COMPONENTS:
- Web App (React) β API Gateway β Microservices β Database
- Auth Service (JWT) β Redis Cache
- Payment Service β Stripe API
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ¬βββββββββββ¬βββββββββ
β Threat Type β Threat β Impact β Risk β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββΌβββββββββββΌβββββββββ€
β Spoofing β JWT token forgery β High β 8.5 β
β Tampering β API request parameter manipulation β High β 7.2 β
β Repudiation β Missing audit logs for payment ops β Medium β 6.0 β
β Info Disc. β PII exposed in API error messages β High β 7.8 β
β DoS β No rate limiting on /api/search β Medium β 5.5 β
β Elevation β Admin endpoints accessible w/o authzβ Criticalβ 9.2 β
ββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββ΄βββββββββββ΄βββββββββ
MITIGATIONS:
β Use asymmetric JWT with RS256 (not HS256)
β Implement request signature validation
β Add structured logging with correlation IDs
β Sanitize error messages (remove stack traces)
β Deploy rate limiting (Redis-backed)
β Implement RBAC with least-privilege principle
Code Example:
javascript
// Implementing RBAC for elevation of privilege mitigation
const permissions = {
user: ['read:profile', 'write:profile'],
admin: ['read:*', 'write:*', 'delete:*'],
auditor: ['read:*']
};
function authorize(role, action, resource) {
const userPerms = permissions[role] || [];
// Check exact match
if (userPerms.includes(`${action}:${resource}`)) return true;
// Check wildcard
if (userPerms.includes(`${action}:*`)) return true;
return false;
}
// Middleware usage
app.delete('/api/users/:id', (req, res, next) => {
if (!authorize(req.user.role, 'delete', 'users')) {
return res.status(403).json({ error: 'Forbidden' });
}
next();
});
/secret-detect - Pre-commit Secret Detection
Configures pre-commit hooks for secret detection with entropy scanning.
Usage:
bash
/secret-detect --init
/secret-detect --scan .
/secret-detect --generate-config
Generated Configuration:
yaml
# .pre-commit-config.yaml
repos:
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
exclude: package-lock.json
- repo: https://github.com/gitleaks/gitleaks
rev: v8.16.1
hooks:
- id: gitleaks
Custom Rules:
python
# .detect-secrets/custom-rules.py
import re
class CustomSecretDetector:
"""Detect organization-specific secrets"""
secret_type = 'Custom API Key'
def analyze_string(self, string):
# Matches: ACME_KEY_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
pattern = r'ACME_KEY_[A-Za-z0-9]{32}'
return bool(re.search(pattern, string))
Git Hook Installation:
bash
#!/bin/bash
# .git/hooks/pre-commit
# Run secret detection
detect-secrets-hook --baseline .secrets.baseline $(git diff --cached --name-only)
if [ $? -ne 0 ]; then
echo "β Secret detected! Commit blocked."
echo "To allow, update baseline: detect-secrets scan > .secrets.baseline"
exit 1
fi
# Run gitleaks
gitleaks protect --staged --verbose
exit $?
/iam-audit - IAM Least-Privilege Audit
Audits IAM roles for over-permissioned access, stale accounts, and MFA gaps.
Usage:
bash
/iam-audit
/iam-audit --provider aws
/iam-audit --focus mfa,stale-access
Example Report:
IAM AUDIT RESULTS
Users Scanned: 47
Roles Scanned: 23
Policies Scanned: 156