/api-security-hardening
REST API security hardening with authentication, rate limiting, input validation, security headers. Use for production APIs, security audits, defense-in-depth, or encountering vulnerabilities, injection attacks, CORS issues.
One skill from claude-skills.
shell
$ npx -y skills add secondsky/claude-skills --skill api-security-hardening --agent claude-codeInstalls just this skill. Get the whole plugin for auto-invocation.
How it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/api-security-hardening
Context preview
The summary Claude sees to decide when to auto-load this skill.
REST API security hardening with authentication, rate limiting, input validation, security headers. Use for production APIs, security audits, defense-in-depth, or encountering vulnerabilities, injection attacks, CORS issues.
Stats
Stars194
Forks29
LanguageTypeScript
LicenseMIT
Ships with claude-skills
SKILL.md
api-security-hardening.SKILL.md
--- name: api-security-hardening description: REST API security hardening with authentication, rate limiting, input validation, security headers. Use for production APIs, security audits, defense-in-depth, or encountering vulnerabilities, injection attacks, CORS issues. license: MIT --- # API Security Hardening Protect REST APIs against common vulnerabilities with multiple security layers. ## Security Middleware Stack (Express) ```javascript 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 ```javascript
