xutil.dev
Login

HTTP Security Headers Cheatsheet

Quick reference for HTTP security headers covering CSP, transport security, framing protection, content-type, referrer policy, permissions, CORS, and deprecated headers

Related Categories:SecurityWeb

49 commands

default-src

Set default policy for all resource types

script-src

Restrict JavaScript loading sources

style-src

Restrict CSS stylesheet loading sources

img-src

Restrict image loading sources

connect-src

Restrict XHR/Fetch/WebSocket connection targets

font-src

Restrict web font loading sources

frame-src

Restrict sources that can be embedded in iframes

object-src

Restrict plugin (Flash, etc.) sources

base-uri

Restrict URLs that can be used in base element

form-action

Restrict form submission target URLs

report-uri / report-to

Set CSP violation report destination

CSP nonce

Allow inline scripts with nonce-based approach

CSP hash

Allow inline scripts with hash-based approach

strict-dynamic

Allow scripts loaded by trusted scripts

CSP Report-Only

Report CSP violations without blocking

Strict-Transport-Security

Force HTTPS connection in browsers

HSTS preload

Register domain in HSTS preload list

HSTS includeSubDomains

Apply HSTS to subdomains as well

HTTPSリダイレクト (Nginx)

Redirect HTTP to HTTPS in Nginx

HTTPSリダイレクト (Apache)

Redirect HTTP to HTTPS in Apache

X-Frame-Options: DENY

Completely prevent page embedding in iframes

X-Frame-Options: SAMEORIGIN

Allow iframe embedding only from same origin

CSP frame-ancestors

Successor to X-Frame-Options. More flexible frame control

Nginx X-Frame-Options

Set X-Frame-Options header in Nginx

X-Content-Type-Options

Prevent MIME type sniffing

正しいContent-Type設定

Set accurate Content-Type on responses

X-Download-Options

Prevent IE from auto-executing downloads

no-referrer

Never send referrer information

same-origin

Send referrer only for same-origin requests

strict-origin-when-cross-origin

Recommended. Send only origin for cross-origin requests

no-referrer-when-downgrade

No referrer when downgrading from HTTPS to HTTP

origin

Send only the origin as referrer

camera

Control access to camera

microphone

Control access to microphone

geolocation

Control access to geolocation

payment

Control usage of Payment Request API

fullscreen

Control usage of Fullscreen API

autoplay

Control media autoplay

interest-cohort

Disable FLoC (ad tracking)

Access-Control-Allow-Origin

Specify allowed origins

Access-Control-Allow-Methods

Specify allowed HTTP methods

Access-Control-Allow-Headers

Specify allowed request headers

Access-Control-Allow-Credentials

Allow requests with credentials

Access-Control-Max-Age

Specify preflight response cache duration

Access-Control-Expose-Headers

Specify response headers exposed to client

X-XSS-Protection (非推奨)

Control browser XSS filter. Replaced by CSP

Public-Key-Pins (非推奨)

Certificate pinning. Replaced by Certificate Transparency

Expect-CT (非推奨)

Require Certificate Transparency. Browsers handle by default

X-Permitted-Cross-Domain-Policies (非推奨)

Control Flash/Acrobat cross-domain policy. Unnecessary after plugin deprecation