Security Headers

Implement security headers (CSP, HSTS, X-Frame-Options, etc.) to protect against common web vulnerabilities.

security
Official
Featured
by RepoBird
Updated 10/18/2025
49 executions
Template Instructions
These instructions will be passed to the AI agent when executing this template

Add security headers to protect the application:

  1. Add Content Security Policy (CSP)
  2. Implement HTTP Strict Transport Security (HSTS)
  3. Add X-Frame-Options to prevent clickjacking
  4. Add X-Content-Type-Options
  5. Add Referrer-Policy
  6. Configure CORS securely

Create middleware or configuration based on framework to set these headers on all responses.

Success Criteria

  • All recommended security headers implemented
  • CSP policy configured without breaking functionality
  • HSTS with appropriate max-age set
  • Headers verified on all routes
  • CORS configured securely with proper origins

Completion Checklist

  • Test headers with security scanning tools
  • Create tests verifying header presence
  • Document header configuration
  • Verify headers work in production environment
  • Test for header conflicts or issues
Tags
security
headers
CSP
HSTS
Supported Languages
Any Language