Skip to content

Instantly share code, notes, and snippets.

@tarunama
Last active September 5, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarunama/af36eb90c734d0efde37192022bece3d to your computer and use it in GitHub Desktop.
Save tarunama/af36eb90c734d0efde37192022bece3d to your computer and use it in GitHub Desktop.
X-Frame-Options

X-Frame-Optionsとは

X-Frame-Options HTTP レスポンスヘッダは、ブラウザがページを frameタグ または iframeタグの内部に表示することを許可するかを示すことができます。

"X-"はどういう意味なのか気になる


なぜ

サイトはこのレスポンスヘッダを、クリックジャッキング攻撃を防止するために使用することができます。

よりセキュアにするため。もはや必須か。

なに

3つの属性を指定できる

DENY

サイト側の意図に関わらず、ページをフレーム内に表示することはできません。

SAMEORIGIN

自身と生成元が同じフレーム内に限り、ページを表示することができます。

ALLOW-FROM uri

指定された生成元に限り、ページをフレーム内に表示できます。

どうやって

ApacheやnginxなどのWebサーバで設定できる。

アプリケーションレベルでの対応は必要なさそう。

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment