Skip to content
Back to skills

Security Hardening

ASecurity

Harden an application or service against common attack vectors. Use when asked to improve security posture, secure an API, harden a server, or prepare for a security review.

  • 498 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added June 5, 2026
securitygobashsqlgitapidatabasesecurity

Works with

  • api

Security analysis

A100/100

Scanned June 5, 2026

npx -y skills add agulli/atlas-agents --skill security-hardening --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Security Hardening?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Security Hardening
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/agulli-security-hardening/badge)](https://www.skillsdirectory.com/skills/agulli-security-hardening)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: security-hardening
description: Harden an application or service against common attack vectors. Use when asked to improve security posture, secure an API, harden a server, or prepare for a security review.
license: MIT
---

## Overview

Security hardening is not about chasing perfect — it's about raising the cost of attack above the attacker's budget. Work systematically through the layers.

## Process

### Layer 1: Authentication and Authorization

1. Verify all endpoints require authentication. Check for unprotected routes using:
   ```bash
   grep -rn "route\|@app\.\|router\." src/ | grep -v "login\|health\|docs"
   ```
2. Check that authorization is enforced at the data layer, not just the route layer. A user who can reach `/orders` should only see *their* orders.
3. Confirm tokens expire. JWTs must have `exp` claims. Sessions must have server-side expiry.

### Layer 2: Input Validation

4. Every user-supplied value that touches a database must use parameterized queries. Grep for f-string SQL:
   ```bash
   grep -rn "f\"SELECT\|f'SELECT\|format.*SELECT" src/
   ```
5. Every file path from user input must be validated against an allowlist or a sandboxed directory. Check for `os.path.join(base, user_input)` without `os.path.abspath` + `startswith` guard.

### Layer 3: Secrets and Configuration

6. Scan for hardcoded secrets:
   ```bash
   grep -rn "password\s*=\s*[\"'][^\"']\|api_key\s*=\s*[\"'][^\"']" src/
   ```
7. Confirm all secrets come from environment variables or a secrets manager, not from config files committed to version control.
8. Check `.gitignore` includes `.env`, `*.key`, `*.pem`.

### Layer 4: Dependencies and Infrastructure

9. Run the `dependency-audit` skill to check for vulnerable packages.
10. Check HTTP security headers are set (for web services):
    - `Content-Security-Policy`
    - `X-Frame-Options: DENY`
    - `Strict-Transport-Security`
    - `X-Content-Type-Options: nosniff`

### Layer 5: Output

11. Write findings as a prioritized list: Critical → High → Medium → Low. For each finding: what it is, where it is (file:line), how to fix it.

## Rationalizations

| Excuse | Rebuttal |
|--------|----------|
| "This is an internal service, it doesn't need hardening" | Internal services are the primary target of lateral movement attacks after initial breach. |
| "We'll harden it before the public launch" | Security debt compounds. Fix it before it goes anywhere. |
| "The framework handles security" | Frameworks handle some things. You must handle the application-level concerns. |

## Verification

- [ ] All four layers were checked (not just the ones that seemed relevant)
- [ ] No hardcoded secrets found in source or git history
- [ ] Every critical and high finding has a specific remediation
- [ ] A finding was produced for each layer — even if it's "no issues found"

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.