-
Notifications
You must be signed in to change notification settings - Fork 297
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
ProtectHome
does not really protect home with ostree
#3211
Comments
More closely related is #907 I would say we should aim to switch to having the This is a valid issue however do be aware that there's a really giant difference between using systemd offers a whole lot of isolation knobs but the most reliable and complete in my opinion starts with |
Yes, we can use more strict hardening if we know it will not break our services. But as a matter of fact many distro just start with a permissive set of systemd hardening features. (e.g., Fedora and OpenSUSE). |
Longer term what we should probably do is have
It's not ineffective; it still helps against misconfiguration. A service has to go rather "out of its way" to access files in Or if you're arguing it's ineffective, then using only |
I've just tested that and 0700 make rpm-ostree fail with "Permission denied". I have no idea why... |
An option would be to have Another related topic is accessing SetUID binaries from previous deployment to exploit patched vulnerabilities. |
Yes. We can recommend that. It's just right now it breaks e.g.
But, that's fixable by having even the database diffing go over the daemon. Or maybe we have the daemon give the client file descriptors to just the rpm database dirs. |
The fix in coreos#4911 for CVE-2024-2905 only fixes the permissions for the current deployment and not for previous deployments for existing installations. The affected files can still be read from the previous deployment by looking at them in `/sysroot/ostree/deploy/...`. Extend the unit to fix all deployments on the system and update the logic to only update files that exists. See: coreos#4911 See: GHSA-2m76-cwhg-7wv6 See: ostreedev/ostree#3211
The fix in coreos#4911 for CVE-2024-2905 only fixes the permissions for the current deployment and not for previous deployments for existing installations. The affected files can still be read from the previous deployment by looking at them in `/sysroot/ostree/deploy/...`. Extend the logic to fix all deployments on the system and update the logic to only update files that exists. See: coreos#4911 See: GHSA-2m76-cwhg-7wv6 See: ostreedev/ostree#3211
It was pointed out that in the previous change here we missed the fact that the previous deployments were accessible. - Move the logic into Rust, adding unit tests - Change the code to iterate over all deployments - Add an integration test too Note: A likely future enhancement here will be to finally deny unprivileged access to non-default roots; cc ostreedev/ostree#3211
It was pointed out that in the previous change here we missed the fact that the previous deployments were accessible. - Move the logic into Rust, adding unit tests - Change the code to iterate over all deployments - Add an integration test too Note: A likely future enhancement here will be to finally deny unprivileged access to non-default roots; cc ostreedev/ostree#3211
It was pointed out that in the previous change here we missed the fact that the previous deployments were accessible. - Move the logic into Rust, adding unit tests - Change the code to iterate over all deployments - Add an integration test too Note: A likely future enhancement here will be to finally deny unprivileged access to non-default roots; cc ostreedev/ostree#3211
We want to start switching things so that the toplevel `/ostree` repository is mode 0700, to close off unprivileged code from being able to access it. Previous deployment roots may have setuid binaries, etc. The `/var/lib/containers/storage` directory is mode 0700 for this reason I believe. Closes: ostreedev#3211
It was pointed out that in the previous change here we missed the fact that the previous deployments were accessible. - Move the logic into Rust, adding unit tests - Change the code to iterate over all deployments - Add an integration test too Note: A likely future enhancement here will be to finally deny unprivileged access to non-default roots; cc ostreedev/ostree#3211
ProtectHome=yes
in systemd (seeman:systemd.exec
) hides user directories to "ensure they cannot get access to private user data". However, this setting does not really protect home with ostree. Services can still access user directories from/sysroot/ostree/deploy/fedora/var/home/
withProtectHome=yes
. An example is as follows.Suppose we have a
secret
file to protect:And a malicious service:
After it is started, the service can still steal the content of
secret
.To enforce the protection as expected, one has to also add something like
InaccessiblePaths=/sysroot
, which I think is counterintuitive and does not compatible with environment without ostree.I don't know if I shall post this issue here or to systemd. Please let me know if this is more relevant to systemd.
Maybe related: #2082
The text was updated successfully, but these errors were encountered: