-
Notifications
You must be signed in to change notification settings - Fork 519
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
persist state for wicked, chrony, and systemd #970
Conversation
Before saving clock measurements and DHCP leases to durable storage, we want to make sure they can't be modified by an untrusted workload. chronyd and wicked are both network-facing daemons, so we have the additional goal of limiting their access to the host OS, to mitigate the impact of a compromise. dbus-broker does not need to persist any state, but could be exposed to untrusted local input, and benefits from similar confinement. systemd also persists some state, such as the journal and the random seed, so we label that data as well to prevent unexpected changes. Signed-off-by: Ben Cressey <[email protected]>
Now that clock measurements are protected by the SELinux policy, we can save them on durable storage so they are available after an OS update. Signed-off-by: Ben Cressey <[email protected]>
Now that lease files are protected by the SELinux policy, we can save them on durable storage so they are available after an OS update. Signed-off-by: Ben Cressey <[email protected]>
This partially reverts 58b0289. We do not use the systemd feature for private directories, so this change only affects systemd's own programs. Signed-off-by: Ben Cressey <[email protected]>
We don't have a good way to persist the machine ID in a place that's accessible during early boot, so our best bet is to always generate the same ID. Both Xen and KVM can provide a UUID to identify guests, and systemd already uses the KVM value if available. This patch extends the logic to check for the Xen value as well. Signed-off-by: Ben Cressey <[email protected]>
Signed-off-by: Ben Cressey <[email protected]>
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.
I was left confused after Jake's comment - we're not losing /var/cache
on reboot, right? We rely on it for migrations, at least, and surely other things.
The testing focuses on SELinux, and does show the machine ID, but you confirmed that all these things are persisting over reboot? Old journal entries, same machine ID, chrony timings, wicked lease...
packages/systemd/9004-machine-id-setup-generate-stable-ID-under-Xen.patch
Show resolved
Hide resolved
Correct,
Yes, I've confirmed that the files are persisted across reboot. |
I've also tested a downgrade from a system with the stateful files into an older version. wicked and chrony were both stateless before and didn't expect files in My concern was with journald, which previously defaulted to It ended up working fine, though, since the policy allows for writes to files with no label or an unknown label. |
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.
LGTM
Issue number:
#248 , #249 , #250
Description of changes:
Confine chrony, wicked, and dbus-broker via SELinux policy; move DHCP leases and clock measurements back to persistent storage. Also persist the journal and the random seed.
Testing done:
No AVC denials logged in
dmesg
or in the journal.Processes are labeled as expected.
Files are labeled as expected.
The machine ID is consistent across reboots and stop/start for both m4.xlarge and m5.xlarge.
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.