Skip to content

macaroons: allow a user to revoke a macaroon - #8326

Open
amisk wants to merge 1 commit into
dCache:masterfrom
amisk:issue5339_2
Open

amisk wants to merge 1 commit into
dCache:masterfrom
amisk:issue5339_2

Conversation

@amisk

@amisk amisk commented Nov 25, 2026

Copy link
Copy Markdown

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.

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>
@kofemann

Copy link
Copy Markdown
Member

@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.

@amisk

amisk commented Nov 26, 2026

Copy link
Copy Markdown
Author

@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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow user to revoke a macaroon

2 participants