-
Notifications
You must be signed in to change notification settings - Fork 98
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
🌱 Dynamic measured boot and runtime attestation #1115
Comments
For others looking at this here is what I am testing with currently for Keylime in the Dockerfile for Kairos
then in the
And add in packages PERSISTENT_STATE_PATHS |
we should start by providing the agent as a luet package if possible so it can be installed as part of the build process, maybe even on the framework if needed. then setup and test if it works :D |
package is up: https://packages.kairos.io/Kairos/utils/keylime-agent/0.2.6/ seems like we also need to add /var/lib/keystone to writable paths. |
seems like the makefile install target creates the dir |
yes, its possible so I got a working keylime kairos version (working in the sense that it can connect :D) With a Dockerfile as such (with an up to date framework that has the keylime package available! Not released yet):
And then a cloud config as such:
On boot you get the agent auto connected to your keylime registrar:
And service is up and running:
|
So I finally get an example ongoing in which I tested the attestation and the failure of it. TBH, most of this is configuration done by the Keylime admin, not much special or specific from Kairos. PR at #2981 Most important thing is the configuration of the user permissions and to make sure the root CA from the registrar/verfier/tenant is properly deployed into the node. Then its just normal keylime config from the tenant, adding the node to the verifier with whatever config you want. Im not sure we have to go much further than this? |
Let's clarify what the outcome of this story should be: We want to measure specific binaries (e.g. immucore, kairos-agent) during boot and bind the unlocking of a PCR register (11?) to the measurement of those binaries. If they change, we want the keylime server to prevent booting by not letting PCR 11 unlock (thus the disks won't be decrypted). Probably this is only a matter of documentation. We can also ship the keylime agent by default (put it in the framework or do it here). Another scenario (probably needs a new ticket) is that we want to constantly monitor and measure specific binaries. If they change, keylime has the ability to send over a script and execute it on that node (or all other nodes) so that the tampered node is blacklisted. What that script actually does, depends on the cluster type. E.g. in Kubernetes it should somehow remove that node (how?), in edgevpn, rotate the token, in incus there is a remote management key that can be revoked etc. For this one we should also look at spiffe. |
we can do this but its a bit absurd. first, PCRs are not free as other things use them so using it ourselves to measure things onto them its ok, but it can lead to something else measuring in there and breaking our stuff. Second, for measuring the integrity of files and such IMA is in place I think, it just measures files every time they are accessed and you can create an allowlist and so on so it will refuse to run those commands if they dont match. Also, this is for uki or non-uki? because it seems like we are mixing things here. disk being decrypted by PCR measurements are a uki thing only. I think for UKI the PCR11 checks plus secureboot is more than enough and the way to go and expanding on that will come with time with pcrlock. For non-uki yes we are missing something that ties the system integrity to the disk unlocking, but Im not sure if IMA is good enough for this? For that, we would need to run the agent during initramfs, which means bundling the agent in there as well, as well as the configs and check that IMA measurements work on initramfs as expected? And then abort the initrd if they dont. But still to just measure our binaries, we have sha files already, we dont need keylime for something like that? We are shipping an immutable system, on the time of building we can bundle the sha files and on boot have them checked before running the binaries and abort if they dont match. Like Im not really seeing the advantage on doing just the measurements of our binaries, it should be the full system. But still, there is no Kairos features at play here unless we want to go really deep with the keylime integration. Keylime wors for linux distros, no matter what the underlying distro is, it has been proven to work under kairos, then the implementation details depend on the consumer no? Maybe we should have an specific meeting for this because I cant see anything that would require further kairos dev time for this. |
btw once ima is enabled, everything is measured:
So thats good and all but I have no idea how this fits in our usecase or how we can provide value on top of this. The only value I can see its providing an initramfs module or runner (part of immucore?) that enables the agent and the verification and blocks on boot, but I dont even know if this is possible. At least yoou need 1 correct boot so the tenant can communicate with the agent and validate the stuff and the verifier start verufying before being able to block the boot. |
We have discussed about this and it seems that keylime does not fit into the Kairos system specially on how we want to use it for. What we are looking for its to have attestation for the initramfs, in the case of non-uki, when using encrypted partitions. so the unlocking is not automatic but done based on some system measurements, as to not have a potentially modified system unlocking the encrypted partitions. we will follow up this on a card on trying to implement boot attestation for non-uki encrypted systems during initramfs (maybe use tpm2 to lock the key?) @bencorrado Not sure how this fits on your usecase or if you need more info about this. Im closing this to open the follow ups, but feel free to open new tickets with specific cases or uses that specifically Kairos could improve upon cheers! |
This is about integrating keylime into Kairos. Besides Marble that provides a Secure environment for the user-space ( tracked in #1257 ), this is to protect the system integrity by relying on Linux IMA mechanisms, for example.
Related to #2166
Acceptance criteria
The text was updated successfully, but these errors were encountered: