10

I'm trying to enforce an URLAllowlist for my local Chromium (Version 89.0.4389.90, Snap) on Ubuntu 20.04.2 LTS.

According to Google the policy should be available. The Chromium project discusses the format of such lists.

Following this guide from Google:

  1. Go to your /etc/opt/chrome/policies/managed folder.

  2. Create or update a JSON file and enter URLs as needed:

    In URLBlocklist, add the URLs that you want to block.

    In URLAllowlist, add the URLs that you want users to access.

  3. Deploy the update to your users.

I placed two .json files (URLAllowlist.json, URLBlocklist.json) in the above mentioned directory and restarted Chromium. However, chrome://policy/ does not show any active policies.

I also followed this Chromium guide, but the example policy isn't even applied.

EDIT: I see no difference, whether using:

  • /etc/opt/chrome/policies/managed/
  • /etc/chromium/policies/managed/
  • ~/snap/chromium/common/chromium/Default/policies/managed/
  • ~/.config/chromium/policies/managed/

How do I deploy URLAllowlist/URLBlocklist for Chromium on Ubuntu?

3 Answers3

5

Installed from .deb, the correct location for the policy on Ubuntu 20.04.2 LTS is /etc/chromium-browser/policies/managed/.

Installed from snap on Ubuntu 20.04

  1. I tried solution 2) below, but it did not work. So i tried /var/snap/chromium/current/policies/ and then it worked

  2. I also came across users, who reported /var/snap/chromium/current/policies/managed/ is working. The same applies to me, I'm not sure which directory would be preferable here.

2

Not just the location, but also the permission are important. Ensure that if the policy is a managed policy, chmod it so its only writable by root or admin.

https://www.chromium.org/administrators/linux-quick-start/ :

Make sure that policy JSON files under ../managed/ are not writable by just anyone! Google Chrome / Chromium gives these files higher priority, so they should only be writable by an administrator or root!

2022-03-17 UPDATE: The policy file no longer support // comments in the json policy file (it used to)!! If you have comments, chromium will not pick up the policy (In Debian based version, however the Raspberry pi version does still seem to support comments). Please ammend your policy files as required.

-1

It worked like google help said but you must pay attention of the address /etc/opt/ which is not so usual to me (having 'opt' in 'etc'!).

So the correct location was (which I had to create) /etc/opt/chrome/policies/managed/

I'm using Google Chrome Version 98.0.4758.80 (Build officiel) (64 bits) on Ubuntu 20.04.3 LTS.