-
Notifications
You must be signed in to change notification settings - Fork 71
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
Enable ptrace protection for browser sandbox #984
Conversation
Errored hosts (0)Changed hosts (28)Unaffected hosts (71)Changed hostsdiff for acid.ocf.berkeley.edu, arsenic.ocf.berkeley.edu, asteroid.ocf.berkeley.edu, avalanche.ocf.berkeley.edu, bigbang.ocf.berkeley.edu, blackout.ocf.berkeley.edu, blight.ocf.berkeley.edu, blizzard.ocf.berkeley.edu, cyanide.ocf.berkeley.edu, destruction.ocf.berkeley.edu, drought.ocf.berkeley.edu, eruption.ocf.berkeley.edu, famine.ocf.berkeley.edu, firewhirl.ocf.berkeley.edu, hailstorm.ocf.berkeley.edu, headcrash.ocf.berkeley.edu, heatwave.ocf.berkeley.edu, invasion.ocf.berkeley.edu, madcow.ocf.berkeley.edu, meteorstorm.ocf.berkeley.edu, plague.ocf.berkeley.edu, sinkhole.ocf.berkeley.edu, surge.ocf.berkeley.edu, tornado.ocf.berkeley.edu, typhoon.ocf.berkeley.edu, venom.ocf.berkeley.edu, volcano.ocf.berkeley.edu, wildfire.ocf.berkeley.edu*******************************************
Sysctl[kernel.unprivileged_userns_clone] =>
parameters =>
ensure =>
+ 1
value =>
- 1
*******************************************
+ Sysctl[kernel.yama.ptrace_scope] =>
parameters =>
"value": "1"
******************************************* Unaffected hosts
|
Only allow ptrace from a parent process to its children or via CAP_SYS_PTRACE. To verify sandbox status for Brave, Chrome, Firefox see brave://sandbox, chrome://sandbox, about:support, respectively. Also describe disadvantages of enabling unprivileged user namespaces. Distributions like Debian currently disable unprivileged user namespaces by default to decrease the kernel attack surface for local privilege escalation. See Debian bug #898446. If kept disabled, Brave 1.2+ and Chrome will still enforce namespace sandboxing via their setuid-root helper executable. See brave/brave-browser#3420 and brave/brave-browser#6247. Firefox does not include a setuid-root binary, however, so unprivileged user namespaces are useful to have for defence-in-depth, but not critical. See <https://www.morbo.org/2018/05/linux-sandboxing-improvements-in_10.html>.
Errored hosts (0)Changed hosts (28)Unaffected hosts (71)Changed hostsdiff for acid.ocf.berkeley.edu, arsenic.ocf.berkeley.edu, asteroid.ocf.berkeley.edu, avalanche.ocf.berkeley.edu, bigbang.ocf.berkeley.edu, blackout.ocf.berkeley.edu, blight.ocf.berkeley.edu, blizzard.ocf.berkeley.edu, cyanide.ocf.berkeley.edu, destruction.ocf.berkeley.edu, drought.ocf.berkeley.edu, eruption.ocf.berkeley.edu, famine.ocf.berkeley.edu, firewhirl.ocf.berkeley.edu, hailstorm.ocf.berkeley.edu, headcrash.ocf.berkeley.edu, heatwave.ocf.berkeley.edu, invasion.ocf.berkeley.edu, madcow.ocf.berkeley.edu, meteorstorm.ocf.berkeley.edu, plague.ocf.berkeley.edu, sinkhole.ocf.berkeley.edu, surge.ocf.berkeley.edu, tornado.ocf.berkeley.edu, typhoon.ocf.berkeley.edu, venom.ocf.berkeley.edu, volcano.ocf.berkeley.edu, wildfire.ocf.berkeley.edu*******************************************
+ Sysctl[kernel.yama.ptrace_scope] =>
parameters =>
"value": "1"
******************************************* Unaffected hosts
|
With
With
Ptrace Protection with Yama LSM (Non-broker) is expected to be no when using unprivileged user namespaces. See https://chromium.googlesource.com/chromium/src/+/d267fd9917cb1c7494a8067ea3c6f1831bb37e78%5E%21/
|
value => '1'; | ||
# Enable ptrace protection. Only allow ptrace from a parent process to its | ||
# children or via CAP_SYS_PTRACE. | ||
'kernel.yama.ptrace_scope': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, I had thought this was already set.
Wonder if we should enable this for all machines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like Debian disabled it in bug #712740. Yeah, we could enable it for all machines as Ubuntu does. It obviously won't prevent rogue processes from messing with user files including Kerberos tickets, but the only downside is losing the ability to gdb/strace processes running in the background without root (breaks gdb --attach
and strace -p
) and possibly some edge cases like wine. I'll merge this for now and in the meantime maybe one of you root folks can test sysctl kernel.yama.ptrace_scope=1
on the login server, app host, etc.
Only allow ptrace from a parent process to its children or via
CAP_SYS_PTRACE.
To verify sandbox status for Brave, Chrome, Firefox see
brave://sandbox, chrome://sandbox, about:support, respectively.
Also describe disadvantages of enabling unprivileged user namespaces.
Distributions like Debian currently disable unprivileged user namespaces
by default to decrease the kernel attack surface for local privilege
escalation. See Debian bug #898446. If kept disabled, Brave 1.2+ and
Chrome will still enforce namespace sandboxing via their setuid-root
helper executable. See brave/brave-browser#3420 and
brave/brave-browser#6247. Firefox does not include a setuid-root binary,
however, so unprivileged user namespaces are useful to have for
defence-in-depth, but not critical. See
https://www.morbo.org/2018/05/linux-sandboxing-improvements-in_10.html.