2016-01-09
まもなく公開される CSP Level3 の変更点
Content Security Policy Level 3のFirst Public Working Draftがそろそろ公開されそうです。
W3Cのgithubリポジトリよりは公開予定の使用が確認できます。
https://w3c.github.io/webappsec-csp/published/FPWD-2015-01.html
CSP2からの変更点
CSP3では主に以下の点が変更されたようです( https://w3c.github.io/webappsec-csp/published/FPWD-2015-01.html#changes-from-level-2 )。
1. https://fetch.spec.whatwg.org/:title=[FETCHの仕様の用語で一から書きなおされました。これにより、CSPの要求と制限が他の仕様と整合性が取れるようになりました(特にService Workersの仕様)。
2. CSP Level2で非推奨となったframe-srcディレクティブが削除されました
3. sourceを指定する際にセキュアでないスキーマはセキュアなスキーマにもマッチします。http:を指定した場合はhttp: https: と同等です。つまり、http://a.com は http://a.comとhttps://a.comと同等です。同様に、ページのスキーマがhttpでも'self'はhttpsやwssとマッチします。
4. インラインなスクリプトやスタイルから発生した違反レポートは、"inline"をブロクッされたリソースとしてレポートされます。同様に、ブロックされたeval()は、ブロックされたリソースとしてレポートされます。
5. DocumentやWorker自体に影響するディレクティブはhttps://w3c.github.io/webappsec-csp/document/:title=[CSP-DOCUMENTの仕様として移動されました。これには base-uri, form-action, frame-ancestors, plugin-types, sandboxが含まれます。
6. manifest-srcディレクティブが追加されました。
このように指定された場合
Content-Security-Policy: manifest-src https://example.com/
以下の様なlinkタグはブロックされます
<link rel="manifest" href="https://not-example.com/manifest">
7. report-uriディレクティブは非推奨となり、新しいreport-toディクレクティブを使用して下さい。これはhttps://w3c.github.io/reporting/:title=[OOB-REPORTINGの仕様に依存します。
- 20 https://t.co/UOC7dLslfL
- 13 https://www.google.co.jp/
- 7 http://www.facebook.com/Gertruda
- 7 https://t.co/Y714mmz2Ys
- 4 http://b.hatena.ne.jp/
- 2 http://movatter.jp/redirect.pl?guid=ON&url=https://t.co/UOC7dLslfL
- 1 http://b.hatena.ne.jp/Jxck/hotentry
- 1 http://b.hatena.ne.jp/entryhttp://webdesignnaplesfl.com/
- 1 http://kizasi.jp/show.py/rss?feed_of=kwic&kw_expr=Security&label=
- 1 http://longurl.org