Security hardening with vulnerability scanning, configuration auditing, and security improvements
Performs comprehensive security hardening through vulnerability scanning, configuration auditing, and systematic security improvements.
/plugin marketplace add avovello/cc-plugins/plugin install harden@cc-pluginsPurpose: Security hardening through systematic vulnerability scanning, configuration auditing, and comprehensive security improvements
The harden command provides holistic security improvement beyond finding specific vulnerabilities. Research shows that 60% of breaches exploit known vulnerabilities that could have been prevented through proper hardening.
Key Distinction: Harden provides comprehensive security improvement, while Review finds specific issues in code.
Check target exists
Determine hardening scope
Identify technology stack
Run vulnerability-scanner agent to:
Output:
harden-analysis/
├── VULNERABILITIES.md # Identified vulnerabilities
├── CVE_REPORT.md # Known CVEs in dependencies
├── SECURITY_MISCONFIG.md # Configuration issues
└── EXPOSED_SECRETS.md # Potential secrets in code
Run security-config-auditor agent to:
Output: Configuration security assessment
Prioritize vulnerabilities by:
Output: Prioritized security roadmap
Design comprehensive hardening approach:
Output: HARDENING_PLAN.md with step-by-step approach
Based on findings, launch appropriate agents:
Authentication/Authorization:
Secrets Management:
Infrastructure Security:
Penetration Testing:
Compliance:
For each security improvement:
Apply Fix
Test Functionality
Verify Security
If Successful: ✅
Run penetration-tester agent to:
Success Criteria:
Run compliance-checker agent to:
Generate documentation:
harden-output/
├── HARDENING_SUMMARY.md # What was hardened
├── VULNERABILITIES_FIXED.md # Issues resolved
├── SECURITY_CONTROLS.md # New security measures
├── COMPLIANCE_STATUS.md # Compliance verification
└── SECURITY_CHECKLIST.md # Ongoing security tasks
Optional .claude/harden-config.yaml:
harden:
scope:
scan_dependencies: true # Scan for CVEs
scan_code: true # Scan source code
audit_configuration: true # Audit config files
test_security_controls: true # Penetration testing
severity_thresholds:
fix_critical: true # Auto-fix critical issues
fix_high: true # Auto-fix high severity
report_medium: true # Report medium severity
report_low: false # Ignore low severity
compliance:
standards: # Compliance requirements
- owasp-top-10
- gdpr
- soc2
secrets:
scan_patterns: # Patterns for secret detection
- api_key
- password
- secret
- token
- private_key
/harden "comprehensive security hardening"
# Output:
# ✅ Scanned 245 dependencies (found 8 CVEs)
# ✅ Scanned source code (found 12 vulnerabilities)
# ✅ Audited configuration (found 15 issues)
#
# Critical Issues (3):
# 1. SQL injection vulnerability in search endpoint
# 2. Hardcoded API key in config
# 3. Missing authentication on admin endpoint
#
# ✅ Step 1/20: Fixed SQL injection with parameterized queries
# ✅ Step 2/20: Moved API key to environment variable
# ✅ Step 3/20: Added authentication middleware to admin routes
# ...
#
# Security hardening complete:
# - 3 critical vulnerabilities fixed
# - 5 high-severity issues resolved
# - 8 dependencies updated
# - 15 configuration improvements applied
# ✅ All 156 tests pass
/harden "strengthen authentication and authorization"
# Output:
# ✅ Audited authentication system
# ✅ Found 6 issues:
# 1. Weak password requirements (min 6 chars)
# 2. No rate limiting on login
# 3. JWT tokens never expire
# 4. No MFA support
# 5. Session fixation vulnerability
# 6. Insufficient authorization checks
#
# ✅ Applied hardening:
# 1. Increased password requirements (12+ chars, complexity)
# 2. Added rate limiting (5 attempts per 15 min)
# 3. Set JWT expiration (1 hour access, 7 days refresh)
# 4. Implemented MFA with TOTP
# 5. Regenerate session ID on login
# 6. Added role-based authorization checks
#
# Authentication hardened ✅
# Penetration tests pass ✅
Before completing hardening:
harden-output/
├── VULNERABILITY_SCAN.md # Initial scan results
├── HARDENING_PLAN.md # Step-by-step plan
├── HARDENING_SUMMARY.md # What was hardened
├── VULNERABILITIES_FIXED.md # Issues resolved
├── SECURITY_CONTROLS.md # Security measures added
├── PENETRATION_TEST.md # Security test results
├── COMPLIANCE_STATUS.md # Compliance verification
└── SECURITY_CHECKLIST.md # Ongoing security tasks
/review finds issues → /harden fixes them comprehensively/audit identifies debt, /harden improves security