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

Permissions-Policy rules to consider #38

Open
20 of 34 tasks
philwareham opened this issue Feb 20, 2019 · 24 comments
Open
20 of 34 tasks

Permissions-Policy rules to consider #38

philwareham opened this issue Feb 20, 2019 · 24 comments
Assignees

Comments

@philwareham
Copy link
Member

philwareham commented Feb 20, 2019

We have implemented some Permissions-Policy header rules - although the feature is in draft form and the spec and number of policies is in flux. Listed below are rules that we may want to consider as things develop. Please leave this issue open (but check off any rules we have implemented) as this will be an ongoing process. I have included links to documentation for each policy where available - feel free to add any missing doc links as and when you find them.

See https://github.com/w3c/webappsec-permissions-policy/blob/master/features.md for the latest list of accepted/proposed features.

@petecooper petecooper changed the title Complete set of Feature-Policy rules to consider Complete set of Permissions-Policy rules to consider Dec 31, 2020
@petecooper
Copy link
Member

Feature Policy has been renamed Permissions Policy:

https://scotthelme.co.uk/goodbye-feature-policy-and-hello-permissions-policy/

https://caniuse.com/permissions-policy (no browser support at the moment)
https://caniuse.com/feature-policy (~90% at time of writing)

@philwareham
Copy link
Member Author

Thanks Pete - will investigate this next week.

@petecooper
Copy link
Member

No action needed really, I'm doing Feature Policy to Permissions Policy duping as sites are migrated (given zero browser support it's hardly urgent), so we can run both in parallel for as long as we need to.

@philwareham
Copy link
Member Author

philwareham commented Feb 8, 2021

@petecooper I think now is the time to remove Feature-Policy from the headers and just use Permissions-Policy. The inclusion of the older header is giving me console warnings in Chrome and affecting Lighthouse scores.

Since Chrome is the browser that's most advanced terms of Feature-Policy/Permsisisons-Policy support which should IMO use that as the benchmark. Other browsers will gradually fall in line with the updated spec.

@petecooper
Copy link
Member

Yep - agreed. I'll strip 'em out and upload this evening unless you get there first.

@petecooper
Copy link
Member

Actually, I have a bit of time before a meeting, I'll start now.

@philwareham
Copy link
Member Author

Cheers. I see we are also missing some of the previous rules such as accelerometer - any reason for that?

@petecooper
Copy link
Member

Not intentionally, no - by all means add back in, I haven't taken stuff out knowingly!

@philwareham
Copy link
Member Author

philwareham commented Feb 8, 2021

OK, if you can strip out Feature Policy I will then add the additional rules to Permission Policy, so we don't clash with commits. Thanks very much!

@petecooper
Copy link
Member

OK, first pass of FP stuff done, I'll upload configs in the interim then do it again when you're done.

philwareham added a commit that referenced this issue Feb 8, 2021
@philwareham
Copy link
Member Author

@petecooper great, I have now updated all the Permissions-Policy rules as per our list above. Happy for this to move to the live servers when you have spare time. No rush.

@petecooper
Copy link
Member

@philwareham - all uploaded just now, Nginx bounced.

@petecooper
Copy link
Member

@philwareham - we (you) should also update the OP links to reflect PP directives, not FP directives.

@philwareham
Copy link
Member Author

Thank you Pete! Have a good day.

@petecooper petecooper changed the title Complete set of Permissions-Policy rules to consider Permissions-Policy rules to consider Apr 15, 2021
@Bloke
Copy link
Member

Bloke commented Apr 16, 2021

Continuing discussion from here then...

Seems we have various classes of policy but categorising them is not intuitive (as you've no doubt found!). Combined with that, we currently have two broad sets of policies:

  1. For docs, RPC, Textile, .io, .net, .org:
    camera=()
    fullscreen=(self)
    geolocation=()
    gyroscope=()
    interest-cohort=()
    magnetometer=()
    microphone=()
    midi=()
    notifications=(self)
    payment=()
    push=(self)
    speaker=()
    sync-xhr=(self)
    vibrate=()
  2. Additional policies for .com:
    accelerometer=()
    ambient-light-sensor=()
    autoplay=()
    battery=()
    display-capture=()
    picture-in-picture=()
    screen-wake-lock=()
    usb=()
    xr-spatial-tracking=()

BUT in the .com case there are three missing from the common list:

  • notifications
  • speaker
  • vibrate

So the 'cheap' way to do it is to just have 3 includes, one for each of the above sets and load them in according to how we need them per server.

Better, might be a classification system that we can use to lump newer things in as and when they come along but, as noted, that's fun especially given that some of the classes we need on one server and not another. I've had a go and come up with four potential groups:

Peripherals - always shared (at the moment)

  • Common
    camera
    microphone
    midi
  • Omitted from .com
    speaker

Mobile (out and about)

  • Common
    geolocation
    gyroscope
    magnetometer
  • Extras for .com
    accelerometer
    ambient-light-sensor
    battery
    screen-wake-lock
  • Omitted from .com
    vibrate

Display-related (notifications/updates)

  • Common
    fullscreen(self)
    push(self)
    sync-xhr(self)
  • Extras for .com
    display-capture
    picture-in-picture
  • Omitted from .com
    notifications(self)

Interfaces (to other software systems)

  • Common
    interest-cohort
    payment
  • Extras for .com
    autoplay
    xr-spatial-tracking
    usb

Bit of a mess. We could narrow that down to hardware/software split - that might be neater. I'm sure if we hammered this around a bit we could come up with a suitable taxonomy that allowed us to keep our hair/beards intact and manage this stuff in a sane way.

@petecooper
Copy link
Member

BUT in the .com case there are three missing from the common list:
notifications
speaker
vibrate

They must've slipped through the net - not deliberately omitted afaik. Will fix.

@Bloke
Copy link
Member

Bloke commented Apr 16, 2021

Ah, that makes it slightly easier as we only have two sets to maintain - common and extras, potentially for each distinct group :)

@philwareham
Copy link
Member Author

philwareham commented Apr 16, 2021

Please don’t action this until I’m back from holiday. The sets should be identical and also reflect the list at the top of this thread (some policies never became final candidate so we’re removed, which I updated above). I need to double check if any more have been added or removed from spec in last 2 months before we can revise again.

@Bloke
Copy link
Member

Bloke commented Apr 16, 2021

Cool, then that makes it simpler still :) One include. Job done.

@philwareham
Copy link
Member Author

philwareham commented Apr 19, 2021

They must've slipped through the net - not deliberately omitted afaik. Will fix.

Sorry, I've reverted your commit - those rules were removed from the spec hence why they were purposely not on .com site. I'll go through the other site configs and remove them too now. Cheers.

@philwareham
Copy link
Member Author

FYI I've removed the interest-cohort policy from all but the forum domain, for reasons I've already stated in the forum.

@philwareham
Copy link
Member Author

@petecooper hi Pete, I have just updated all the server config files to ensure they have latest (and consistent) set of rules. Can you deploy to live when you get a moment? Thanks!

@petecooper
Copy link
Member

@philwareham - done. For future ref, please try to leave files in https://github.com/textpattern/server-config/tree/main/temp/_to%20check%20and%20purge as-is since I need to pick through for anything that's dropped by the wayside as things evolve. No worries in this case since it's permissions policy uniformity, but there's value in them being former production files – I take a few now and again and diff against the current files, and tweak as necessary (mostly it's a just a housekeeping exercise). Thanks!

@philwareham
Copy link
Member Author

OK, will keep that in mind. Thanks Pete.

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

No branches or pull requests

3 participants