Skip to content
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

age-plugin-tpm requires access to the TPM when encrypting #28

Open
nbraud opened this issue Dec 27, 2024 · 3 comments
Open

age-plugin-tpm requires access to the TPM when encrypting #28

nbraud opened this issue Dec 27, 2024 · 3 comments

Comments

@nbraud
Copy link

nbraud commented Dec 27, 2024

As far as I understand (from reading the source, as well as having worked with TPM 2.0 itself) the plugin generates identities as TPM-bound NIST P-256 keys, used with ECDH to wrap the age session key.

Assuming this is the case, encrypting to a TPM recipient should only require knowledge of that P-256 point/pubkey, yet age-plugin-tpm attempts to access /dev/tpmrm0 and fails if permission is denied. This is an issue in my usecase in two different ways:

  • I'm managing secrets in a distributed environment, so encryption might be done on a system which does not have access to the recipient's TPM, or any TPM at all ;
  • unprivileged users should be able to introduce new secrets (i.e. encrypt) without being granted decryption privileges, let alone full access to the TPM device.
@nbraud nbraud changed the title age-plugin-tpm requires access to the TPM when encrypting a secret age-plugin-tpm requires access to the TPM when encrypting Dec 27, 2024
@Foxboron
Copy link
Owner

I'm aware of this issue and mostly just waiting on this to be standardized and implemented in age.

C2SP/C2SP#96

If you want to implement the encryption inside the plugin without a TPM feel free to send patches :)

@nbraud
Copy link
Author

nbraud commented Dec 27, 2024

Thanks for the swift reply <3

I didn't know about the proposed p256tag keytype, but I agree waiting for upstream to adopt it might be the best solution long-term. There doesn't seem to be much activity on that PR, but hopefully it can happen soon.

@Foxboron
Copy link
Owner

There doesn't seem to be much activity on that PR, but hopefully it can happen soon.

Filippo will work on this at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants