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

Key rotation and trusting directives? #170

Open
ahupp opened this issue Oct 3, 2024 · 2 comments
Open

Key rotation and trusting directives? #170

ahupp opened this issue Oct 3, 2024 · 2 comments

Comments

@ahupp
Copy link

ahupp commented Oct 3, 2024

A trusting directive hard-codes a specific public key, which seems like it would make it hard to rotate those keys without brute-force trying every current version. Is there some mechanism for handling this?

@tarcieri
Copy link
Collaborator

tarcieri commented Oct 3, 2024

The typical KMS-style key rotation approach is to issue a new key, use that for new credentials, but keeping the old key valid for some time window which doesn’t immediately invalidate them.

Ideally you could make that expiration window longer than the credential validity period.

@divarvel
Copy link
Collaborator

divarvel commented Oct 4, 2024

Third-party blocks carry the public key that can be used to verify them, so the external signatures are only verified once, with the public key carried in the block. The trusting annotation then allow to select the third-party blocks based on their public key.

You can have several public keys in a trusting annotation, so you can have the old and new public keys in the annotation, and the third party block will be considered if either one matches.

So the rotation process would be:

  • generate a new key pair
  • expose its public keys so that it can be added to trusting annotations
  • start emitting third-party blocks signed with the private key

Since for third party-blocks, the block emitter and the users of trusting annotations are not the same entity, the validity period of public keys has to be longer than the validity of the token containing the trusting annotation, which can be ensured through TTL checks.

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

3 participants