security-hardening
A systematic security workflow to harden applications against vulnerabilities.
Install
mkdir -p .claude/skills/security-hardening-doumajnik && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10256" && unzip -o skill.zip -d .claude/skills/security-hardening-doumajnik && rm skill.zipInstalls to .claude/skills/security-hardening-doumajnik
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Full security audit and hardening workflow covering OWASP Top 10, dependency scanning, secrets management, and infrastructure security. Use when auditing security, hardening an application, or responding to vulnerability reports. Triggers on: security, harden, vulnerability, OWASP, audit, CVE, penetration.Key capabilities
- →Threat modeling
- →OWASP Top 10 auditing
- →Dependency vulnerability scanning
- →Secrets detection
- →Auth and input validation review
How it works
The agent performs a multi-phase audit covering attack surface mapping, dependency checks, and code-level security reviews, documenting all findings in a structured report.
Inputs & outputs
When to use security-hardening
- →Security audit
- →Harden application
- →Check owasp compliance
About this skill
Security Hardening Skill
Full security audit and hardening pipeline. Covers threat modeling, OWASP Top 10 compliance, dependency scanning, secrets management, auth review, input validation, infrastructure hardening, and verified remediation.
References
- OWASP Top 10 Checklist — all OWASP Top 10 2021 items with check procedures
- Security Headers Reference — HTTP security header recommendations and common mistakes
Pipeline
Phase 1: Threat Modeling
Identify the application's attack surface before auditing code.
- Map all entry points — HTTP endpoints, WebSocket handlers, CLI commands, message consumers, file upload paths
- Identify trust boundaries — where untrusted data crosses into trusted zones (user input → server, server → database, service → service)
- Document data flows — trace sensitive data (credentials, PII, tokens, payment info) from ingress to storage to egress
- Enumerate threat actors — anonymous users, authenticated users, internal services, supply chain (dependencies), infrastructure operators
- Classify assets by sensitivity — public, internal, confidential, restricted
- Produce a threat model summary: entry points, trust boundaries, data classification, and identified risks ranked by likelihood × impact
Phase 2: OWASP Top 10 Audit
Systematically check every OWASP Top 10 2021 category against the codebase. Use the full checklist in references/owasp-checklist.md.
- For each of the 10 categories (A01–A10), check every item in the checklist
- For each finding, record: category, file, line, severity (CRITICAL/HIGH/MEDIUM/LOW), description, and recommended fix
- Cross-reference with the threat model — findings on high-sensitivity data flows escalate one severity level
- Flag any category with zero findings as "reviewed — no issues found" (not "skipped")
- Append all findings to
docs/SECURITY_REPORT.md
Phase 3: Dependency Scanning
Audit all direct and transitive dependencies for known vulnerabilities.
- Identify the package manager(s) in use (npm, pip, cargo, go modules, NuGet, Maven, etc.)
- Run or simulate a dependency audit — check for known CVEs in all dependencies
- Flag outdated packages — any dependency more than 2 major versions behind or with known CVEs
- Check license compliance — flag copyleft licenses (GPL, AGPL) in proprietary projects, flag unknown licenses
- Identify unused dependencies — installed but never imported
- Record findings with: package name, current version, latest version, CVE IDs (if any), severity, and recommended action (update/replace/remove)
Phase 4: Secrets Audit
Scan for hardcoded secrets and verify secrets management practices.
- Search the entire codebase for hardcoded secrets — API keys, passwords, tokens, connection strings, private keys, JWTs
- Check patterns:
password=,secret=,api_key=,token=,-----BEGIN, base64-encoded strings in source,.envfiles committed to git - Verify
.gitignoreincludes:.env,.env.*,*.pem,*.key, secrets directories - Check git history for previously committed secrets (even if currently removed)
- Verify secrets are loaded from environment variables or a secrets manager — never from source code
- Check secret rotation policies — are there expiration dates, rotation mechanisms, or revocation procedures?
- Flag any finding as CRITICAL — hardcoded secrets are always critical severity
Phase 5: Authentication & Authorization
Audit auth flows, session management, and access control.
- Review authentication mechanisms — password hashing algorithm (bcrypt/argon2/scrypt, NOT MD5/SHA1), multi-factor auth support, account lockout after failed attempts
- Check session management — secure cookie flags (HttpOnly, Secure, SameSite), session expiration, session invalidation on logout, token rotation
- Audit authorization — verify access control checks on every protected endpoint, check for IDOR vulnerabilities, verify RBAC/ABAC implementation
- Check password policies — minimum length (≥12), complexity requirements, breach database checking
- Review JWT handling (if applicable) — algorithm validation (reject
none), expiration enforcement, audience/issuer validation, key management - Verify OAuth/OIDC flows (if applicable) — state parameter usage, PKCE for public clients, redirect URI validation
Phase 6: Input Validation
Check all user input paths for proper sanitization and injection prevention.
- Trace every path where user input enters the system (request params, headers, body, file uploads, URL paths)
- Check for SQL injection — verify parameterized queries or ORM usage everywhere, no string concatenation in queries
- Check for XSS — verify output encoding in templates, CSP headers, no
innerHTML/dangerouslySetInnerHTMLwith user data - Check for command injection — verify no shell command construction with user input, use parameterized APIs
- Check for path traversal — verify file path inputs are sanitized, no
../sequences reach the filesystem - Check for SSRF — verify URL inputs are validated against allowlists, no internal network access from user-supplied URLs
- Verify file upload security — type validation (not just extension), size limits, storage outside webroot, filename sanitization
- Check for mass assignment — verify request body fields are explicitly allowlisted, not blindly bound to models
Phase 7: Infrastructure Security
Audit HTTP headers, TLS configuration, CORS policy, and rate limiting.
- Check all security headers per references/security-headers.md — CSP, HSTS, X-Content-Type-Options, X-Frame-Options, Referrer-Policy, Permissions-Policy, COEP, COOP, CORP
- Verify TLS configuration — TLS 1.2+ only, strong cipher suites, HSTS with
includeSubDomainsandpreload - Audit CORS policy — no wildcard (
*) origins in production, credentials mode properly configured, allowed methods/headers restricted - Check rate limiting — authentication endpoints, API endpoints, file upload endpoints, password reset
- Verify error handling — no stack traces or internal details in production error responses, generic error messages for auth failures
- Check logging — security events logged (failed auth, access denied, input validation failures), no sensitive data in logs (passwords, tokens, PII)
- Verify cookie security — Secure flag, HttpOnly flag, SameSite attribute, appropriate domain/path scope
Phase 8: Remediation Plan
Prioritize all findings and create an actionable fix list.
- Aggregate all findings from Phases 2–7
- Deduplicate — merge findings that share the same root cause
- Assign final severity: CRITICAL (actively exploitable, data breach risk), HIGH (exploitable with effort), MEDIUM (defense-in-depth gap), LOW (best practice improvement)
- Sort by severity, then by blast radius (number of affected endpoints/files)
- For each finding, provide:
- One-line description
- Affected file(s) and line(s)
- Specific remediation steps (code-level, not generic advice)
- Estimated effort (trivial/small/medium/large)
- Group into implementation batches: Batch 1 = all CRITICAL, Batch 2 = all HIGH, Batch 3 = MEDIUM + LOW
- Write the plan to
docs/SECURITY_REPORT.mdunder a## Remediation Plansection
Phase 9: Verification
Re-scan after fixes to confirm resolution.
- After Workers implement fixes from the remediation plan, re-run the relevant audit phases
- For each fixed finding, verify:
- The specific vulnerability is no longer present
- The fix did not introduce new vulnerabilities
- Existing tests still pass (no regressions)
- Update
docs/SECURITY_REPORT.md— mark resolved findings as ✅, note verification date - Any finding that persists after a fix attempt escalates one severity level
- Produce a verification summary: total findings, resolved, remaining, new (if any)
Severity Definitions
| Severity | Definition | SLA |
|---|---|---|
| CRITICAL | Actively exploitable, immediate data breach or system compromise risk | Fix before merge |
| HIGH | Exploitable with moderate effort or insider knowledge | Fix within current sprint |
| MEDIUM | Defense-in-depth gap, requires chained vulnerabilities to exploit | Fix within next sprint |
| LOW | Best practice improvement, minimal direct risk | Track in backlog |
Output
All findings are appended to docs/SECURITY_REPORT.md using the project's report template format. The Security Agent owns this file. Each audit session adds a dated section with findings, remediation plan, and verification status.
When not to use it
- →General code quality improvements unrelated to security
Limitations
- →Requires manual remediation of findings
- →Findings must be verified after fixes
How it compares
It provides a systematic, repeatable pipeline for security hardening rather than ad-hoc vulnerability scanning.
Compared to similar skills
security-hardening side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| security-hardening (this skill) | 0 | 4mo | Review | Advanced |
| repo-security-posture | 0 | 1mo | Review | Advanced |
| senior-security | 31 | 7mo | Review | Advanced |
| fix-security-vulnerability | 7 | 2mo | Review | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
repo-security-posture
superagent-ai
Audit a GitHub repository's security posture and hardening gaps across branch protection, CODEOWNERS, GitHub Actions, publish/release integrity, collaborator access, security features, and dependency review. Use when reviewing or hardening a repo, assessing GitHub configuration, checking CI/CD or Ac
senior-security
davila7
Comprehensive security engineering skill for application security, penetration testing, security architecture, and compliance auditing. Includes security assessment tools, threat modeling, crypto implementation, and security automation. Use when designing security architecture, conducting penetration tests, implementing cryptography, or performing security audits.
fix-security-vulnerability
getsentry
Analyze and propose fixes for Dependabot security alerts
codebase-cleanup-deps-audit
sickn33
You are a dependency security expert specializing in vulnerability scanning, license compliance, and supply chain security. Analyze project dependencies for known vulnerabilities, licensing issues, outdated packages, and provide actionable remediation strategies.
dependency-auditor
alirezarezvani
Check dependencies for known vulnerabilities using npm audit, pip-audit, etc. Use when package.json or requirements.txt changes, or before deployments. Alerts on vulnerable dependencies. Triggers on dependency file changes, deployment prep, security mentions.
security-scanning-security-dependencies
sickn33
You are a security expert specializing in dependency vulnerability analysis, SBOM generation, and supply chain security. Scan project dependencies across ecosystems to identify vulnerabilities, assess risks, and recommend remediation.