静的サイト向けCSPポリシージェネレーターとは
静的サイト向けCSPポリシージェネレーターは、CDN、アナリティクス、フォント、埋め込みオプション付きの静的サイト向けContent-Security-Policyヘッダーを生成します。 出力は公開サイトに使う前に確認しやすい形で表示されます。
Quick answer
A Content Security Policy blocks cross-site scripting and data injection attacks by restricting which resources the browser can load. Start with a restrictive policy and widen only when needed.
Limitations
- CSP does not protect against server-side vulnerabilities or compromised third-party libraries already included in the policy.
- Inline event handlers and javascript: URLs are blocked unless 'unsafe-inline' or a hash/nonce is set.
- GitHub Pages does not support custom HTTP headers; use a meta tag-based CSP instead, which has limited directive support compared to the HTTP header.
使い方
- 必要な値を入力します。
- 結果パネルの出力を確認します。
- ページに合う部分だけコピーします。
- 公開前にブラウザとホスティング環境で確認します。
主な用途
- 公開前の繰り返し作業を短くする。
- マークアップ、CSS、チェックリストを準備する。
- 静的サイトで見落としやすい小さなミスを減らす。