セキュリティヘッダー早見表
主要 HTTP セキュリティヘッダーの説明とサンプルの一括コピー。
よく使うセキュリティ向けレスポンスヘッダーの例です(Nginx / CDN / フレームワークのいずれかで設定)。
HSTS
HTTPS を強制(max-age 1 年)
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options
MIME スニッフィングを無効化
X-Content-Type-Options: nosniff
X-Frame-Options
埋め込みを禁止(DENY と同等)
X-Frame-Options: DENY
Referrer-Policy
Referer を厳しめに
Referrer-Policy: strict-origin-when-cross-origin
Permissions-Policy(例)
一部の機密 API を無効化
Permissions-Policy: camera=(), microphone=(), geolocation=()