Skip to content
secondsky avatar

Api Security Hardening

Express middleware stack for REST API hardening with helmet, rate limiting, input validation, and security headers.

CCM score
52 of 100
skills.sh installs
522
GitHub stars
257
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers Express middleware for security headers, rate limiting, input validation, and injection prevention in production APIs
  • Includes rate limits of 100 requests per 15 minutes on /api/ and 5 on /api/auth/, plus a helmet stack and an 8-character password rule
  • Provides a 9-item security checklist covering HTTPS, authentication, CORS, error handling, audit logging, and dependency updates
  • Designed for Express-based production APIs, with a reference covering FastAPI, Pydantic, and Nginx configuration

Install

$ npx -y skills add secondsky/claude-skills --skill api-security-hardening -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

API Security Hardening

Protect REST APIs against common vulnerabilities with multiple security layers.

Security Middleware Stack (Express)

const helmet = require('helmet');
const rateLimit = require('express-rate-limit');
const mongoSanitize = require('express-mongo-sanitize');

app.use(helmet());
app.use(mongoSanitize());
// For input sanitization, see the `xss-prevention` skill — do NOT use the
// deprecated `xss-clean` package (unmaintained since 2018; its own README
// recommends migrating off it).

app.use('/api/', rateLimit({
  windowMs: 15 * 60 * 1000,
  max: 100
}));

app.use('/api/auth/', rateLimit({
  windowMs: 15 * 60 * 1000,
  max: 5
}));

Input Validation

const { body, validationResult } = require('express-validator');
const escapeHtml = require('escape-html');

Details

Repository
github.com/secondsky/claude-skills
Categories
Security, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the api-security-hardening skill do?

It hardens REST APIs against common vulnerabilities using layered defenses: authentication on protected routes, rate limiting, input validation, security headers, and CORS restriction. The SKILL.md includes Express middleware examples using helmet, express-rate-limit and express-validator, plus Python FastAPI and Nginx configuration in a reference file.

How do I install the api-security-hardening skill?

Run npx -y skills add secondsky/claude-skills --skill api-security-hardening -y in your project. Once installed, the agent can apply security middleware, input validation and header configuration to your API code.

Which skills lead the Security category, and where does api-security-hardening stand?

Api-security-hardening sits in the Security category alongside azure-compliance, entra-agent-id, firebase-security-rules-auditor, security-audit and cloudflare-one. It focuses on REST API hardening, covering rate limiting, input validation, security headers and CORS for production APIs.

Is api-security-hardening suited to Express or Python projects?

The main examples are written for Express in JavaScript, with rate limiting, mongo sanitization and validation middleware. Python FastAPI middleware, Pydantic password rules and Nginx SSL and header setup are covered in a separate reference file.

More from secondsky/claude-skills

All 116

Similar to Api Security Hardening

More Security