-
Notifications
You must be signed in to change notification settings - Fork 30
Description
At the moment, both specifications are unopinionated about how a consumer of biscuits should determine the public key used to encrypt a biscuit. The bwks specification goes some way to help solve that but limits itself with "Deciding which domain name to trust for a given token is still the responsibility of the relying party and has to happen out-of-band."
We are looking at building a series of micro-services that can pass around biscuits for consistent authorization. To handle that, there is a single source of truth for identity management, authentication and authorization.
Further down our roadmap, we envisage the possibility of whiteboxing this code, allowing customers to have the services labelled with their own identity and connected to their own URLs. That then means that a customer's version of the services would have its own "single source of truth". Not the end of the world - just configure the micro-services to pick up the bwks file from a URL tailored to that customer.
But what happens if we continue to have other micro-services that the whiteboxed platform consumes or interacts with? Then we're faced with the very real challenge of how our micro-services can determine who signed that biscuit.
And so to my suggestion...
- A small change to the biscuit schema:
message Biscuit {
optional uint32 rootKeyId = 1;
required SignedBlock authority = 2;
repeated SignedBlock blocks = 3;
required Proof proof = 4;
optional string domain = 5;
}
The optional domain string specifies the URL domain for the location of the bwks file, e.g. example.org
- A variant of the existing function to create an authorizer. Instead of passing the known public key, we pass an array/list of acceptable domains. The function starts by checking that (a) there is a domain string in the biscuit and (b) that domain is in the list of acceptable domains. If those checks pass, the function attempts to retrieve the bwks from the specified domain. It then uses
rootKeyIdto retrieve the public key. Execution then continues as normal.
This suggestion is an extension to how things work today. I don't forsee any breaking changes to existing client code since this would be an optional alternative to the existing authorizing mechanism.
If it is undesirable to change the biscuit schema, an alternative would be to store a domain fact in the biscuit block and the bwks authorizer could look for that fact.
While this approach does make things a bit more opinionated (for example, there would need to be agreement that the protocol is HTTPS and that the bwks file lives at a known fixed location in the specified domain), making that specification avoids the problem of wheels being reinvented everytime someone wants to use biscuits and has to fill in the gaps.