Command Palette

Search for a command to run...

Back to skills
skill № 82559

security-api-security

Use this skill when asked about API security, OWASP API Top 10, rate limiting, API authentication, JWT security, OAuth2, API key management, API gateway, WAF…

FreeNo executable scripts
j4flmaoby j4flmao★ 47 GitHub stars

Install security-api-security in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

Security API Security

Purpose

Design comprehensive API security controls covering OWASP API Top 10 threat modeling, authentication (JWT, OAuth2, API keys), rate limiting (token bucket, sliding window, per-user/per-endpoint), input validation (JSON schema, allowlist), WAF rules (ModSecurity CRS), request signing, and audit logging.

Agent Protocol

Trigger

Exact user phrases: "API security", "OWASP API Top 10", "rate limiting", "API auth", "JWT security", "OAuth2", "API gateway", "WAF", "API abuse", "API threat modeling", "API protection", "API authentication", "API authorization", "API keys", "OAuth2 API", "API gateway config", "request signing", "API audit", "GraphQL security".

Input Context

Before activating, verify:

  • API style (REST, GraphQL, gRPC) and framework
  • Authentication mechanism (JWT, OAuth2, session, API keys)
  • API gateway (Kong, APIGW, Envoy, Nginx, AWS Gateway)
  • Deployment environment and traffic patterns
  • Compliance requirements (GDPR, PCI, SOC 2)
  • Number of API consumers and tiers

Output Artifact

API security checklist with threat model, protection configuration, monitoring setup.

Response Format

# Threat model table
# Rate limit policy
# WAF rules
# Auth middleware config
# Audit log schema

No preamble. No postamble. No explanations. No filler/hedging/transitions. Compress output — why use many token when few do trick.

Completion Criteria

  • Threat model completed against OWASP API Top 10
  • Authentication mechanism selected and configured
  • Authorization model with least privilege defined
  • Rate limiting policy with tiered quotas
  • Input validation rules for all endpoints
  • WAF rules for API-specific attacks
  • Audit logging and abuse monitoring configured
  • Request signing for critical operations

Max Response Length

300 lines of configuration and policy.

Workflow

Step 1: Threat Modeling (OWASP API Top 10)

Map each resource against OWASP API Top 10:

API1: Broken object-level authorization. Check user owns resource via JWT sub claim. Use UUIDs, not sequential IDs.

API2: Broken authentication. Weak JWT, no MFA, no login rate limit. Enforce strong passwords, short-lived tokens.

API3: Excessive data exposure. Return only needed fields per endpoint. Never return password hashes or internal IDs.

API4: Rate limiting. No throttling leads to DoS. Paginate lists, limit body size, rate limit.

API5: Broken function-level auth. Deny by default, test all roles against all endpoints.

API6: Mass assignment. Use DTOs, whitelist updatable fields only.

API7: Security misconfiguration. CORS misconfigured, debug endpoints exposed. Audit configs, disable debug in production.

API8: Injection. SQL, NoSQL, command injection. Parameterized queries, input validation.

API9: Improper asset management. Old API versions running unpatched. Maintain OpenAPI spec inventory.

API10: Unsafe consumption. API consuming compromised external service. Validate external responses, timeout calls.

Step 2: Authentication

JWT: RS256 or ES256 asymmetric signing. Access token: 15 min expiry. Refresh token: 7 days with rotation. Claims: sub, iss, aud, exp, iat, jti, scope. Validate signature, expiry, issuer, audience on every request.

OAuth2 flows: Authorization Code + PKCE for SPAs. Client Credentials for M2M. Device grant for CLI tools. Rotate refresh tokens on each use.

API keys: Cryptographically random, prefixed identifier. Hashed at rest with bcrypt. Rate-limited per key with tiered quotas. Revocable with immediate invalidation. Scoped to specific resources and actions.

Ban: basic auth, session cookies, JWT with alg: none.

Step 3: Authorization

RBAC: roles assigned to users, permissions assigned to roles. Deny by default, whitelist allowed actions.

ABAC: attribute-based fine-grained access. Check resource owner, region, tier, time.

API gateway: validate JWT, extract scopes. Pass claims upstream via request headers.

Service layer: check resource ownership. userId == resource.ownerId. Validate actions against role matrix.

Policy-as-code: OPA for cross-cutting authorization. Organization-level and multi-resource policies.

Test: every role against every endpoint in CI. Automated authorization fuzzing. Regression test for each access control change.

Step 4: Rate Limiting

Algorithms: Sliding window log: most accurate, most memory. Sliding window counter: accurate, efficient (default). Token bucket: allows bursts, easy to understand. Fixed window: simple but edge case bursts.

Per client: by API key, IP, or JWT sub claim. Tiers: free (10/min), basic (100/min), premium (1000/min). Burst: 2x rate with 503 on sustained overage.

Per endpoint: login (5/min), search (30/min), export (2/min). Global: 10000 req/min per gateway instance.

Response: 429 Too Many Requests. Headers: Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining.

Distributed: Redis-based counter with consistent hashing.

Step 5: Input Validati

Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • references/api-auth-patterns.md
  • references/api-protection.md
  • references/api-security-advanced.md
  • references/api-security-fundamentals.md
  • references/api-security-testing.md
  • references/api-threats.md
  • references/graphql-security.md
  • references/oauth2-deep-dive.md

FAQ

What does the security-api-security skill do?

Use this skill when asked about API security, OWASP API Top 10, rate limiting, API authentication, JWT security, OAuth2, API key management, API gateway, WAF, API abuse, request signing, or API threat modeling. This skill enforces: OWASP API Top 10 threat modeling, authentication/authorization patterns (JWT, OAuth2, API keys), rate limiting with tiered policies (token bucket, sliding window, per-user/per-endpoint), input validation and WAF rules, request signing, and audit logging. Do NOT use for: web application security (XSS, CSRF), network security (TLS, mTLS), or container security.

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

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the security-api-security skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare security-api-security with