Skip to content

How should authorizers handle key rotation? #150

Closed
@seh

Description

@seh

Say that I have a root private key that I've been using for a while, and now I wish to rotate it, replacing it with a different key that I'll use to sign root blocks. Ideally I'd be able to create that key, and distribute its corresponding public key for use in my authorizers early, getting them ready to start receiving and trusting tokens signed with the new public key. After all of my authorizers have that new public key in use, I'd then be able to swap the root private and start signing token blocks with it.

As it stands today, though, the (*Biscuit).Authorizer method accepts only a single ed25519.PublicKey parameter. That method will return ErrInvalidSignature if any of the blocks in the token aren't signed correctly, but it's hard to tell if it we may have used the wrong root public key, or whether we have the correct root public key, but one of the other blocks in the token suffered tampering.

Have you considered accepting more than one root public key in this method, or in a newly introduced method to sit alongside it? By analogy, within the age library, the age.Decrypt function accepts one or more "identities"—private keys—with which to try to decrypt the file. (The variadic parameter in the signature tolerates a caller supplying zero identities, but the function panics at run time if there aren't any identities available to use.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions