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

"Private Window with Tor" and Snowflake's Volunteer to help other connect... Settings options should be disabled when Tor is admin-disabled #17609

Open
stephendonner opened this issue Aug 20, 2021 · 5 comments

Comments

@stephendonner
Copy link

stephendonner commented Aug 20, 2021

Description

"Private Window with Tor" and Snowflake's Volunteer to help other connect... Settings options should be disabled when Tor is admin-disabled

Found while testing #17530.

Steps to Reproduce

  1. write defaults write com.brave.Browser TorDisabled -integer 1 into a Terminal.app window and press enter
  2. new profile
  3. launch Brave
  4. click on the "hamburger" menu and notice there's no New Private Window with Tor option
  5. load brave://policy and confirm TorDisabled is set to true
  6. open brave://settings/extensions and look at the Private Window with Tor option

Actual result:

Private Window with Tor is still toggle-able to on and off, and works.

example example
Screen Shot 2021-08-20 at 8 56 27 AM Screen Shot 2021-08-20 at 11 50 22 AM

Expected result:

Private Window with Tor should be disabled, like Windows and Linux.

Windows Linux
windows-tor-disabled Screen Shot 2021-08-20 at 11 38 58 AM

Reproduces how often:

100%

Brave version (brave://version info)

Brave 1.30.38 Chromium: 93.0.4577.51 (Official Build) nightly (x86_64)
Revision 762d21050e2da59930c784c09b134d0b0b148188-refs/branch-heads/4577@{#915}
OS macOS Version 11.5.2 (Build 20G95)
@stephendonner stephendonner changed the title "New Private Window with Tor" Settings option should be disabled when Tor is admin-disabled "Private Window with Tor" Settings option should be disabled when Tor is admin-disabled Aug 20, 2021
@simonhong simonhong self-assigned this Aug 22, 2021
@simonhong
Copy link
Member

simonhong commented Aug 23, 2021

From the brave://policy, policies set by using defaults write com.brave.Browser TorDisabled -bool true is added as Recommended Policy like below.
Screen Shot 2021-08-20 at 10 38 51 AM

With another testing defaults write com.brave.Browser BrowserGuestModeEnabled -boolean true,
Brave and Chrome show same behavior. Both browser displays BrowserGuestModeEnabled as a recommended policy.

I think this is expected behavior because user set this policy. (not by admin).
Maybe macOS provides another way to make policies mandatory.
According to the chromium's doc,
Additional plist file is needed under /Library/Managed Preferences/<username>. but I tested by adding com.brave.Browser.nightly.plist with below below and it doesn't work. Still it's recommended policy.

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>TorDisabled</key>
        <true/>
</dict>
</plist>

Chromium check whether policy is mandatory or not by using CFPreferencesAppValueIsForced() .
See components/policy/core/common/policy_loader_mac.mm

@rebron rebron added the priority/P3 The next thing for us to work on. It'll ride the trains. label Sep 14, 2021
@MrAshRhodes
Copy link

@simonhong
This actually worked for me.

Setting the following com.brave.Browser.plist file in /Library/Managed Preferences/$username

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
 <dict>
  <key>TorDisabled</key>
  <true/>
 </dict>
</plist>

image

It only applies to the current user rather than the machine

Moving from the $username for to /Library/Managed Preferences/

image

Made it mandatory for the whole machine.

The file that contains policies that are Recommended is

~/Library/Preferences/com.brave.Browser.plist

Hope this helps anyone.

@simonhong
Copy link
Member

@MrAshRhodes Wow, thanks for your great tip! 👍🏼

@stephendonner
Copy link
Author

stephendonner commented Dec 12, 2022

Whilst testing group-policy options for the Snowflake extensions in #25315, I noticed it also doesn't cover the newly-added Volunteer to help others connect to the network pref:

Steps:

  1. installed 1.47.125
  2. pasted defaults write com.brave.Browser.beta TorDisabled -bool true into a Terminal/console window, and pressed return
  3. launched Brave
  4. confirmed that the New Private Window with Tor menu option is removed

Actual Results:

However, both Private window with Tor and Volunteer to help others connect to the Tor network should be grayed out/disabled (NOT toggled Off; unclickable)

Expected Results:

Both Private window with Tor and Volunteer to help others connect to the Tor network entries in brave://settings/privacy should be disabled when TorDisabled is true

brave://policy brave://settings/privacy
Screen Shot 2022-12-12 at 10 34 54 AM Screen Shot 2022-12-12 at 10 35 46 AM

@stephendonner stephendonner changed the title "Private Window with Tor" Settings option should be disabled when Tor is admin-disabled "Private Window with Tor" and Snowflake's Volunteer to help other connect... Settings options should be disabled when Tor is admin-disabled Dec 12, 2022
@MadhaviSeelam
Copy link

MadhaviSeelam commented Dec 12, 2022

Tested in Win 11 x64. Following have been found when TorDisabled is true:

  1. Install 1.47.121
  2. launch Brave
  3. opened brave://settings/privacy in a new-tab
  4. enabled Volunteer to help others connect to the Tor network toggle
  5. clicked on Extensions puzzle>>Snowflake
  6. opened brave://extensions in a new-tab
  7. Snowflake extension is shown
  8. close the browser
  9. opened Registry Editor
  10. created BraveSoftware/Brave key under HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Policies\
  11. create DWORD (32-bit) value named TorDisabled with value 1
  12. launch Brave
  13. open brave://policy
  14. confirmed TorDisabled is true
  15. open brave://settings/privacy
  16. click Extension puzzle>>Snowflake extension
  • Volunteer to help other connect... was toggled Off and greyed out
  • However Snowflake extension was NOT disabled
  • Private Window with Tor toggle is Off and Private Window with Tor option in the hamburger menu is not available
ex1 ex2 ex3
image image image

@rebron rebron added priority/P4 Planned work. We expect to get to it "soon". and removed priority/P3 The next thing for us to work on. It'll ride the trains. labels Mar 1, 2023
@rebron rebron added this to General May 28, 2024
@rebron rebron moved this to P3 Backlog in General May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: P3 Backlog
Development

No branches or pull requests

5 participants