Repository navigation
Conversation
Motivation: A leaked macaroon currently cannot be revoked; the only remedy is rotating the (site-wide) macaroon secret, which invalidates every macaroon issued with it. Modification: Add MacaroonRevocationList: a Zookeeper-backed list of revoked macaroons, mirrored in memory so that no Zookeeper call is made on the request path. Entries are keyed on the macaroon's final signature and are pruned once they are older than the maximum macaroon lifetime. The check is applied in AuthenticationFilter when the bearer token is parsed, before the door's login cache, so that revocation takes effect immediately; MacaroonProcessor. expandMacaroon repeats the check as defence in depth. Admin shell commands revoke, restore and revoked are provided on the door cell. Result: An administrator can revoke (and restore) an individual macaroon by pasting the token; all doors reject a revoked macaroon immediately. Target: master Require-notes: yes Require-book: yes Signed-off-by: Arpad Miskolczi <a.miskolczi@fz.juelich.de>
|
@amisk Thanks for the contribution. I think the revocation flow is wrong. It uses the macaroon's signature. However, anyone holding a macaroon can add a caveat offline, which changes the signature. Thus, only the original macaroon is revoked, but all derived macaroons stay valid. If it's ok with you, I will steal some ideas from your approach and integrate them into the solution that I am working on. |
Sure, go ahead. Happy to contribute :) |
Motivation:
A leaked macaroon currently cannot be revoked; the only remedy is
rotating the (site-wide) macaroon secret, which invalidates every
macaroon issued with it. Fixes #5339.
Modification:
Add MacaroonRevocationList: a Zookeeper-backed list of revoked
macaroons, mirrored in memory so that no Zookeeper call is made on
the request path. Entries are keyed on the macaroon's final
signature and are pruned once they are older than the maximum
macaroon lifetime. The check is applied in AuthenticationFilter
when the bearer token is parsed, before the door's login cache, so
that revocation takes effect immediately; MacaroonProcessor.
expandMacaroon repeats the check as defence in depth. Admin shell
commands revoke, restore and revoked are provided on the door cell.
Result:
An administrator can revoke (and restore) an individual macaroon by
pasting the token; all doors reject a revoked macaroon immediately.