Commit Graph

143 Commits

Author SHA1 Message Date
Geoffroy Couprie
d91e055156 new cryptographic scheme 2021-09-03 18:37:09 +02:00
Geoffroy Couprie
7bd158a3ed JSON testcases results and rewrite of testcases README 2021-09-01 17:27:36 +02:00
Geoffroy Couprie
5e7e01a744 Add samples and advisories for vulnerabilities 0 and 1 2021-05-06 17:36:17 +02:00
Geoffroy Couprie
dc01631bfe show the facts generated by the rule execution 2021-05-06 17:19:02 +02:00
Geoffroy Couprie
840ff1d187 remove duplicate check 2021-05-06 17:18:15 +02:00
Geoffroy Couprie
464ef26d68 audit mentions 2021-04-16 09:41:34 +02:00
Geoffroy Couprie
245ab9e974 merge 1.0 2021-03-11 10:07:08 +01:00
Geoffroy Couprie
822a89eee2
Merge pull request #65 from adeinega/patch-1
Minor typos
2021-03-11 10:03:06 +01:00
Geoffroy Couprie
f3785126d7 add a format to transport verifier state
there are two use cases for this:
- quickly loading verifier policies from a serialized state instead of
manually adding datalog elements one by one through the verifier API.
The policies could even be written in a different system then published
to running instances dynamically
- save the state of a verifier, including ambient data, facts, rules and
checks coming from a token, to later load it into another verifier and inspect
it
2021-03-04 14:21:06 +01:00
adeinega
8298b2fe10
Mnr typos 2021-03-03 15:08:28 -08:00
Geoffroy Couprie
e272bdd08b missing schema update 2021-02-26 17:55:27 +01:00
Geoffroy Couprie
1c09f36934 add more expression operations
add a sample executing them
2021-02-26 17:47:03 +01:00
Geoffroy Couprie
47c6051467 add a warning for hash generation with similar data 2021-02-26 11:31:01 +01:00
Geoffroy Couprie
236f50ffab update the README 2021-02-26 11:05:55 +01:00
Geoffroy Couprie
bf3f7b26d7 add revocation ids to the specification
we generate unique revocation ids for each block of the token, that also
depend on the previous block. That way, when holding a token, we also
have valid revocation ids for each of its parent tokens.

Since they are generated from hashes of the token's data, revocation can
be added to an existing system even after tokens were created
2021-02-26 10:46:27 +01:00
Geoffroy Couprie
47fd71a1eb update the summary to version 1.0 2021-02-16 17:02:22 +01:00
Geoffroy Couprie
b56ee71290 add a warning to DESIGN.md 2021-02-16 16:20:47 +01:00
Geoffroy Couprie
c32e567777 more info about versioning 2021-02-16 16:13:27 +01:00
Geoffroy Couprie
6be17b92d8 add more info to the spec 2021-02-16 15:27:33 +01:00
Geoffroy Couprie
705c840fd6
Merge pull request #64 from agueganno/fix-some-typos
chore: fix some typo and markdown formatting problems
2021-02-16 10:19:36 +01:00
Alexis Guéganno
7aafe71893 chore: fix some typo and markdown formatting problems 2021-02-12 16:59:14 +01:00
Geoffroy Couprie
dda2bc15a9 fix testcase generation 2021-01-28 10:53:08 +01:00
Geoffroy Couprie
01ea43fa9b method syntax for set and string expressions
this commit introduces a method-like syntax for these operations:
- .starts_with()
- .ends_with()
- .matches()
- .contains() (replacing the In operation)

There is no satisfying name to replace the "not in" operation, so it is
replaced by a "contains" and negation, like this: "!set.contains($var)".
The NotIn operation is removed from the V1 schema
2021-01-26 14:41:15 +01:00
Geoffroy Couprie
fedca762f9 support parenthesis in expressions
it needs to be suported in the bytecode, to let us print the expressions
properly
2021-01-26 10:52:39 +01:00
Geoffroy Couprie
fea8c3327f rename caveat to check, introduce allow/deny policies and new syntax
the meaning of "caveat" was not clear enough for users (outside of those
already familiar with macaroons), while "check" is more obvious: in a
"checklist", all items must be validated.

