diff options
Diffstat (limited to 'files/ja/web/http/headers/content-security-policy/sandbox/index.html')
-rw-r--r-- | files/ja/web/http/headers/content-security-policy/sandbox/index.html | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/files/ja/web/http/headers/content-security-policy/sandbox/index.html b/files/ja/web/http/headers/content-security-policy/sandbox/index.html new file mode 100644 index 0000000000..dbb381f9d4 --- /dev/null +++ b/files/ja/web/http/headers/content-security-policy/sandbox/index.html @@ -0,0 +1,113 @@ +--- +title: 'CSP: sandbox' +slug: Web/HTTP/Headers/Content-Security-Policy/sandbox +tags: + - CSP + - Content-Security-Policy + - Directive + - HTTP + - Sandbox + - Security + - サンドボックス + - セキュリティ + - ディレクティブ +translation_of: Web/HTTP/Headers/Content-Security-Policy/sandbox +--- +<div>{{HTTPSidebar}}</div> + +<p>HTTP の {{HTTPHeader("Content-Security-Policy")}} (CSP) の <code><strong>sandbox</strong></code> ディレクティブは、 {{HTMLElement("iframe")}} の {{htmlattrxref("sandbox", "iframe")}} 属性と同様に、要求されたリソースに対してサンドボックスを有効にします。これは、ポップアップの防止、プラグインやスクリプトの実行の防止、同一オリジンポリシーの強制などを含むページ操作の制限を適用します。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row">CSP バージョン</th> + <td>1.1 / 2</td> + </tr> + <tr> + <th scope="row">ディレクティブ種別</th> + <td>{{Glossary("Document directive", "文書ディレクティブ")}}</td> + </tr> + <tr> + <th colspan="2" scope="row">このディレクティブは {{HTMLElement("meta")}} 要素や {{HTTPHeader("Content-Security-policy-Report-Only")}} ヘッダーフィールドでは対応していません。</th> + </tr> + </tbody> +</table> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox">Content-Security-Policy: sandbox; +Content-Security-Policy: sandbox <value>; +</pre> + +<p><code><value></code> は省略可能で、以下の値の内の一つです。</p> + +<dl> + <dt><code>allow-downloads-without-user-activation</code> {{experimental_inline}}</dt> + <dd>ユーザーによる指示のないダウンロードを許可します。</dd> +</dl> + +<dl> + <dt><code>allow-forms</code></dt> + <dd>埋め込み閲覧コンテキストが、フォームを送信することを許可します。このキーワードが使用されなかった場合、この操作は許可されません。</dd> + <dt><code>allow-modals</code></dt> + <dd>埋め込み閲覧コンテキストが、モーダルウィンドウを開くことを許可します。</dd> + <dt><code>allow-orientation-lock</code></dt> + <dd>埋め込み閲覧コンテキストが、画面の向きをロックする機能を無効化することを許可します。</dd> + <dt><code>allow-pointer-lock</code></dt> + <dd>埋め込み閲覧コンテキストが、 <a href="/ja/docs/WebAPI/Pointer_Lock">Pointer Lock API</a> を使用することを許可します。</dd> + <dt><code>allow-popups</code></dt> + <dd>ポップアップ (<code>window.open</code>, <code>target="_blank"</code>, <code>showModalDialog</code> などによるもの) を許可します。このキーワードが使用されなかった場合、この機能は暗黙に失敗します。</dd> + <dt><code>allow-popups-to-escape-sandbox</code></dt> + <dd>サンドボックス化された文書が、サンドボックスフラグを強制することなく新しいウィンドウを開くことを許可します。これによって、例えば、サードパーティの広告が安全にサンドボックス化される一方、ランディングページには同じ制限が強制されなくなります。</dd> + <dt><code>allow-presentation</code></dt> + <dd>埋め込みを行った者が、 iframe がプレゼンテーションセッションを開始できるかどうかを制御できるようになります。</dd> + <dt><code>allow-same-origin</code></dt> + <dd>コンテンツが通常のオリジンからのものとして扱われることを許可します。このキーワードが使用されなかった場合は、埋め込まれたコンテンツは独自のオリジンからのものとして扱われます。</dd> + <dt><code>allow-scripts</code></dt> + <dd>埋め込み閲覧コンテキストがスクリプトを実行することを許可します (ポップアップウィンドウの生成を除く)。このキーワードが使用されなかった場合は、この操作は許可されません。</dd> + <dt><code>allow-storage-access-by-user-activation</code> {{experimental_inline}}</dt> + <dd>リソースが親のストレージ機能に <a href="/ja/docs/Web/API/Storage_Access_API">Storage Access API</a> でアクセスを要求できるようにします。</dd> + <dt><code>allow-top-navigation</code></dt> + <dd>埋め込み閲覧コンテキストが、最上位の閲覧コンテキストを移動させる (読み込ませる) ことを許可します。このキーワードが使用されなかった場合、この操作は許可されません。</dd> + <dt><code>allow-top-navigation-by-user-activation</code></dt> + <dd>ユーザーの指示で開始された場合に限り、リソースが最上位の閲覧コンテキストを移動させます。</dd> +</dl> + +<h2 id="Examples" name="Examples">例</h2> + +<pre class="brush: bash">Content-Security-Policy: sandbox allow-scripts;</pre> + +<h2 id="Specifications" name="Specifications">仕様書</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様書</th> + <th scope="col">状態</th> + <th scope="col">備考</th> + </tr> + <tr> + <td>{{specName("CSP 3.0", "#directive-sandbox", "sandbox")}}</td> + <td>{{Spec2('CSP 3.0')}}</td> + <td>変更なし</td> + </tr> + <tr> + <td>{{specName("CSP 1.1", "#directive-sandbox", "sandbox")}}</td> + <td>{{Spec2('CSP 1.1')}}</td> + <td>初回定義</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + +<p class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</p> + +<p>{{Compat("http.headers.csp.Content-Security-Policy.sandbox")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>{{HTTPHeader("Content-Security-Policy")}}</li> + <li>{{HTMLElement("iframe")}} 要素の {{htmlattrxref("sandbox", "iframe")}} 属性</li> +</ul> |