biscuit-auth / biscuit

delegated, decentralized, capabilities based authorization token
Apache License 2.0
949 stars 26 forks source link

Public key signature constraint #35

Open Geal opened 4 years ago

Geal commented 4 years ago

To implement use cases such as third party caveats, or using a biscuit token as attestation accumulating acknowledgement from multiple parties, caveats should be able to verify a public key signature.

A few questions here:

Signature verification would work well as a constraint affecting 3 elements (message, key, signature) that could be filled in various ways:

Geal commented 4 years ago

thinking a bit more about it now, it might be smarter to let the verifier's side handle that, ie patterns like this:

titanous commented 4 years ago

Currently the algorithms I'd like support for are:

It would also be neat to support U2F/WebAuthN assertions (a P-256 ECDSA signature over a specific data structure).

Geal commented 4 years ago

with https://github.com/CleverCloud/biscuit/issues/40 there will be a way to represent keys, so now we can think more about how to represent it. A key point in implementing it is that a verifier can do queries before checking the caveats. So the idea would be to have the verifier query for any signatures to check, then we create facts to represent a valid signature, and the token has caveats to check those signatures. I think it's better to provide the pattern as a kind of "cookbook" instead of integrated inside Biscuit's basic API, since it is unlikely to match all use cases.

Facts needed for the query:

Queries from the verifier:

Caveats in the token:

The verifier will then check the caveats and the token will succeed if the required signatures are here.

@titanous what do you think?

titanous commented 4 years ago

This all makes a lot of sense! The main thing I'm thinking about is how the data to be signed will be formatted. I'm going to drop some notes below.

titanous commented 4 years ago

@daeMOn63 has implemented an experimental proof of possession scheme here: https://github.com/flynn/biscuit-go/blob/master/experiments/pop_test.go

divarvel commented 1 year ago

Are these use-cases covered by the third-party blocks? They allow to handle signatures / verifications outside of datalog, avoiding a lot of issues related to exposing crypto primitives from within datalog.