macaroons - dcache · 2018-08-15 · macaroons “cheat-sheet” macaroon is a bearer token....

25
Macaroons Paul Millar (on behalf of the dCache team) CHEP 2018 at Sophia, Bulgaria; 2018-07-09 https://indico.cern.ch/event/587955/

Upload: others

Post on 04-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Macaroons

Paul Millar(on behalf of the dCache team)

CHEP 2018 at Sophia, Bulgaria; 2018-07-09https://indico.cern.ch/event/587955/

Page 2: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Macaroons “cheat-sheet”● Macaroon is a bearer token.● Macaroon contains zero or more caveats.● Each caveat limits something about the macaroon:

who can use it,

when they can use it, or

what they do with it.

● Anyone can add a caveat to a macaroon

… creating a new, more limited macaroon.

● No one can remove a caveat from a macaroon

Page 3: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Bearer Tokens

Photo by Alan Cleaver (CC-BY)

Page 4: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

How caveats work?

Storage System

Data Portal

Diagram idea stolen from Tigran

Page 5: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

How caveats work?

Storage System

Data Portal

Diagram idea stolen from Tigran

Page 6: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

How caveats work?

Storage System

Data Portal

Diagram idea stolen from Tigran

Page 7: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

How caveats work?

Storage System

Data Portal

Diagram idea stolen from Tigran

Page 8: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

How caveats work?

Storage System

Data Portal

Diagram idea stolen from Tigran

Page 9: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

How caveats work?

Storage System

Data Portal

{DOWNLOAD,UPLOAD}

{+path:/data}{+read-only}

{+path:/data/img.jpg,ip:1.2.3.4}

Diagram idea stolen from Tigran

Page 10: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Six caveats supported● Unfortunately, there are no standard caveats. Here are those that dCache

understands:● Three path caveats:

● root:<path> – chroot into this directory,● home:<path> – the user's home directory (not currently used),● path:<path> – only show this path.

● Two context caveats:● before:<timestamp> – when macaroon expires,● ip:<netmask list> – reduce which clients can use macaroon.

● One permissions caveat:● activity:<comma-list> – what operations are allowed.

Page 11: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

d1

d2

How path caveats affect namespace

/foo

barcalib

baz

b2

data

mc

d1

d2

barcalib

baz

b2

/

mc

/

calibbaz

b2

data

Adding caveatroot:/data

Adding caveatpath:/data/calib

Page 12: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Activity caveats – limited what is allowedactivity:<activity-list>

where <activity-list> is a comma-separated list of allowed activities; e.g.,

activity:DOWNLOAD,LIST

● Possible activities are:

DOWNLOAD, UPLOAD, DELETE, MANAGE, LIST, READ_METADATA, UPDATE_METADATA.

● Allowed activity may be further reduced by adding more activity: caveats.

No activity: caveat means client can do whatever the user requesting the macaroon can do.

Page 13: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Community Portals

GET

307

GET

4. Request data directly from dCache

2. Request a macaroon

User Database

3. Add caveats

What are macaroons good for?

Page 14: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

What are macaroons good for?

Delegating/Sharing

3. Send to colleague(e.g. via email)

1. Request a macaroon

GET/PUT/DELETE

4. Use macaroon

2. Add caveats

Page 15: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

FTS

What are macaroons good for?

HTTP 3rd party copies (FTS creates macaroon)

2. Request amacaroon

3. Add caveats

4. COPY with embedded macaroon

5. GET with macaroon

1. Request copy

Page 16: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

FTS

What are macaroons good for?

HTTP 3rd party copies (user creates macaroons)

1. Requestmacaroons

4. GET with macaroon

3. COPY request

2. Requestcopy

1. Requestmacaroons

DATA

Page 17: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

What are macaroons good for?

Enforcing catalogue permissions

Rucio1. Request accessto data

2. Request a macaroon3. Add caveats

4. Access data

Page 18: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Usage of Macaroons● Nothing yet in production, but …● SurfSARA have multiple projects exploring macaroons:

● As dataset export for LOFAR (currently separate server)● Project MinE: outsource authz decision to UMCU (university medical

center Utrecht)● Sharing data without moving it from dCache to ownCloud● Delegated access to storage; i.e., jobs without X.509 proxy.

● SWESTORE – the portal use-case: avoid proxying data transfers.

Page 19: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Current macaroon support in storage systems● dCache fully supported since v3.2

available in all supported versions of dCache

● DPM experimental support in v1.10

currently not recommended in production

● xrootd coming soon (“this year”)

code currently being accepted upstream

● EOS not yet, but would add if there’s demand

would use the xrootd plugin – can investigate once plugin finalised.

● StoRM plans to add bearer token authn

Initial work focusing on JWT

Page 20: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

What’s coming next?● New features (in dCache) …

● ability to cancel subset of macaroons.● client identifier caveat.● ability to request macaroon outside of WebDAV.● support in more protocols (dcap, ftp, …).

● Work with dCache sites to gain experience.● Explore WLCG use-cases:

HTTP 3rd party transfer, …

Page 21: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Summary

● Macaroons provide a solution for delegated authorisation.● Autonomous attenuation means macaroons scale.● Macaroons have many potential uses.● Sites are now exploring how to use macaroons.● Other storage systems are exploring macaroons.

Page 22: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Thanks for listening!

Page 23: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Backup slides

Page 24: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

Aren't these like SciTokens?

Page 25: Macaroons - dCache · 2018-08-15 · Macaroons “cheat-sheet” Macaroon is a bearer token. Macaroon contains zero or more caveats. Each caveat limits something about the macaroon:

SciTokens vs macaroons: comparison cheat-sheet

● Who issues them?

(SciToken: “central” service, macaroon: service)● How expensive to generate?

(SciToken: a few Hz, macaroon: a few kHz)● Autonomous reduced token?

(SciToken: no, macaroon: yes)