buttercup / buttercup-browser-extension

:earth_asia: Buttercup browser extension
https://buttercup.pw
MIT License
230 stars 42 forks source link

Browser Policy Support #300

Open Paddidox opened 4 years ago

Paddidox commented 4 years ago

For me as system administrator, this extension is missing a possibility to configure policies. Google Chrome (Firefox probably too) offers extension policy support. These can be set either as preference (user can change) or enforced (input disabled for user).

In my case, our company must not use cloud services like Google Drive, Dropbox or similar.

My suggestions for policies:

perry-mitchell commented 4 years ago

@arajdon This is great, and I agree we need this. I'm not at all familiar with policies, so I appreciate any advice you have on the topic. I presume the policies are configured by some sys admin for a fleet of machines? And this info is available from the OS/browser?

Very interesting and I'd be happy to see this included.

Paddidox commented 4 years ago

I presume the policies are configured by some sys admin for a fleet of machines?

Right. These settings are deployed using any policy management system to either devices or directly to users in the company.

And this info is available from the OS/browser?

For example, I've configured a whitelist for uBlock Origin by policy.

Windows Registry Setting: [HKEY_CURRENT_USER\SOFTWARE\Policies\Google\Chrome\3rdparty\extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm\policy] "adminSettings"="{\"netWhitelist\":\"domain.tld\nanotherdomain.tld\"}"

Translates into: Extension: cjpalhdlnbpafiamejdnhcphjbkeiagm Policy Key: adminSettings Policy Value: {"netWhitelist": "domain.tld anotherdomain.tld"}"

I guess that as soon as the browser recognizes the policy, the extension is able to read that. Values can be Integers, Strings and Booleans. To read all currently set policies open "chrome://policy".

If you have questions let me know, we're managing Chrome with such policies for roundabout 4000 devices.

vikaspotluri123 commented 4 years ago

@perry-mitchell I did a bit of digging, and I think I found the page with information pertaining to this:

https://developer.chrome.com/extensions/manifest/storage

Here's uBlock's managed_storage.json as a reference:

https://github.com/gorhill/uBlock/blob/master/platform/chromium/managed_storage.json

perry-mitchell commented 4 years ago

Great stuff! Thanks for the links. I think adding policy support for the extension would be quite easy and definitely a good idea. Might be best to have a core policy module and then policy adapters per platform - the desktop app would most likely also benefit from this.