Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amazon Verified Permissions実践入門 〜Cedar活用とAppSy...
Search
MURAKAMI Masahiko
October 11, 2025
Programming
2
260
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
JAWS FESTA 2025 in Kanazawa
MURAKAMI Masahiko
October 11, 2025
Tweet
Share
More Decks by MURAKAMI Masahiko
See All by MURAKAMI Masahiko
AWS Amplifyをもっと便利に使うための取り組み/amplify-tools-and-contributions
fossamagna
1
99
Amplify Gen2から知るAWS CDK Toolkit Libraryの使い方/How to use the AWS CDK Toolkit Library as known from Amplify Gen2
fossamagna
1
780
AWS Amplify Gen2向けのVSCode拡張を作って公開してみた話/lts-techday-2024
fossamagna
0
27
CDKアプリとしてのAmplify Gen2 - @aws-amplify/backendのアーキテクチャにみるCDKベストプラクティス -
fossamagna
3
3.5k
Amplify Gen2の 新機能と実践的な使用例 AWS Amplify Gen 2 Festival in Japan/New features and practical use cases in Amplify Gen2
fossamagna
0
790
Amplify Gen2を 拡張してみよう JAWS-UG北陸新幹線 ( 福井開催 ) 2024-04-06/Let's extend Amplify Gen2
fossamagna
0
950
みんな本当に AWS Amplify を知っている?/do-you-really-know-aws-amplify
fossamagna
0
170
Amplify OSSにコントリビュートしてAmplify Badgeを手に入れよう!/contribute-to-amplify-oss-and-get-an-amplify-badge
fossamagna
0
580
Using custom function template with AWS Amplify
fossamagna
1
550
Other Decks in Programming
See All in Programming
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
140
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
6
1.8k
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
Patterns of Patterns
denyspoltorak
0
1.4k
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
110
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
470
Vibe codingでおすすめの言語と開発手法
uyuki234
0
220
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
920
Darren the Foodie - Storyboard
khoart
PRO
2
2.3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
110
Fireside Chat
paigeccino
41
3.8k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
180
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2k
Mobile First: as difficult as doing things right
swwweet
225
10k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Transcript
Amazon Verified Permissions 実践入門 〜Cedar 活用と AppSync 導入事例〜 JAWS FESTA
2025 in Kanazawa 2025-10-11 株式会社永和システムマネジメント プリンシパルエンジニア 村上 雅彦 a.k.a @fossamagna Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 1
自己紹介 名前: 村上 雅彦 所属: 株式会社永和システムマネジメント コミュニティ活動: Amplify Japan User
Group 運営メンバ ー、AWS Community Builder (DevTools since 2022) X (Twitter): @fossamagna GitHub: @fossamagna Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 2
アジェンダ 1. 認可実装での課題と背景 2. Amazon Verified Permissions(AVP)/Cedar の基礎 3. Amplify
Gen2 / AppSync 概要 4. AVP を AppSync に統合する(Amplify Gen2 ベース) 5. Cedar ポリシーのテスト 6. まとめ Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 3
Amazon Verified Permissions を採用した背景 AWS Amplify 標準機能だけでは表現が難しく複雑な認可要件が発生 権限情報はアプリケーションのデータとして管理したい(属性ベースのアクセス制 御) アプリロジックと認可を分離して実装したい(AWS
Amplify が自動生成したコード も利用したい) Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 4
Amazon Verified Permissions(AVP) と Cedar AVP: Cedar ポリシーを評価するマネージドサービス Cedar: 読みやすいポリシー言語(permit/forbid、Principal/Action/Resource)
permit( principal in Group::"Viewrs", action == Action::"read", resource == File::"144887AF-402E-4BC3-897E-3A62F38CC8D7" ); 認可判定は IsAuthorized で問い合わせ、結果(allow/deny)が返ってくる Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 5
アプリのデータ構造 アプリのデータは Project, Folder, File がそれぞれ 1 対多の関係をもつ階層構造 ProjectMember で
Project に対するユーザーとそのロール( owner , contributor , viewer )、 FolderMember で Folder に対するユーザーとロールを管理する。 これらの権限は継承される Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 6
属性ベース(ABAC)のポリシー定義 principal.viewerProjects に含まれる Project 配下の Folder、または、 principal.viewerFolders に含まれる Folder に対して
Query.getFolder という アクションを許可するポリシー 権限に関する情報を Cedar 以外のストアで管理し、リソースへのきめ細やかな アクセスコントロールを必要とするため ABAC を採用 permit ( principal, action == Action::"Query.getFolder", resource ) when { resource in principal.viewerProjects || resource in principal.viewerFolders }; Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 7
AVP(IsAuthorized) のリクエスト ID: folder-123 の Folder リソースに対して Query.getFolder の操作を実行する fossamagna
というプリンシパルの承認を判断するためのリクエスト { "principal": { "entityType": "App::User", "entityId": "fossamagna" }, "action": { "actionType": "Action", "actionId": "Query.getFolder" }, "resource": { "entityType": "App::Folder", "entityId": "folder-123" }, "entities": { "entityList": [ { "identifier": { "entityType": "App::Folder", "entityId": "folder-123" }, "parents": [{ "entityType": "App::Project", "entityId": "project-123" }] }, ... { "identifier": { "entityType": "App::User", "entityId": "fossamagna" }, "attributes": { "viewerProjects": {"set":[{"entityIdentifier": { "entityType": "App::Project", "entityId": "project-123" }}]} } } ] }, "policyStoreId": "PSEXAMPLEabcdefg111111" } Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 8
AVP(IsAuthorized) のレスポンス decision の ALLOW / DENY で結果を判断 { "determiningPolicies":
[ { "PolicyId": "SPEXAMPLEabcdefg111111" } ], "decision": "ALLOW", "errors": [] } Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 9
AWS Amplify Gen2 / AppSync 概要 AWS Amplify Gen2: TypeScript
でインフラ/データ API を宣言、すぐに AppSync に デプロイして API を構築可能 AppSync: GraphQL API、パイプラインリゾルバーで任意の処理をパイプライン状 に繋げて実装できる(ビジネスロジックの前後に認可を挿入しやすい) データソース: DynamoDB / HTTP / Lambda / RDS など Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 10
AppSync のリゾルバーの 動作と認可処理の実装方針 AppSync は GraphQL リクエスト に対してフィールド毎に対応す るリゾルバーを呼び出す getFolder
-> Query.getFolder files -> Folder.files project -> Folder.project データモデル毎のリゾルバー、 それぞれで認可チェックが必要 Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 11
自動生成される Query.getFolder のパイプラインリゾルバー 1. Amplify(Cognito)の認証 2. DynamoDB からのデータ取得 Amazon Verified
Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 12
認可処理を追加した Query.getFolder のパイプラインリゾルバー 1. principalAttrsFn: AVP へのリクエストに含める Principal の属性情報を取得する関数 2.
isAuthorizedFn: AVP の IsAuthorized の HTTP API を呼び出す関数 Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 13
自動生成される Mutation.updateFolder のパイプラインリゾルバー 1. Amplify(Cognito)の認証 2. DynamoDB からのデータ取得(更新対象データの存在チェック) 3. DynamoDB
に対する対象データの更新処理 Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 14
認可処理を追加した Mutation.updateFolder の パイプラインリゾルバー 1. principalAttrsFn: AVP へのリクエストに含める Principal の属性情報を取得する関数
2. GetItemFn: AVP へのリクエストに含める Resource を取得する関数 3. isAuthorizedFn: AVP の IsAuthorized の HTTP API を呼び出す関数 Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 15
Cedar ポリシーの自動テスト @cedar-policy/cedar-wasm を利用して IsAuthorized が実行可能 vitest などと組み合わせて自動テストでポリシーのテストが可能 import {
test, expect } from "vitest"; import * as cedar from "@cedar-policy/cedar-wasm/nodejs"; test("FolderMemberにviewerで登録された場合、Query.getFolderの認可判定がALLOWになること", () => { const policies = new cedar.PolicySet(/* Cedar policy text */); const result = cedar.isAuthorized({ principal: { type: "User", id: "fossamagna" }, action: { type: "Action", id: "Query.getFolder" }, resource: { type: "Folder", id: "folder-123" }, entities: {...}, policies, }); expect(result.response.decision).toBe("allow"); }); Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 16
まとめ AVP/Cedar により 複雑なモデル・認可ルールに対応可能 AppSync パイプラインリゾルバーで認可処理を追加可能 DynamoDB データソース、HTTP データソースにより低遅延を実現 初期実装は
Lambda リゾルバー + AppSync API 呼び出しを利用したため性能 問題が発生 ポリシーとアプリロジックが分離されるので並行開発も可能 Cedar ポリシーをテスト自動化で品質を担保 認可処理が必要な場合には AVP を検討してみてください Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 17
参考資料 サンプルリポジトリ github.com/fossamagna/amplify-verified-permissions-examples このスライドの内容を実際に動かして確認可能 Amazon Verified Permissions ユーザーガイド Cedar policy
language AWS AppSync GraphQL デベロッパーガイド Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in Kanazawa 18
ご清聴、ありがとうございました! Amazon Verified Permissions 実践入門 〜Cedar活用とAppSync導入事例〜 JAWS FESTA 2025 in
Kanazawa 19