-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Mount /rw and /home with nosuid + nodev #5263
Comments
Updated description to include |
Also want to point out that '/rw/usrlocal' may be an issue, since it has a separate mountpoint in fstab. Not sure if that can be treated the same way as /rw and /home. |
I am afraid that this is not enough for what you want:
(Last but not least, if you want to access root through a compromised user, attacker can go this way…) There might be more, but it does not matter now. Even those two suggest it is not feasible to do it without sacrificing anything from the current features. Well, we could sacrifice those features just for some set of VMs. This gets close to #1006 and DVMs in Qubes 4. Those approaches can also handle the user being compromised, not just root. Another way would be opt-in for /rw/config/rc.local and bind mounts and suid+dev – it would have to be configured in properties of the VM. |
Yes, it does mitigate in concert with other precautions. Threat model is de-privileged process using suid to re-escalate privs. It can't alter /rw/config etc. while its still just 'user', and these dirs are easy to quarantine in most AppVMs. (Even w/o quarantine, what pct of malware will target Qubes dirs?) OTOH, /home contents have to be retained in a majority of use cases. As for features, its not a real issue for /home. Really, suid doesn't belong there. FYI, this feature will be added to Qubes-VM-hardening so that fstab is modified at install time when the mount options are not already present. |
I am still not getting the point. If a process can create a malicious SUID binary, then it probably can also alter /rw/config/rc.local. Could you be more specific about the attack scenario you have in mind?
|
For this to make holistic sense,
https://github.com/tasket/Qubes-VM-hardening is requisite knowledge.
/rw/config/rc.local is taken care of by
https://github.com/tasket/Qubes-VM-hardening
|
Aha, thank you for pointing this out. Now, it starts making sense. However, I am not sure if this makes sense in vanilla Qubes unless whole hardening is included.
|
Related:
quote @madaidan
|
Related: |
I'm fine with mounting /home with |
This was merged in Qubes as per pull requested referenced in my last post. Therefore I think this can be closed. We can think about improving mount options for other mount point but other tickets should be created for that (and then linked here as notifications for everyone interested in this). |
|
cc @pwmarcz |
Build outside of /home? |
Where exactly do you propose @tasket ? Chroot (especially for devel builds) should be persistent, to avoid recreating it each time, which doesn't leave much options in AppVM. |
I haven't noticed breakage yet. Only other alternative I can think of atm is to remount /home without |
That's also an option. |
The problem you're addressing (if any)
When a template has been configured to enforce internal user permissions, malware that gains a temporarily useful privilege escalation may continue as root user indefinitely in AppVMs by setting up executables in /home that have +s SUID bit set. The effect is that an OS patch for the initial vulnerability will not de-privilege malware that exploited it.
Similarly, the ability to create device node files in /home can permit privilege escalation, and such nodes normally don't belong in /home.
Describe the solution you'd like
Change the /rw and /home entries in /etc/fstab to use the
nosuid
andnodev
options. This works even with bind mounts.Where is the value to a user, and who might that user be?
Users who do not want malware to persist indefinitely or easily gain root privileges may remove the 'qubes-core-agent-passwordless-root' package, or reconfigure templates according to the 'vm-sudo' doc or Qubes-VM-hardening.
Mounting /rw and /home with
nosuid
+nodev
bolsters security in such template configurations by giving OS security patches a chance to de-privilege malware.Relevant documentation you've consulted
https://www.qubes-os.org/doc/vm-sudo/
https://github.com/tasket/Qubes-VM-hardening
The text was updated successfully, but these errors were encountered: