https://securityheaders.com now recommends that sites include a 'feature-policy' header. One that is detailed here: https://scotthelme.co.uk/a-new-security-header-feature-policy/ and here: https://developers.google.com/web/updates/2018/06/feature-policy
It's still pretty new but it'd be a great addition to Seckit.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 2990047-11.patch | 4.76 KB | mcdruid |
| #8 | 2990047-8-fpD7.patch | 4.68 KB | hey_germano |
| #5 | 2990047-5-add-support-for-feature-policy.patch | 5.31 KB | gg4 |
| #5 | interdiff--2990047--2-5.txt | 6.07 KB | gg4 |
| #4 | 2990047-4-add-support-for-feature-policy.patch | 3.38 KB | nironan |
Comments
Comment #2
adammaloneAdding initial patch here for review.
Comment #3
floown commentedHello,
We hope a backport to Drupal 7. Pleaaaaase! ;)
Comment #4
nironan commentedFirst attempt to a 7.x port
Comment #5
gg4 commentedre-roll of #2
Comment #7
mcdruid commentedOh, hai Adam :)
This looks good for D8; committed. Thank you!
The D7 patch looks like it needs a bit more work though; at a glance:
1) It looks like it has a mix of
array()and[]syntax, where D7 code should still usearray().2) These are defined (using the wrong array syntax) as empty values and never used.
3) This is wrong:
Check one of the other
#descriptionelements for an example; we use something like this for the links:4) Copy-pasta; this is not "Origin-based protection".
5) Tests please.
Comment #8
hey_germanoHere's another shot at the D7 version, with the edits suggested in #7.
Comment #9
hey_germanoComment #11
mcdruid commentedI think the problem with the last patch was that the textfield for the actual policy has a maxlength of 128 by default, whereas the test is trying to set a policy of >140 chars.
It probably makes more sense to use a textarea, but that means I'd prefer the fieldset to be collapsed if the feature is disabled (as opposed to checking against the defaults).
It doesn't look like the admin form is consistent in which approach it takes for collapsing fieldsets, but that's a clean up job for another issue.
Comment #13
mcdruid commentedThank you everyone that contributed!
Comment #15
mcdruid commentedSome debug slipped into the test in this issue, and has since been reformatted:
I'm about to remove that.