consolelog.tools logo

API Security Checklist

Comprehensive security checklist for API development

Security LevelPOOR
0 of 31 completedScore: 0/100

Authentication

Verify user identity and manage credentials securely

critical

• Use OAuth 2.0 for third-party integrations • Implement JWT with short expiration times • Use refresh tokens for long-lived sessions

• Use TOTP (Time-based One-Time Password) • Support SMS or email verification • Implement WebAuthn for hardware keys

• Use Authorization header for tokens • Avoid query parameters for passwords • Log URLs without sensitive data

• Minimum 12 characters • Use bcrypt, scrypt, or Argon2 for hashing • Check against breached password databases

• Set appropriate session timeouts • Implement token revocation endpoint • Clear sessions on logout

Authorization

Control access to resources and operations

critical

• Use roles like admin, user, guest • Check permissions on every request • Implement least privilege principle

• Verify user permissions in middleware • Check resource ownership • Validate against session data

• Check if user owns the resource • Use UUIDs instead of sequential IDs • Validate resource access permissions

• Different limits for authenticated users • Stricter limits for sensitive endpoints • Monitor and adjust limits based on usage

Input Validation & Sanitization

Validate and sanitize all input data

critical

• Use Joi, Zod, or Yup for validation • Validate data types, formats, ranges • Reject invalid requests early

• Use parameterized queries • Escape special characters • Use ORM frameworks

• Reject unexpected content types • Validate JSON structure • Limit file upload types

• Set max body size limits • Limit file upload sizes • Implement request timeouts

Encryption & Data Protection

Protect data in transit and at rest

critical

• Use TLS 1.2 or higher • Implement HSTS headers • Use valid SSL certificates

• Encrypt PII and passwords • Use AES-256 for encryption • Manage encryption keys securely

• No HTTP for sensitive data • Disable SSLv3, TLS 1.0, TLS 1.1 • Use perfect forward secrecy

API Design & Configuration

Design APIs with security in mind

high

• GET for reading (idempotent) • POST for creating • PUT/PATCH for updating • DELETE for removing

• Use generic error messages • Log detailed errors server-side • Don't expose stack traces

• Use URL versioning (/v1/, /v2/) • Or header-based versioning • Deprecate old versions properly

• Whitelist specific origins • Don't use wildcard (*) in production • Validate Origin header

• Content-Security-Policy • X-Content-Type-Options: nosniff • X-Frame-Options: DENY

Logging & Monitoring

Track and monitor API usage and security events

high

• Failed login attempts • Authorization failures • Rate limit violations

• Mask passwords in logs • Redact credit card numbers • Hash or omit tokens

• Alert on unusual patterns • Track error rates • Monitor performance metrics

• Log data modifications • Track admin actions • Record access to sensitive data

Dependencies & Infrastructure

Secure your dependencies and infrastructure

medium

• Use npm audit or Snyk • Enable Dependabot • Review security advisories

• Use .env files (not in git) • Use secret management tools • Rotate secrets regularly

• SAST (Static Analysis) • DAST (Dynamic Analysis) • Container scanning

Testing & Documentation

Test security and document properly

medium

• Manual penetration testing • Automated security scans • Bug bounty programs

• Authentication flow • Authorization rules • Rate limiting policies

• Invalid input handling • Large payload handling • Concurrent requests

Recommendations

  • CRITICAL: Complete Authentication checklist (5 items remaining)
  • CRITICAL: Complete Authorization checklist (4 items remaining)
  • CRITICAL: Complete Input Validation & Sanitization checklist (4 items remaining)
  • CRITICAL: Complete Encryption & Data Protection checklist (3 items remaining)
  • Perform regular security audits
  • Stay updated on OWASP API Security Top 10
  • Implement automated security testing in CI/CD

Was this tool helpful?

Share Your Experience

Help others discover this tool!

Frequently Asked Questions - API Security Checklist