Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "disable everything" feature #6

Closed
simon--poole opened this issue Oct 29, 2019 · 9 comments
Closed

Add a "disable everything" feature #6

simon--poole opened this issue Oct 29, 2019 · 9 comments

Comments

@simon--poole
Copy link

For example, currently writing an API -
Feature-Policy: None would be absolutely magical.

I did take a look at the Moz docs and I couldn't quite figure out if it's supported yet.

@EvanHahn
Copy link
Member

Are you saying that you'd like something that disables all features? Or are you thinking of something else?

@simon--poole
Copy link
Author

A shorthand in the library to disable all would be nice, I'm happy to make a PR for that tomorrow - although I was referring to a specific 'None' value for the header rather than manually disabling them all. I can't quite make out from the Mozilla docs if there is such a value.

E.G. Feature-Policy: * None or just Feature-Policy: None

@EvanHahn
Copy link
Member

EvanHahn commented Nov 4, 2019

It's possible that I'm missing something when reading the spec, but it looks like there's no simple "disable everything", even with an empty policy.

Could you (or anyone else reading this issue) confirm that? Once we figure out the path forward, we can implement the "block everything" feature.

@webuniverseio
Copy link

I'm joining discussion late, but it would also be nice to have an option to opt out of everything via plugin config - so that every directive will be set to 'none', perhaps with an option to set some rules differently. For example in order to disable everything, but allow full screen:

{
  defaultForAll: ["'none'"],
  features: {
    fullscreen: ["'self'"],
  }
}

Obviously this might not work for everything, but this is what I have in mind at the moment.

@EvanHahn
Copy link
Member

EvanHahn commented Feb 11, 2020 via email

@EvanHahn
Copy link
Member

It looks like this issue is being discussed at w3c/webappsec-permissions-policy#189. I think we should wait on that discussion before picking anything here.

@EvanHahn EvanHahn changed the title Feature request: Allow a global setting Add a "disable everything" feature Feb 23, 2020
@electriquo
Copy link
Contributor

@EvanHahn: if i understand correctly, the discussion here implies of having default values for each feature and give the ability to override it. from security perspective, we take the most restrictive way as the default. thus, setting 'none' for each feature as a default value will be a bliss.

what do you think?

@EvanHahn
Copy link
Member

There are two options.

  1. Iterate over every feature and set it to "none". This sets a fairly large header value, but works with the spec today.
  2. Wait until Proposal: define default for all w3c/webappsec-permissions-policy#189 is resolved. If it is "accepted" and a "disable everything" feature is allowed, we could use that. If it's rejected, we can go with the first option.

I'm still waiting for that issue to be resolved before I make a decision, but it has been a long time so maybe I should reconsider.

@EvanHahn
Copy link
Member

Because the Feature-Policy header has been deprecated in favor of Permissions-Policy and Document-Policy, I'm putting this module in "maintenance mode" and won't be adding new features, including this one. If that's a problem, I'm more than happy to help people out with a fork.

See #10 and helmetjs/helmet#234 for more discussion.

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

No branches or pull requests

4 participants