-
Notifications
You must be signed in to change notification settings - Fork 51
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
proc-hidepid.service
: Fixing Systemd related issues
#208
Comments
This allows users that are a member of the `proc` group to be excluded from `hidepid` protections. #208
See referenced commit, I added just now: But that doesn't really fix much. Just an additional feature. Users that are members of group If we use I didn't test if this would help if sandbox-app-launcher - Sandboxed Application Launcher; flatpak or something similar was used. It might be useful for servers because then any (compromised) daemons (such as the web server that usually run under their own dedicated user account) might be no longer able view pids of other users. If doing this, should use below |
I could not entirely reproduce this with the given configuration, although some PIDs do have an unnecessary subgroup added. I ran I dug deeper and found that
On a server system, only systemd-logind running under the given user had the Proc group added. No other user processes had this group. I tried on a desktop running xfce4, and got these:
I had Firefox(debian repo) and Bitwarden (appimage) running, both using their namespaces and user namespaces, and they did not appear as using an extra subgroup. Additional notable items missing the subgroup are gdm-x-session and all subprocesses, notepad, terminal, etc. It mainly appears that all subprocesses under Perhaps it is possible to drop the extra PID from the subservices launched? I'm not sure but I will try to research it. |
Then I guess we should add:
Files should be:
Seems like a useful pre-configuration. As long as (Except if someone is already using Can we drop either file A) or file B) and have the same effect? Would be good to know what breaks depending on what file is shipped vs missing. |
Interesting. So how exactly is this any different than just dropping in protectproc=yes for all system services? Because since we allow all user services and if this actually whitelists user space applications, isn't this the same behavior as just protectproc'ing system services? I might be missing some details because I have not tested this myself. |
This essentially applies protectproc=yes to all services and user apps except for some listed exceptions in my But ProtectProc=yes is useful, maybe it can be applied to the |
A default systemd service hardening would be much desired indeed. |
|
This is the script I use to prevent failures on startup when using proc-hidepid.service
I've had this configuration running for over a year now on a server host system, and a slew of server VMs. This is not tested on desktop systems.
Issues caused without this configuration, and said fixes, are mentioned here:
systemd/systemd#12955
I am unaware of exactly what security impact this may have, but it stops services from failing when booting.
The text was updated successfully, but these errors were encountered: