IISでContent Security Policyを設定するにはHTTP応答ヘッダーに追加する

ITで知っておくべき知識
スポンサーリンク

IISでContent Security Policyを設定する方法についてまとめました。

スポンサーリンク

Content Security Policy (コンテンツセキュリティポリシー)とは

CSP (Content Security Policy、コンテンツセキュリティポリシー) とは、クロスサイトスクリプティング(Cross Site Scripting:XSS)やデータインジェクション攻撃などのような、特定の種類の攻撃を検知し、影響を軽減するために追加できるセキュリティレイヤーです。

 

IISでContent Security Policyを設定するHTTP応答ヘッダー

IISでContent Security Policyを設定するには、HTTP応答ヘッダーに追加します。

 

IISマネージャーを起動します。

サイトのIISの項目から「HTTP応答ヘッダー」を選びます。

 

 

HTTP応答ヘッダーを追加します。

名前:Content-Security-Policy
値:default-src 'self';

 

Refused to load the script because it violates the following Content Security Policy directive

Content Security Policyが効いている時に、外部のjsとかAjaxとかを実行しようとすると

Refused to load the script 'xxxxx'
because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval' 'unsafe-inline'

となります。

 

 

ITで知っておくべき知識
スポンサーリンク
スポンサーリンク
うらしたをフォローする
スポンサーリンク
urashita.com 浦下.com (ウラシタドットコム)

コメント

  1. […] ・https://urashita.com/archives/34077 […]

タイトルとURLをコピーしました