mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1926] prevent info leakage through /proc #1289
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#1289
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @brussell1 on GitHub (May 5, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1926
Blacklisting /proc works, though breaks some programs (firefox).
It's also possible to blacklist various information like "blacklist /proc/cpuinfo".
Unfortunately I'm not able to deny access to /proc/mounts or /proc/self/*.
E.g. right now all mountpoints of the host are visible, including all firejail related, which, imo, shouldn't be accessible in a sandbox.
Is there a solution to this problem?
@SkewedZeppelin commented on GitHub (May 5, 2018):
There are already a few restrictions on /proc via Firejail itself. If you want system wide ones you can use hidepid, but that comes with some issues too.
Grsecurity has features to further restrict /proc via
GRKERNSEC_PROC_ADDand even restrictions of /sysfs. As powerful as they are, they caused a ton of breakage on the desktop side and (I assume) were more intended for use on the single application server side.I'm sure the situation can be improved, but there is a lot to it.
@Vincent43 commented on GitHub (May 5, 2018):
Grsecurity public patches are no more anyway.
hidepidis the way to go.@chiraag-nataraj commented on GitHub (May 5, 2018):
Just a side note, I've had issues with
hidepid=2andsystemd/logindnot cleaning up sessions. One way to fix this (if you care - I don't think it actually impacts anything besides having tons of zombie sessions inloginctl list-sessions) is creating a special group (I called it proc), mounting proc withhidepid=2,gid=<gid>with<gid>being the gid from the group created in the previous step, and adding your user andpolkitdto that group. At least...I think it's solved that issue...I don't generally log out once I've logged in, so it's hard to know if that was the issue 😂/endrant
@Vincent43 commented on GitHub (May 5, 2018):
Adding yourself to hidepid gid will defeat the purpose of using it with firejail (it still will affect system-wide daemons running as non-root but that is unrelated to this case). I think adding logind and polkit should be enough:
@chiraag-nataraj commented on GitHub (May 5, 2018):
Oh right, you have to add
logindto the group as well. For some reason, I think I had issues until I added my user as well. I'm also thinking about removing my user from the group anyway since I don't log out often (so the zombie sessions don't really have an impact on me).@Vincent43 commented on GitHub (May 5, 2018):
Keep in mind that by removing your user from hidepid whitelist you loose ability to monitor system-wide processes from user account.
@chiraag-nataraj commented on GitHub (May 5, 2018):
Yeah, and sometimes that includes firejailed processes.
@chiraag-nataraj commented on GitHub (May 5, 2018):
By the way,
hidepid=2won't blacklist/proc/mountsor/proc/self, so while it's useful, it won't solve the OP.@Vincent43 commented on GitHub (May 5, 2018):
I see below in logs:
@brussell1 commented on GitHub (May 5, 2018):
@Vincent43
And whats with "cat /proc/mounts". Try it out...
@Vincent43 commented on GitHub (May 5, 2018):
I know. I just demonstrated what is happening. I don't know if it's a bug or feature.
@Vincent43 commented on GitHub (May 6, 2018):
You can block various /proc and /sys entries through AppArmor integration, example:
@brussell1 commented on GitHub (May 7, 2018):
Thanks for the info Vincent43. Though I would like to hear the opinion of netblue30 regarding this matter.
@chiraag-nataraj commented on GitHub (Jul 30, 2018):
@netblue30 Any comments on this?
@chiraag-nataraj commented on GitHub (May 21, 2019):
@netblue30, is this something we want to work on within firejail or is this outside the scope of the project?
@SkewedZeppelin commented on GitHub (Jul 21, 2022):
A comment I've read regarding Tor browser profiles:
Files like /sys/class/net/wlp1s0/address do indeed contain the MAC address
@ghost commented on GitHub (Jul 23, 2022):
@SkewedZeppelin IMO we should add a
blacklist /sys/class/netto the relevant Tor profiles to mitigate deanonimazation attempts. Great catch! Are you planning on opening a PR for this?Off-topic: unfortunately the
--mac=addressoption is not supported for wireless interfaces. But there are several other options available on most distro's for MAC address spoofing (fully or partially).