タラバガニー設計局stalins.clubNOTE/notes/attenuable-authorization-credentials

Macaroons / Biscuit は権限を持ち運び、途中で弱められる

認可結果を server-local な bool で終わらせず、request と一緒に運べる authorization credential として表す系譜もある。Macaroons と Biscuit が代表例である。

Macaroons は 2014 年に提案された decentralized authorization credential で、bearer credential 自体へ caveat を追加することで、いつ・どこで・誰が・何の目的で使えるかを狭められる。重要なのは、credential の holder が元の authority を増やさずに attenuation(権限の縮小) を行える点である。

Biscuit はこの方向を public-key verification と Datalog-based authorization language で発展させた token specification である。公式仕様では最初の authority block が holder に与えられた rights を含み、後続 block に check を追加することで token の scope を狭める。holder は既存 block を削除できないため、新しい token は元より強い権限にはならない。

broad credential
   ↓ add caveat/check
narrower credential
   ↓ add caveat/check
still narrower credential

Biscuit 自身も capability-based authorization を明示的な goal とし、identity に紐づく万能 credential ではなく request に関係する rights を token に運ばせる用途を想定している。

これは Object-Capability は authority を参照の到達可能性で表す と同じ「capability」という語を使うが、表現媒体が異なる。object-capability では authority は unforgeable object reference の保持・到達可能性に結び付く。一方 Macaroons/Biscuit は、distributed system を跨いで運べる cryptographic credential/token として authority を表現する。

また Proof-Carrying Authorization は認可結果ではなく証明を持ち運ぶ とも似て非なる。PCA は policy から request が許可されることを示す proof を運ぶのに対し、Macaroons/Biscuit は credential 自体に権利や制約を持たせる。

Web application 内部で 「認可済みリソース型」は既存研究の直訳ではなく設計上の合成 を使う場合には、こうした token を検証した後に wrapper を生成する構成は可能だが、それは Biscuit/Macaroons が直接規定する API pattern ではない。

出典

▸ ノート一覧に戻る