CSPヘッダー生成
CSPヘッダーをGUIで簡単構築
プリセット:
CSP セキュリティチェック
✓ セキュリティ上の問題なし
HTTP Header
<meta> Tag
frame-ancestors と report-uri は <meta> タグでは使用できません。HTTP ヘッダーでの設定が必要です。
Nonce ジェネレータ
Use in: <script nonce="[value]"></script>
CSPヘッダー生成で出来る事 About CSP Header Generator
「CSPヘッダー生成(CSP Header Generator)」は、Webサイトのセキュリティを大幅に強化するために不可欠な「Content Security Policy(コンテンツセキュリティポリシー)」のHTTPレスポンスヘッダーを、プログラミングの専門知識がなくてもGUI(グラフィカルユーザーインターフェース)上の操作だけで正確かつ安全に構築できる、Web開発者・サーバー管理者・セキュリティエンジニア必携の無料オンラインツールです。CSPとは、Webブラウザに対して「このページではどのドメインからのスクリプト・スタイルシート・画像・フォント・フレーム等のリソース読み込みを許可するか」を明示的に宣言するセキュリティメカニズムであり、XSS(クロスサイトスクリプティング)攻撃やデータインジェクション攻撃といった深刻なサイバー脅威からWebサイトの訪問者を保護するための最も重要な防御層の一つです。CSPヘッダーの構文は非常に複雑で、default-src、script-src、style-src、img-src、font-src、connect-src、frame-src、media-src、object-src、base-uri、form-action、frame-ancestors、report-uriなど十数種類のディレクティブが存在し、それぞれに'self'、'none'、'unsafe-inline'、'unsafe-eval'、ワイルドカード(*)、特定のURLドメインなどの値を正しく組み合わせて記述する必要があります。
本ツールでは、これらのディレクティブをチェックボックスとテキスト入力だけで直感的に設定でき、結果をHTTPヘッダー形式(Content-Security-Policy: ...)とHTMLの<meta>タグ形式の両方で自動出力します。さらに、よく使われるセキュリティレベルに応じた3段階のプリセット(Strict=最も厳格、Moderate=バランス型、Relaxed=緩め)を用意しており、ワンクリックで推奨設定をロードしてからカスタマイズすることも可能です。セキュリティチェック機能では、設定したCSPの脆弱性を自動検出し、unsafe-inline/unsafe-eval の危険性や object-src の未設定などを警告します。
Report-Only Mode でテスト運用前に影響を確認でき、Nonce ジェネレータで Strict CSP に必要な認証値を生成できます。すべての処理はブラウザ内で完結するため、サーバー設定情報が外部に漏洩するリスクは一切ありません。 The 'CSP Header Generator' is an essential free online tool for web developers, server administrators, and security engineers to accurately and safely build Content Security Policy (CSP) HTTP response headers through a simple graphical user interface, without requiring deep programming expertise. CSP is a critical security mechanism that explicitly declares to the browser which domains are permitted to load scripts, stylesheets, images, fonts, frames, and other resources on a page, serving as one of the most important defense layers against XSS (Cross-Site Scripting) attacks and data injection attacks. CSP header syntax is notoriously complex, involving over a dozen directives such as default-src, script-src, style-src, img-src, font-src, connect-src, frame-src, media-src, object-src, base-uri, form-action, frame-ancestors, and report-uri, each requiring correct combinations of values like 'self', 'none', 'unsafe-inline', 'unsafe-eval', wildcards (*), and specific URL domains.
This tool lets you configure all directives intuitively using checkboxes and text inputs, automatically outputting results in both HTTP header format (Content-Security-Policy: ...) and HTML meta tag format. Additionally, three presets (Strict, Moderate, Relaxed) are available for common security levels, allowing you to load recommended settings with one click and customize from there. Built-in CSP Security Validator automatically detects policy vulnerabilities, warns about dangerous unsafe-inline/unsafe-eval directives, and checks for missing critical settings.
Report-Only Mode lets you test the policy before enforcing it, and the Nonce Generator creates authentication values needed for Strict CSP. All processing runs entirely in your browser, ensuring zero risk of server configuration data leaking externally.
CSPヘッダー生成の使い方 How to use CSP Header Generator
- プリセット(Strict/Moderate/Relaxed)を選択するか、各ディレクティブを個別に設定します。各ディレクティブのラベルにマウスを近づけるとツールチップで説明が表示されます。
- ディレクティブごとに'self'、'none'、'unsafe-inline'などのキーワードをチェックし、必要に応じてカスタムURLを追加します。
- 下部の「CSPセキュリティチェック」パネルで自動検証を確認し、警告やエラーがあれば修正します。
- 本番適用前にテストする場合は「Report-Only Mode」をチェックして、生成されたヘッダーをサーバーに設定します。
- 生成されたCSPヘッダー(HTTP形式またはmetaタグ形式)をコピーボタンでクリップボードにコピーし、サーバー設定やHTMLファイルに貼り付けます。
- Select a preset (Strict, Moderate, or Relaxed) or configure each directive individually. Hover over directive labels to see tooltips with descriptions.
- For each directive, check keywords like 'self', 'none', 'unsafe-inline', and add custom URLs as needed.
- Review the 'CSP Security Check' panel below to see automatic validation results and fix any warnings or errors.
- Before deploying to production, check 'Report-Only Mode' to test the policy and set the header on your server to collect violation reports.
- Copy the generated CSP header (HTTP format or meta tag format) using the copy button and paste it into your server configuration or HTML file.
CSPヘッダー生成を使うメリット Benefits of CSP Header Generator
- 【複雑なCSP構文を直感的なGUIで正確に構築】十数種類のディレクティブと複数のソース値を組み合わせる必要があるCSPヘッダーの記述を、チェックボックスとテキスト入力だけで誰でも間違いなく作成できます。手書きによるタイプミスや構文エラーを完全に排除し、確実に動作するポリシーを生成します。
- 【セキュリティチェック機能で脆弱性を自動検出】生成したポリシーに対して、unsafe-eval/unsafe-inline の危険性、object-src の未設定、ワイルドカード (*) の過度な利用など、セキュリティベストプラクティスに基づく検証を自動実行します。Google CSP Evaluator の考え方を参考に、Strict CSP への移行を促進します。
- 【3段階のプリセットでセキュリティレベルを即座に設定】Strict(最も厳格:'self'のみ許可)、Moderate(バランス型:インラインスタイル許可)、Relaxed(緩め:外部リソース広く許可)の3つのプリセットをワンクリックで適用でき、プロジェクトのセキュリティ要件に合わせた最適な出発点から設定をカスタマイズできます。
- 【HTTP形式とmetaタグ形式の両方を同時出力】Webサーバー(Nginx/Apache)の設定ファイルに記述するHTTPヘッダー形式と、HTMLファイルに直接埋め込むmetaタグ形式の両方を自動生成するため、どのような運用環境でもすぐに導入できます。
- 【Report-Only Mode で本番前テスト】強制適用前に Report-Only ヘッダーを使用してポリシーをテストでき、report-uri で実際の違反ログを収集できます。アプリケーション破壊のリスクを最小化したまま段階的に導入できます。
- 【Nonce ジェネレータで Strict CSP を実装】inline script / inline style に付与する nonce 値を、ワンクリックで生成・コピーできます。安全な script-src/style-src の設定へ移行を支援します。
- [Build Complex CSP Syntax Accurately with an Intuitive GUI] Create CSP headers that require combining dozens of directives and multiple source values using simple checkboxes and text inputs. Completely eliminates typos and syntax errors from manual writing, generating policies that are guaranteed to work correctly.
- [Automatic Vulnerability Detection with Security Checker] The generated policy is automatically validated against security best practices, detecting dangerous unsafe-eval/unsafe-inline directives, missing object-src settings, and excessive wildcard (*) usage. Inspired by Google CSP Evaluator, it promotes migration to Strict CSP.
- [Instantly Set Security Levels with 3-Tier Presets] Apply Strict (most restrictive: 'self' only), Moderate (balanced: allows inline styles), or Relaxed (permissive: broadly allows external resources) presets with one click, giving you the optimal starting point to customize for your project's security requirements.
- [Simultaneous Output in Both HTTP and Meta Tag Formats] Automatically generates both HTTP header format for web server config files (Nginx/Apache) and HTML meta tag format for direct embedding, ensuring immediate deployment in any environment. Fully local processing means zero risk of server configuration data leakage.
- [Test Before Enforcement with Report-Only Mode] Use Report-Only headers to test your policy before enforcement, and collect actual violation logs via report-uri. Deploy incrementally while minimizing the risk of breaking your application.
- [Nonce Generator for Strict CSP] One-click generation and copy of nonce values for inline scripts and styles. Easily migrate to secure script-src/style-src configurations without unsafe-inline.
テキスト のすべてのツール (20件) All Text Tools Tools (20)
該当するツールが見つかりませんでした No matching tools found