Security Working Group meeting - Wednesday August 31 - results
First off, apologies if I am messing up the mailing list threading. I'm going to attempt to address questions raised by Patrick about keylime and openbmc in the last few days.
Quoted 1 line
Is the suggestion that they rewrite it in C++ and contribute that? If it is, why would they invest in building a project and community from scratch as opposed to using an existing one just because all the other in-tree servers are hyper-cost optimized?
No. To repeat what Thore Somers mentioned: the Red Hat team has done a good job of porting the keylime *agent* to Rust.
We will never attempt to cram Python into OpenBMC :)
The rust agent compiles and runs on the generic ARM version of OpenBMC; we have tested this, and Angelo Ruocco is working on a recipe. We are having difficulties with the AST2600 in particular, but that seems to be more of a Rust/ARM compilation issue than anything else. We are having zero troubles on a generic armv7 qemu emulator.
In reply to Michael Richardson -- the _entire_ keylime project is not being rewritten in rust; only the agent is. The verifiers and registrars and whatnot have no reason to exist on embedded systems, and there is no reason to make small footprint versions of them.
Quoted 5 lines
This is very concerning to me. There is no authentication?
Blindly advertising to the world which versions of firmware you are running so an attacker knows exactly which vulnerabilities you are likely to have doesn't sound appealing.
Valid concern. Agreed on not advertising firmware (or kernel) (or anything) versions to anyone who has no business knowing these things. Fortunately the keylime developers have considered these issues and over time have come up with a fairly safe architecture for establishing mutual trust between agents and other keylime components (like registrars and verifiers). The security architecture _has_ been peer reviewed and tweaked.
I am not going to attempt to reproduce the entire process here, but I'll mention salient points of it. First off, the keylime agent will not blindly talk to just anyone. The agent has to be configured a-priori with the IP address of a registrar, and it will not attempt to establish communication with any other entity.
Of course IP addresses can be spoofed, so the keylime agent possesses a certificate that will authenticate the registrar. The current implementation is an mTLS cert, but a server side certificate would suffice for this, as the entity being authenticated is the registrar, not the OpenBMC agent.
Next, of course, the agent has to authenticate itself to the registrar. The TPM device is a crypto engine with a key pair built into it for the express purpose of identifying itself (the Endorsement Key). The process of authenticating a TPM device to the registrar is fairly complex and involves a a roundtrip. In this process other (secondary) keys are created that are henceforth used for regular communication.
I'm going to stop here before this becomes a lecture. From a practical standpoint, getting the keylime agent into OpenBMC involves getting the agent built in the ecosystem, and inventing a way to configure the system. Since attestation with keylime can be done at _any point_ in the lifecycle of an OpenBMC deployment, it is sufficient for us to configure the keylime agent with redfish; and that is our plan. Details to follow.
A message that is not in the archive (sent off-list or not yet received): 101586.1662709990@dooku
Quoted 2 lines · Michael Richardson
Thank you for the post.
I'm interested in understanding how you will do provisioning of the TPM keys.
Hi Michael. I'm going to describe the standard keylime agent registration process in a bit more detail -- but not too much, or this will be a very long post indeed.
1. EK certificate.
What this is for: The EK certificate on each TPM is verifiable against the root CA of the manufacturer, which gives us confidence that the TPM is the genuine article and not a counterfeit.
Keylime makes the assumption that the TPM device's EK certificate is available on the device. While the EK certificate can be deleted from the TPM by the end user, devices [ought to] ship with it from the TPM manufacturer.
It is possible to use self-signed EK certificates for TPM devices. But that weakens the chain of trust provided by keylime, since it involves you -- the creator of said certs -- in the process, instead of using the likes of Infineon or Nuvoton for the purpose. We think it is *always* better to use the manufacturer's key if it is available, rather than create our own keys and headaches. Keylime comes with a pre-populated list of manufacturer certificates it will accept, and said list includes the most widely used manufacturers of TPM devices. FWIW our AST2600 EVBs have Nuvoton devices, whereas my Raspberry Pi has an Infineon Optiga :)
2. Public EK (endorsement key)
What this is for: This key defines the identity of the TPM device, and is used as such by keylime. It is signed by the EK certificate. To some degree of approximation this key pair is "burned into the device" -- not literally true, but can be re-generated at will from seeds that *are* burned into the device.
The keylime agent usually (re)generates the EK and sends the public part (the only part available to anyone outside the device) to the keylime registrar, together with the EK certificate. The registrar can then make a decision about whether the keylime agent has a genuine TPM device in possession, and whether the message coming from network address X and hostname Y really corresponds to the correct EK. This guards against say spoofing an entire node with keylime.
3. AK (attestation key)
What this is for: the attestation key is the key pair the TPM device will use for signing its reports ("quotes") when asked to do so by the keylime agent.
The attestation key is established and authenticated cooperatively between the TPM device, the keylime agent and the keylime registrar using a very careful choreography. The keylime agent must guard against someone spoofing the registrar (we use a pre-established server TLS cert for this purpose, much like your browser does when it decides to trust e.g. ibm.com). The keylime registrar decides whether to trust the keylime agent sending it the EK pubkey and certificate as described above.
I will not describe the roundtrip process to establish and activate the attestation key.
But *once this roundtrip is complete*, the TPM is "tied" to the keylime registrar and will be able to respond to quote requests in a manner that is not susceptible to MitM attacks ... which is the goal of the exercise.
That's it. There are additional keys used by keylime for the purpose of establishing direct connection between the agent and third parties (called "tenants"), but those keys do not involve the TPM device so I'm not going to describe them here.
-- George