Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Amazon Verified Permissions実践入門 〜Cedar活用とAppSy...
Search
MURAKAMI Masahiko
October 11, 2025
Programming
490
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Amazon Verified Permissions実践入門 〜Cedar活用とAppSync導入事例/Practical Introduction to Amazon Verified Permissions
JAWS FESTA 2025 in Kanazawa
MURAKAMI Masahiko
October 11, 2025
More Decks by MURAKAMI Masahiko
See All by MURAKAMI Masahiko
AmplifyHostingConstructからSSRフレームワークのためのホスティング設計を考察する/amplify-hosting-construct
fossamagna
1
590
AWS Blocks を触ってみた/first-tach-aws-blocks
fossamagna
2
260
AWS Amplifyをもっと便利に使うための取り組み/amplify-tools-and-contributions
fossamagna
1
190
Amplify Gen2から知るAWS CDK Toolkit Libraryの使い方/How to use the AWS CDK Toolkit Library as known from Amplify Gen2
fossamagna
1
1k
AWS Amplify Gen2向けのVSCode拡張を作って公開してみた話/lts-techday-2024
fossamagna
0
82
CDKアプリとしてのAmplify Gen2 - @aws-amplify/backendのアーキテクチャにみるCDKベストプラクティス -
fossamagna
3
3.8k
Amplify Gen2の 新機能と実践的な使用例 AWS Amplify Gen 2 Festival in Japan/New features and practical use cases in Amplify Gen2
fossamagna
0
900
Amplify Gen2を 拡張してみよう JAWS-UG北陸新幹線 ( 福井開催 ) 2024-04-06/Let's extend Amplify Gen2
fossamagna
0
1.1k
みんな本当に AWS Amplify を知っている?/do-you-really-know-aws-amplify
fossamagna
0
220
Other Decks in Programming
See All in Programming
Rでドレミ/Do-Re-Mi_with_R
florets1
0
130
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
phperだってパンチカードでコーディングしたい
o0h
PRO
0
350
Agents on Rails - Rails at Scale 2026
irinanazarova
0
570
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
820
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
3
460
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
430
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
300
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
Featured
See All Featured
How to Ace a Technical Interview
jacobian
280
24k
So, you think you're a good person
axbom
PRO
2
2.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Building an army of robots
kneath
307
47k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Un-Boring Meetings
codingconduct
0
460
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
59k
Believing is Seeing
oripsolob
1
250
Art, The Web, and Tiny UX
lynnandtonic
304
22k
My Coaching Mixtape
mlcsv
0
360
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
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