api-security

Enforces authentication, authorization, validation, and rate limiting for RESTful APIs.

17|1|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/williamzujkowski/standards --skill api-security
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-security
Source: https://github.com/williamzujkowski/standards/tree/main/skills/security/api-security
Command: npx skills add https://github.com/williamzujkowski/standards --skill api-security

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill provides best practices for securing RESTful and GraphQL APIs, protecting your data and preventing unauthorized access. It automates the implementation of critical security controls like authentication, authorization, rate limiting, and input validation, reducing the risk of API-specific attacks.

Core Features & Use Cases

  • Authentication & Authorization: Guides on implementing robust identity verification and access control for API endpoints.
  • Rate Limiting: Teaches how to protect APIs from brute-force attacks and abuse by controlling request rates.
  • Input Validation: Provides techniques for validating and sanitizing all API inputs to prevent injection attacks.
  • Use Case: Secure a new REST API endpoint, automatically generating an OpenAPI security definition, a Python input validator, and a JavaScript rate limiter middleware.

Quick Start

Generate an OpenAPI security definition for a REST API, including JWT authentication and API key authorization.

Frequently Asked Questions about api-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add authentication and authorization to my REST API?

REST API authentication and authorization are enforced through identity verification and access control mechanisms. Implement JWT-based authorization or API key authentication by generating OpenAPI security definitions, configuring token validation middleware, and defining role-based access policies for endpoints to prevent unauthorized access.

What's the best way to prevent brute-force attacks on my API?

Rate limiting controls request frequency to protect APIs from brute-force and abuse attacks. Apply rate limiter middleware that tracks requests per IP or user, enforces configurable thresholds, and implements backoff strategies to block excessive traffic while allowing legitimate users to access your endpoints.

How do I validate API inputs to prevent injection attacks?

Input validation sanitizes all API requests to block injection attacks. Use schema-based validation, content-type checking, and size limits to enforce strict rules on incoming data. Generate validators in Python or other languages that reject malformed or suspicious payloads before processing.

Can I secure both REST and GraphQL APIs with the same approach?

Both REST and GraphQL APIs require authentication, authorization, input validation, and rate limiting to prevent unauthorized access and data exposure. The core security controls—JWT tokens, API keys, schema validation, and request throttling—apply across both protocols and microservice architectures.

What security controls should I implement for a microservice architecture?

Microservice architectures require API gateway security, server-to-server authentication, input validation, rate limiting, IP allowlists, bot detection, and robust logging. Configure OpenAPI security definitions, enforce short-lived JWT tokens with refresh rotation, and monitor all inter-service and external API traffic for threats.

Do I need to handle cryptographic keys and API key storage differently?

Cryptographic key handling and hashed API key storage are critical for API security. Store API keys using secure hashing, rotate short-lived tokens regularly, implement refresh token flows, and use PKCE-enabled OAuth for OAuth flows to prevent key exposure and unauthorized token reuse.