-
Notifications
You must be signed in to change notification settings - Fork 70
attestation: Update kernel module and proxy for AES-GCM, other small changes #828
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
attestation: Update kernel module and proxy for AES-GCM, other small changes #828
Conversation
153960f to
d698d66
Compare
@tylerfanelli I took a quick look, and I also see some changes to the protocol used between SVSM and the proxy. We haven't made any stable releases yet, so it's fine, but we need to deal with this in the future. I think now is the time to add documentation/specifications for the protocol and finalize a version (if this is the final version). |
As a disclaimer, I haven't looked into the details of this PR yet, but just to avoid unnecessary work I'm writing it now: one thing which we very likely need from the protocol and which wasn't implemented the time I last checked is some sort of authentication for the received key material. Otherwise an adversary would be able to impersonate the KBS and make the SVSM to protect its persisted state with a secret he controls. Using authenticated encryption for the key material is definitely a step in that direction, but not sufficient. I think a full solution would be outside the scope of this PR though, and would personally leave the protocol finalization for some later PR. |
See the final commit (specifically this), which adds authentication to the received decryption key. This type of key is now required by SVSM.
With regards to this comment: Otherwise an adversary would be able to impersonate the KBS and make the SVSM to protect its persisted state with a secret he controls. The disk/filesystem should be encrypted before the VM is run, and should be done so on a trusted machine. That way, if there's any impersonation/tampering involved, it simply won't be able to unlock the disk without the correct key. Only the correct KBS would have access to the key. A bad actor could impersonate the KBS and give the wrong key, but that is simply a DoS, not a breach of any data. |
The changes are as follows:
They are generic.
I think this is much closer to the final version, with only one change remaining. I can add some documentation to this PR. |
2cab639 to
083213a
Compare
fd806cd to
bff36de
Compare
|
@stefano-garzarella To test, you can use the branch found in coconut-svsm/kbs-test#6. |
6de1666 to
2a0c494
Compare
@tylerfanelli thanks! BTW, can you post a changelog when you update the PR? It will help reviewers to understand the difference between versions. |
|
I tested this PR running: for kbs and svsm: Everything run smoothly. Please check this is the correct way of running it, if so what about adding it in the PR description? |
luigix25
left a comment
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.
aproxy/scr/main.rs:
/// Supported servers include:
/// kbs-test: https://github.com/tylerfanelli/kbs-test (for testing).
#[clap(long = "protocol")]
backend: backend::Protocol,
IIUC kbs-test has been replaced by kbs, also the repo url is now different.
6cdefbd to
24c1593
Compare
Thanks. I've opted to just remove that comment altogether, as I feel an explanation of supported protocols/servers belongs in the documentation instead. |
@luigix25 LGTM. I've added instructions to the PR description. |
stefano-garzarella
left a comment
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.
@tylerfanelli great, LGTM, I just left a minor comment in the documentation that differs from the cover letter of this PR, indeed following it, I'm able to test this correctly.
|
@tylerfanelli not for this PR, but I think will be nice to add Also, can we merge coconut-svsm/kbs-test#6 ? |
efcc0d1 to
20cdae2
Compare
Sure, I can add another PR to do so.
Yes, that can be merged alongside this PR. |
Instead of decoding data from base64 in the SVSM kernel, move this
responsibility to the attestation backend. This offers more flexibility
for attestation {de}serialization.
Signed-off-by: Tyler Fanelli <[email protected]>
The challenge is present in each negotiation phase and may need to be presented/used later on. Dedicate a struct member to specifically hold the challenge. Indicate a new NegotiationResponse param indicating to hash the challenge within the attestation evidence. Signed-off-by: Tyler Fanelli <[email protected]>
The attestation challenge used in the attestation evidence may need to be verified with the attestation server. Include it in the attestation request for inclusion in a server's appraisal of the evidence. Signed-off-by: Tyler Fanelli <[email protected]>
Standardize around ECDH-ES+256KW for receiving secrets from an attestation server. Modify libaproxy to support the fields needed for AES-GCM decryption of secrets. Also, since Trustee now uses ECDH-ES+256KW by default, update the kbs aproxy module to match what is expected by Trustee. Thus, this module is no longer a `kbs-test` module but explicitly follows the KBS protocol as expected by Trustee. Tested on a standard Trustee build with default resource backend. Signed-off-by: Tyler Fanelli <[email protected]>
Based off the underlying TEE architecture, evidence will be retrieved and submitted differently. Define a standard per-TEE architecture evidence format that SVSM will follow to send evidence to the proxy. Signed-off-by: Tyler Fanelli <[email protected]>
Attestation servers may return a token artifact containing the claims they've attested for the client. This may of use later to an SVSM client in order to verify attestation. Return this token to SVSM if it is available. Signed-off-by: Tyler Fanelli <[email protected]>
Instead of representing the attestation API as a string, enforce the data model that is expected from semver versioning. The API version is now represented as a tuple: (u32, u32, u32) Corresponding to the respective semver identifier: (MAJOR, MINOR, PATCH). Signed-off-by: Tyler Fanelli <[email protected]>
Transparently {de}serialize each byte array parameter to/from base64 to
allow for compression of binary data.
Signed-off-by: Tyler Fanelli <[email protected]>
Document the attestation protocol between SVSM and the proxy to illustrate the purpose of each step in the process. Signed-off-by: Tyler Fanelli <[email protected]>
20cdae2 to
08d748f
Compare
|
@stefano-garzarella there was a conflict in |
This PR updates the attestation kernel module and proxy with two main modifications:
The
kbs-testserver was also updated to emulate KBS 0.4.0 and thus can be used to test this series.cc/ @stefano-garzarella @nicstange @berrange
Try for yourself
Start
kbs-testStart the attestation proxy
Run SVSM with attestation