-
Notifications
You must be signed in to change notification settings - Fork 72
Try to load AK from disk instead of always creating a new one #293
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
Conversation
767a5bc to
e23f26a
Compare
Signed-off-by: Thore Sommer <mail@thson.de>
No because the Python agent already handles the EK and AK quite different compared to the rust agent. I think it does not make sense to rework the TPM handling in the Python agent unless strictly necessary. This is mostly a convince feature that the agent can reuse the AK between starts. |
Okay. I think it LGTM but it could help to have a bit more high-level context, just for posterity, about why this is a safe change. Is it related to this enhancement? |
|
This is a safe change because we don't have any lifetime guarantees on our AK, we just care about the attributes make it secure for signing quotes. An attacker could already implement this to reuse AKs. Reboot detection should be implemented using the clock data in the quote and not by changing the AK every time.
Yes it seems it is related to this enhancement. In the future this will allow agents to register only with an AK (that is for example verified by another third party to be trusted) and don't have to do make/activate credential every time during registration. |
|
Thanks @THS-on , that's good information to have. Especially that the data is encrypted. |
lkatalin
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.
This LGTM
This PR is build on top of #292 because the new algorithms module is used.
The agent now creates a persistent file called
tpmdata.jsonwhere it stores the context of the AK and the currently used algorithms. On startup the agent tries to load that file and to load the AK context. If that fails the agent just generates a new AK.This has the major advantage that the agent can be restarted without causing always and attestation failure.
We probably also could do that with the EK, but I do not see much value in doing that.
Related #235