Allow and deny policies can be added only in the verifier (not in
tokens so there's no format change here). They use rules under the hood
like checks, and are tested one by one until one of them matches.
A default policy should be added to the verifier, otherwise it will
return the NoMatchingPolicy error. To keep the current behaviour of
accepting the request once all checks have been validated, we use the
default policy "allow if true", that only contains the expression
"true".

At last, we introduce a new syntax for checks and policies:

caveat1($0) <- resource(#ambient, $0), operation(#ambient, #read), right(#authority, $0, #read)

is rewritten as:

check if resource(#ambient, $0), operation(#ambient, #read), right(#authority, $0, #read)

Similarly, allow and deny policies use "allow if" and "deny if"
prefixes. If a check contains multiple rules, they are separated with
"or". All of those keywords are case insensitive.
2021-01-25 16:50:15 +01:00
Geoffroy Couprie
ec99146e46 replace constraints with expressions
Expressions are a superset of constraints, they can support multiple
variables, and other operations like additions
2021-01-22 16:00:19 +01:00
Geoffroy Couprie
f5169d225f add the set type 2021-01-08 16:43:35 +01:00
Geoffroy Couprie
0954e32224 add boolean type 2021-01-08 15:30:13 +01:00
Geoffroy Couprie
0ec07df89d use oneof in the Protobuf schema
this simplifies the format, using oneof instead of a 'Kind' enum with
optional fields. Additionally, it reduces token size
2021-01-06 11:23:15 +01:00
Geoffroy Couprie
456549d82a rename integer constraints 2021-01-05 15:50:14 +01:00
Geoffroy Couprie
51862ad460 duplicate messages for v1
currently the messages have the same structure as v0, but they will
change significantly
2021-01-05 15:02:44 +01:00
Geoffroy Couprie
43e975e680 version field in block format
this changes the Protobuf format to add a version field to blocks, set
to 0 for now. This change will ship in the 0.9 version of the Rust
version.

When deserializing a token, we wil check the version field. if not
present, we assume the block is at version 0. A token can contain blocks
with different versions, so a token generated by an old library can be
attenuated by a newer one.

If the version is higher than the maximum one for the library, the token
will be rejected
2021-01-04 16:22:26 +01:00
Geoffroy Couprie
1ec7d234b4 move token samples to the v0 subdirectory
the implementations of Biscuit 1.0 should try to maintain compatibility
with older versions, so tokens with the first format will be kept there
to test that compatibility
2021-01-04 15:40:53 +01:00
Geoffroy Couprie
cc6d55e0bd remove the * from rule heads
this made the syntax confusing
2020-12-22 10:31:21 +01:00
Geoffroy Couprie
617cfce6a3 the verifier printer now orders elements and shows verifier caveats 2020-12-21 10:34:51 +01:00
Geoffroy Couprie
bfcdd6ae12
Merge pull request #49 from divarvel/patch-1
Typo fixes & clarity improvements
2020-12-12 16:04:02 +01:00
Clement Delafargue
275f6195b5 Describe block contents 2020-11-23 15:12:40 +01:00
Clément Delafargue
08abf98de2 Typo fixes & clarity improvements
Along with typo fixes, I tried to add explanations everywhere i found things hard to understand
2020-11-20 15:20:10 +01:00
Geoffroy Couprie
20325d29cd typos 2020-11-20 10:07:32 +01:00
Geoffroy Couprie
4dc8a3a8aa use variable names 2020-11-19 18:19:01 +01:00
Geoffroy Couprie
828f4c3879 the text representation now allows variable names
having only numbers as variable names was not making rules easy to
follow. Thanks to the symbol table, we have a mechanism to convert
between a string and a number, so we can use it to convert from a name
to an id when adding to the token, but also when printing it, so the
rule would be read the same way on both ends.

Since we're only adding more entries to the symbol table, and integer
ids are still used, tokens generated with the new variable names should
be usable directly with older implementations
2020-11-19 12:27:52 +01:00
Geoffroy Couprie
c5ac1e2418 more explanation 2020-11-17 22:13:31 +01:00
Geoffroy Couprie
11a104a2eb still in development, but it's ready now 2020-11-17 16:23:21 +01:00
Geoffroy Couprie
e178eb5a20 add a summary document to explain Biscuit from a user's perspective 2020-11-17 16:23:15 +01:00
Geoffroy Couprie
5dc4ae8196
Update README.md 2020-10-28 11:47:31 +01:00
Geoffroy Couprie
cda8de5bf5
Merge pull request #43 from CleverCloud/byte-array
Add the byte array type
2020-09-11 17:53:29 +02:00
Geoffroy Couprie
1529a2e5df Add the byte array type
this will be useful to transport arbitrary data in the token without
encoding it in base 64
2020-09-11 16:53:57 +02:00
Geoffroy Couprie
90df050551 a Caveat can now contain multiple rules
This allows us to implement "OR" for caveats: one of the provided rules
has to succeed
2020-09-11 16:52:55 +02:00
Geoffroy Couprie
556f7d83b6
update the text format 2020-08-19 17:54:37 +02:00
Geoffroy Couprie
243c16b8ac update fact text formatting 2020-08-19 17:47:07 +02:00