question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create group policy options for Shields

See original GitHub issue

Description

Add group policy support for Shields (up/down). This will support individual URLs and patterns

  • Added BraveShieldsDisabledForUrls to disable shields urls
  • Added BraveShieldsEnabledForUrls to enable shields urls

For the design, see Figma: https://www.figma.com/file/3A6F6VrxVahiZFxLr7j7FO/Desktop-Shields?node-id=2695%3A49651

Behavior notes

This is an overview of what the user should expect when the policy is set.

Behavior when DISABLED

When the site being visited matches the URL or the pattern:

  • shields should be DISABLED
  • when clicking shields (to open advanced panel), person should see shields disabled
  • shields itself should NOT be toggleable
  • the other settings will never show up because shields are down

Behavior when ENABLED

When the site being visited matches the URL or the pattern:

  • shields should be ENABLED
  • when clicking shields (to open advanced panel), person should see shields enabled
  • shields itself should NOT be toggleable (should be grayed out)
  • none of the sub-values (block ads, https upgrade, block script, block fingerprint, block cookie) should be toggleable. It should be grayed out.

Example of how to add the group policy (Windows)

  1. Open regedit.exe
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\
  3. Create the key (folders) BraveSoftware\Brave\ if they don’t already exist

How to add the shields DISABLE policy

  1. Create a new key (folder) BraveShieldsDisabledForUrls inside the root (HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\)
  2. You can now add REG_SZ (string value) for any sites you wish to mark as disabled.

The entries need to created in a numbered fashion. Let’s say you want to add two values. You would create:

  • REG_SZ value 1 set to https://www.example.com
  • REG_SZ value 2 set to [*.]brave.com

This would DISABLE shields on brave.com and all subdomains. It would also DISABLE shields on https://www.example.com - but NOT on other subdomains (or if you leave www. out for example).

How to add the shields ENABLE policy

  1. Create a new key (folder) BraveShieldsEnabledForUrls inside the root (HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\)
  2. You can now add REG_SZ (string value) for any sites you wish to mark as enabled.

The entries need to created in a numbered fashion. Let’s say you want to add two values. You would create:

  • REG_SZ value 1 set to [*.]twitter.com
  • REG_SZ value 2 set to https://www.example.com

This would ENABLE shields on brave.com and all subdomains. It would also ENABLE shields on https://www.example.com - but NOT on other subdomains (or if you leave www. out for example).

Adding using a .reg file (also on Windows)

  1. Create a new empty file called shields-policy.reg
  2. Open it in Notepad and put this for the content:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave]

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\BraveShieldsEnabledForUrls]
"1"="[*.]twitter.com"
"2"="https://www.example.com"

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\BraveSoftware\Brave\BraveShieldsDisabledForUrls]
"1"="https://www.example.com"
"2"="[*.]brave.com"
  1. Save the file and close it
  2. Double click the shields-policy.reg file
  3. You can use regedit.exe to confirm it was added

Test plan

Go through above - download/run the registry key. Verify that

  • install is showing as managed (in hamburger menu)
  • behavior matches expected behavior above

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
LaurenWagscommented, Dec 5, 2022

thanks @bsclifton!

1reaction
bscliftoncommented, Dec 5, 2022

This is available on macOS and Linux - but I’m not sure offhand how to test actually. Let me dig in on that and then I’ll share an update

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step 3: Create and apply a common security group policy
Step 3: Create and apply a common security group policy · In the navigation pane, choose Security policies. · If you have not...
Read more >
Best practices for configuring Windows Defender Firewall
Best practices for configuring Windows Defender Firewall · Keep default settings · Understand rule precedence for inbound rules · Create rules for ...
Read more >
How to Deploy the Barracuda Content Shield Agent via GPO
This article provides sample scripts that can be used for successful deployment of Barracuda Content Shield (BCS) using GPO.
Read more >
Demystifying Settings for WSUS Patch Implementation in ...
WSUS' Group Policies are long in names and complicated in meaning. Greg Shields demystifies in this video.
Read more >
To install the WTS to Microsoft Edge Chromium using GPO
You can use Group Policy Object (GPO) to deploy the Webroot Web Threat Shield (WTS) extension to Edge Chromium on Windows domains, which...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found