github / github/secure_headers

Set default `frame-ancestors` on default Content-Security-Policy

未關閉
#532 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Ruby
星號
3.2k
分支
253
平均合併
19 小時 11 分鐘
30 天內合併 PR
1

描述

We should consider setting a default `frame-ancestors` directive for the Content Security Policy. The [`frame-ancestors`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors) directive is the new iteration of the X-Frame-Options header, and as such setting a directive in both spots might be prudent.

https://github.com/github/secure_headers/blob/b134eef07d3741b4bd0769b863961b41af5df57d/lib/secure_headers/headers/content_security_policy_config.rb#L97

Since our default XFO policy is `sameorigin`, if we decide to take upon this task, we should set the default `frame-ancestors` value to be `self`.

Some counterpoints: setting both the `X-Frame-Options` and the `frame-ancestors` directive will cause the XFO header to be overriden by the frame-ancestors directive. This means that if a user is trying to change some framing functionality, and only changes the XFO header, they might be confused as to why the functionality didn't actually change.

貢獻指南

開啟貢獻指南

研究方向

從連結的預設政策附近的 lib/secure_headers/headers/content_security_policy_config.rb 開始。檢查現有的 sameorigin X-Frame-Options 預設值是如何設定的,並考量其與 frame-ancestors 的既定互動。完成的標準是釐清預設值是否應包含 frame-ancestors self,並實作這項決定,同時不讓這兩個 framing 控制以誤導性的方式保持不一致。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
ruby
領域
security
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。