Http security headers

From RedHatProductSecurity/prodsec-skills · View interactive version

Http security headers is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Verify and configure HTTP response security headers. Use when reviewing web server configuration, reverse proxy setup, or application middleware that sets response headers.

How to use this skill

Skill file

HTTP Security Headers

Strict-Transport-Security (HSTS)

Forces HTTPS connections for a specified period, preventing protocol downgrade and MITM attacks.

Strict-Transport-Security: max-age=31536000; includeSubDomains; preload

X-Frame-Options

Controls whether a page can be rendered in a frame or iframe, mitigating clickjacking.

X-Frame-Options: DENY

X-Content-Type-Options

Prevents MIME sniffing, forcing the browser to use the declared Content-Type.

X-Content-Type-Options: nosniff

X-XSS-Protection

Instructs older browsers to activate built-in XSS filtering.

X-XSS-Protection: 1; mode=block

Content-Security-Policy (CSP)

Defines trusted sources for scripts, styles, images, and other resources. The most powerful header for preventing XSS and code injection.

Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; object-src 'none'; frame-ancestors 'none'

Referrer-Policy

Controls how much referrer information is sent with requests, protecting user privacy.

Referrer-Policy: strict-origin-when-cross-origin

Cache-Control

Controls caching behavior for responses. Misconfigured caching of sensitive data is a common vulnerability.

Sensitive responses (authentication, personal data, tokens):

Cache-Control: no-store, no-cache, must-revalidate, max-age=0

Static assets (images, fonts, versioned bundles):

Cache-Control: public, max-age=31536000, immutable

Implementation Checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.