Bring your own Identity (BYOI) with OIDC and Amazon Verified Permissions | Amazon Web Services

Amazon Web Services
7 Jun 202413:41

Summary

TLDRアレクシー・イアーノがデモンストレーションする新機能は、Amazon Verified Permissionsを利用して、オープンID Connectのアイデンティティプロバイダーを簡単に使用できるようになりました。このサービスは、API GatewayでホストされているAPIへのユーザーアクセスを認証・認可する際に、アプリケーション固有の認可システムを構築することなく、細かい権限を実装できる「認可サービス」となっており、銀行アプリケーションなどでも利用されています。また、クイックスタートウィザードが提供され、API Gatewayのリソースに自動的にポリシーを適用するなど、手軽なセットアップが可能となっています。

Takeaways

  • 🔒 Amazon Verified Permissionsは、API GatewayでホストされているAPIに対するユーザーアクセスを認証・認可する新しい機能です。
  • 🛠️ これは「認可サービス」と位置づけられ、独自の認可システムを構築する代わりに、アプリケーションに細かい権限を追加することができます。
  • 🏦 銀行アプリケーションなどでは、ユーザーがお金を引き出すたびにAmazon Verified Permissionsを呼び出し、そのアクションが許可されているかを確認します。
  • 📈 エンドツーエンドのアーキテクチャフローでは、OpenID Connectプロバイダーを使用してアプリケーションを展開し、ユーザーがログインするとカスタムトークンが生成されます。
  • 🔑 API Gatewayはポリシー実施ポイントとして機能し、リクエストを停止してカスタムのLamdba関数を実行し、Verified Permissionsに承認の問い合わせを行います。
  • 🚀 Verified Permissionsのクイックスタート機能は、ステップバイステップのウィザードを提供し、API Gatewayのリソースに自動的にポリシーを適用します。
  • 🔄 新しいポリシーストアを作成する際には、外部のOpenID Connectプロバイダーを選択し、詳細をAmazon Verified Permissionsに提供します。
  • 🗄️ ポリシーストアにはポリシーとスキーマが含まれており、Lambda関数がリクエストを認証するためのリソースとして割り当てられます。
  • 🔄 OpenID Connect IDプロバイダーを事前設定し、ユーザーとグループを作成し、ユーザーにグループを割り当てます。
  • 📝 OpenID Connectの設定により、OpenID Connectプロバイダーと連携するために必要な値を特定し、API Gateway APIを作成し、ステージを展開します。
  • 📊 テストでは、API GatewayのURLを使用して、管理者ユーザーとユーザーグループのユーザーがそれぞれ異なるアクセスレベルを持つことを確認します。

Q & A

  • アマゾン・ベリファイド・パーミッションとは何ですか?

    -アマゾン・ベリファイド・パーミッションは、API Gateway上でホストされているAPIへのユーザーアクセスを認証・認可するためのサービスです。これは、独自の認証システムを構築する代わりに、アプリケーションに細かいパーミッションを追加できる「認可サービス」と言えます。

  • アマゾン・ベリファイド・パーミッションが提供する主な利点は何ですか?

    -アマゾン・ベリファイド・パーミッションは、開発者がAPI Gatewayにアクセス権限を細かく設定できるようにし、アプリケーション固有の認可システムを構築する必要なく、一貫性をもった認可を実装できる利点を提供します。

  • アマゾン・ベリファイド・パーミッションはどのようにAPI Gatewayと連携するか説明してください。

    -API Gatewayはリクエストを停止し、カスタムのLamdba関数を実行します。このLambda関数は、アマゾン・ベリファイド・パーミッションに認可の判断を依頼します。その後、許可または拒否の決定がAPI Gatewayに返され、適切なアクションが実行されます。

  • アマゾン・ベリファイド・パーミッションのクイックスタートウィザードとは何ですか?

    -クイックスタートウィザードは、ステップバイステップのガイドで、API Gatewayのリソースに自動的にアマゾン・ベリファイド・パーミッションのポリシーを適用するプロセスを案内します。

  • アマゾン・ベリファイド・パーミッションで使用されるポリシーストアとは何ですか?

    -ポリシーストアは、アマゾン・ベリファイド・パーミッションによって使用され、ユーザーグループとそれらが実行できるアクションを定義するポリシーを含むものです。

  • アマゾン・ベリファイド・パーミッションでOpenID Connectプロバイダーを設定するにはどうすればよいですか?

    -OpenID Connectプロバイダーを設定するには、まずプロバイダーの詳細をアマゾン・ベリファイド・パーミッションに提供し、必要なAPIとステージを選択します。その後、ポリシーストアのスキーマとユーザーグループに関連するアクションを定義します。

  • アマゾンAPI GatewayのAPIを保護するために必要なステップは何ですか?

    -まず、OpenID Connectプロバイダーを設定し、API GatewayのAPIを作成し、新しいステージをデプロイします。次に、アマゾン・ベリファイド・パーミッションでポリシーストアを作成し、Lambda関数をAPIに割り当てます。

  • アマゾン・ベリファイド・パーミッションでユーザーグループとそのアクセス権を設定する方法を教えてください。

    -ユーザーグループとアクセス権は、ポリシーストア内で定義されます。各グループに対して、実行できるAPIアクションを指定します。たとえば、管理者グループにはすべてのアクションを許可し、ユーザーグループには読み取りのみのアクセスを許可します。

  • アマゾン・ベリファイド・パーミッションを使用してAPIをテストするにはどうすればよいですか?

    -API GatewayのURLを取得し、Postmanなどのツールを使用してリクエストを送信します。リクエストのAuthorizationヘッダーに、OpenID Connectプロバイダーから取得したトークンを含めます。その後、適切なユーザーとして認証し、APIへのリクエストを送信して結果を確認します。

  • アマゾン・ベリファイド・パーミッションがサポートするOpenID Connectプロバイダーにはどのようなものがありますか?

    -アマゾン・ベリファイド・パーミッションは標準のOpenID Connectプロバイダーをサポートしており、CyberArk、Okta、Transman Securityなど、トップのアイデンティティプロバイダーとパートナーシップを結んでいます。

  • アマゾン・ベリファイド・パーミッションの設定を完了するために必要なAWSサービスは何ですか?

    -AWS CloudFormationを使用して、ポリシーストア、Lambda関数、およびAPI Gatewayのリソースをデプロイします。これにより、アマゾン・ベリファイド・パーミッションの設定が自動化されます。

Outlines

00:00

😀 Amazon Verified Permissionsの紹介

Alexi Ianoは、Amazon Verified Permissionsという新しい機能を紹介しています。このサービスは、OpenID Connectアイデンティティプロバイダを利用して、API GatewayでホストされているAPIへのユーザーアクセスを認証・認可するプロセスを簡素化します。このサービスは、アプリケーション内での権限管理と認可を実装する際に、独自のシステムを構築する代わりに、権限の細かい設定を追加できる「認可としてのサービス」です。銀行アプリケーションの例として、ユーザーがお金を引き出すたびに、アプリケーションがAmazon Verified Permissionsにアクセス権を確認する必要があると説明されています。また、エンドツーエンドのアーキテクチャフローも紹介されています。

05:00

📝 Amazon Verified Permissionsの設定手順

この段落では、OpenID Connectプロバイダを使用してAPIを保護する手順が詳細に説明されています。まず、OpenID Connectプロバイダの設定を行い、API GatewayのAPIとステージを設定します。その後、Amazon Verified Permissionsコンソールから新しいポリシーストアを作成し、OIDCプロバイダの詳細を入力します。トークンの種類やトークンクレームのマッピングもここで設定されます。次に、各グループ(管理者とユーザー)が実行できるアクションを定義し、ポリシーストアとLambda関数を作成します。Lambda関数はAPIリソースに割り当てられ、リクエストの認証を担当します。デプロイメントのステータスはAWS CloudFormationコンソールで確認でき、デプロイメントが完了したら作成されたリソースを確認します。

10:02

🔒 APIの保護とテスト

最後の段落では、API GatewayのAPIを保護し、ユーザーグループに基づいてアクセス権限を設定する方法が説明されています。管理者グループはAPIへのフルアクセスを持ち、ユーザーグループは読み取り専用アクセス権限を持つように設定されています。Postmanを使用して、OpenID Connectプロバイダからアクセストークンを取得し、APIへのリクエストを認証する方法も紹介されています。管理者ユーザーとしてリクエストを送信すると、APIからの200 OK応答が得られ、ポストリクエストも成功します。一方、ユーザーグループのユーザーとしてリクエストを送信すると、ポストリクエストは禁止されます。また、新しい機能のクイックスタートガイドが提供され、パートナーシップの紹介もされています。

Mindmap

Keywords

💡Amazon認証許可

Amazon認証許可は、アプリケーションの認証と認可を管理するサービスです。ビデオでは、APIゲートウェイでユーザーアクセスを管理するために使用されます。例えば、銀行アプリケーションでユーザーが金銭を引き出す際に認可を確認するために使用されます。

💡OpenID Connect

OpenID Connectは、ユーザーの認証を提供するプロトコルです。このビデオでは、Amazon認証許可と連携して、ユーザーがアプリケーションにアクセスする際に使用されます。具体例として、ユーザーがログインする際に生成されるトークンが挙げられます。

💡APIゲートウェイ

APIゲートウェイは、APIへのリクエストを管理するサービスです。ビデオでは、ポリシーの執行ポイントとして機能し、ユーザーのアクセスリクエストを検証します。APIゲートウェイは、認証者を通じてAmazon認証許可にリクエストを送り、許可または拒否の決定を受け取ります。

💡ポリシーストア

ポリシーストアは、ユーザーのアクセス権を定義するポリシーを保存する場所です。ビデオでは、ユーザーグループごとに異なるアクセス権を設定し、これを基にAmazon認証許可がアクセス許可を判断します。

💡Lambda関数

Lambda関数は、サーバーレス環境でコードを実行するためのAmazonのサービスです。このビデオでは、APIリクエストを認可するために使用され、ポリシーストアからポリシーを取得してアクセスを許可または拒否します。

💡ロールベースアクセス

ロールベースアクセスは、ユーザーの役割に基づいてアクセス権を制御する方法です。ビデオでは、管理者と一般ユーザーの2つのグループがあり、それぞれ異なるアクセス権が設定されています。

💡トークン

トークンは、ユーザーの認証情報を含むデータです。ビデオでは、OpenID Connectプロバイダーが生成するトークンが、APIゲートウェイに送られて認証および認可に使用されます。

💡カスタム認証者

カスタム認証者は、APIゲートウェイでリクエストを検証するカスタムロジックです。ビデオでは、この認証者がトークンを検証し、Amazon認証許可にアクセスリクエストを送ります。

💡グループクレーム

グループクレームは、ユーザーが所属するグループ情報を含むトークンのクレームです。ビデオでは、これを使用してユーザーのアクセス権を定義し、管理者グループと一般ユーザーグループに異なる権限を割り当てています。

💡クイックスタートウィザード

クイックスタートウィザードは、ステップバイステップで設定プロセスをガイドするツールです。ビデオでは、Amazon認証許可の設定を簡単に行うためのウィザードとして紹介されています。

Highlights

Alexi Iano介绍了Amazon Verified Permissions,这是一种简化使用OpenID Connect身份提供者进行API访问认证和授权的新功能。

Amazon Verified Permissions实现了授权即服务,避免了构建特定应用程序的授权系统。

该服务允许在应用程序中添加细粒度权限,例如在银行应用中检查用户是否有权提取资金。

介绍了端到端架构流程,展示了如何实时准确授权。

使用无服务器模式部署应用程序,并通过OpenID Connect提供者生成自定义令牌。

API Gateway作为策略执行点,通过自定义授权器调用Amazon Verified Permissions进行策略决策。

Amazon Verified Permissions提供了快速启动向导,帮助用户自动应用策略到API Gateway。

快速启动支持基于角色或组的访问,这是大多数构建者开始使用的授权模式。

创建新的策略存储时,可以选择外部OpenID Connect提供者并提供其详细信息。

Amazon Verified Permissions自动使用图形用户界面拉取所需的API Gateway配置。

用户可以手动定义每个用户组允许的操作,例如在宠物店API中根据用户组分配不同访问权限。

演示了如何使用Amazon Verified Permissions与OpenID Connect身份提供者保护Amazon API Gateway API。

需要预先配置所选的OIDC身份提供者,并创建用户、组以及将用户分配到组中。

OpenID配置允许发现与OpenID Connect提供者交互所需的所有值。

创建Amazon API Gateway API并部署新阶段,以保护API并根据用户组分配访问权限。

演示了如何在Amazon Verified Permissions管理控制台中创建策略存储并配置OIDC提供者详细信息。

展示了如何定义每个组允许的操作,并创建策略存储和Lambda函数以授权请求。

演示了如何将新的Lambda函数作为授权器附加到需要保护的API上。

展示了如何测试配置,包括使用Postman进行API调用和身份验证。

强调了快速启动功能,允许合作伙伴将自有身份带到AWS,并由Amazon处理授权集成的最后一英里。

提到了与CyberArk、Okta和Thales Security等顶级身份提供商的合作,展示了他们的身份提供者如何与此功能配合使用。

提供了关于Amazon Verified Permissions的更多信息的链接。

Transcripts

play00:02

hi I'm Alexi iano worldwide security and

play00:05

identity partner Solutions architect

play00:07

with Amazon verified permissions today

play00:10

I'll be demonstrating a new feature that

play00:12

makes it simple for you to use any open

play00:15

ID connect identity providers and Amazon

play00:18

verified permissions to authenticate and

play00:21

authorize user access to any apis hosted

play00:25

on Amazon API

play00:28

Gateway Amazon verified permission

play00:31

service enables you to implement

play00:33

permissions management and authorization

play00:35

within the applications that you

play00:38

build it's authorization as a service

play00:42

instead of building your own application

play00:44

specific authorization system you can

play00:47

add granular permissions into your

play00:49

application your application or a

play00:52

logical enforcement Point like Amazon

play00:55

API Gateway can call Amazon verified

play00:58

permissions to determine if a user can

play01:01

access to a

play01:03

resource verified permissions can check

play01:06

a user's access rights based on the

play01:09

policies in its policy story for example

play01:13

in a banking application the application

play01:15

would call Amazon verified permissions

play01:18

every time when the user withdraws money

play01:20

to ensure that the user is authorized to

play01:22

take that

play01:24

action let's have a look at the end to

play01:27

end architecture flow to understand how

play01:29

verified perm permissions accurates at

play01:31

TR time for example serverless is a

play01:34

common pattern in this diagram we deploy

play01:38

an application using any open ID connect

play01:40

provider as the identity provider a user

play01:44

logs in locally of affiliation and the

play01:47

identity provider generates custom

play01:50

tokens as you can see the token can

play01:53

contain different claim including a

play01:56

group representing the user's role with

play01:59

access or identity token the user can

play02:03

request application in points the

play02:06

browser or application sends the token

play02:09

to the API Gateway API Gateway serves as

play02:13

a policy enforcement point it stops the

play02:16

request and executes a custom L

play02:19

authorizer the authorizer performs the

play02:22

is authorized to with stalking call to

play02:25

verified permissions for a policy

play02:28

decision Amazon verifi permissions

play02:31

responds with an allow or deny decision

play02:34

in this instance the decision was

play02:37

allowed so the request proceeds to the

play02:39

backend

play02:42

API verified permissions launched quick

play02:45

start a stepbystep wizard to walk you

play02:48

through the setup process and

play02:50

automatically apply verified permissions

play02:52

policies to your API gway of resources

play02:56

we enable role based or group based

play02:59

access out of the box this covers the

play03:02

authorization pattern that most builders

play03:05

start with quick start will

play03:08

autogenerate all of the components you

play03:11

need to have an endtoend working

play03:14

solution a quick start wizard will guide

play03:17

you through the step-by-step

play03:18

configuration process we are going to

play03:20

review this process later in the video

play03:23

when creating a new policy store in

play03:26

Amazon verified permissions you can

play03:28

choose an external open ID connect

play03:30

provider option and provide its details

play03:33

to Amazon verified

play03:34

permissions you select what API and

play03:38

Stage you want to protect with

play03:40

authorization Amazon verified

play03:42

permissions pulls all the required API

play03:45

Gateway configuration and points and

play03:48

actions

play03:49

automatically using graphic user

play03:51

interface you manually Define actions

play03:54

allowed for each User Group verifi

play03:57

permissions create a policy store

play03:58

containing policy and schema and a

play04:01

Lambda function that authorizes

play04:04

request finally Amazon verified

play04:07

permissions automatically assigns the

play04:09

new Lambda function as an authorizer to

play04:11

the API resources that you need to

play04:14

protect the Lambda function generates

play04:17

and enforces verified permissions

play04:18

authorization

play04:20

requests let's see how to use Amazon

play04:23

verified permissions with an open it

play04:25

connect identity provider to protect an

play04:28

Amazon API Gateway

play04:31

API you need to preconfig the oidc

play04:34

identity provider of your choice we are

play04:37

using key clock in this example create

play04:42

users for this example I created two

play04:45

users Alis and Bop create groups and

play04:48

assign users to the

play04:50

groups in this example Alis is in the

play04:54

admin group and supposed to have full

play04:56

access to the API Bop is in the user

play05:00

group and supposed to have only read

play05:02

access to the

play05:03

API the open ID configuration allows you

play05:07

to discover all the required values

play05:10

needed to interact with a open ID

play05:12

connect

play05:13

provider create an Amazon API Gateway

play05:16

API that you want to

play05:18

protect we're using the pet store API

play05:21

that is available as an example in the

play05:24

Amazon API Gateway

play05:26

console deploy a new stage of the API

play05:30

that you want to protect we're using the

play05:32

pro stage in this

play05:34

example just to reiterate on the use

play05:37

case our API has get and post methods I

play05:41

want to secure this API based on the

play05:43

users group membership admin users

play05:46

should have full access to the API while

play05:49

users belonging to the user group should

play05:52

only have read access I'm going to use

play05:55

Amazon verified permissions to achieve

play05:58

this now get to the Amazon veried

play06:01

permissions Management console click

play06:04

create policy store in the top

play06:07

right choose setup with API Gateway and

play06:11

an identity provider and click

play06:14

next choose the API that you want to

play06:17

import actions and resources from in

play06:20

this case select the pet store

play06:23

API choose the deployment stage that you

play06:26

want to import actions and resources

play06:28

from and in this case we select the pro

play06:32

stage finally click import API you will

play06:36

see the map of imported resources and

play06:38

actions click next choose external

play06:41

opened connect provider option and

play06:43

configure the oidc provider details we

play06:47

need the issuer URL the issuer URL could

play06:50

be found in the well-known open ID

play06:52

connected provider configuration in

play06:54

point token type select the token that

play06:58

you are passing to a API Gateway in the

play07:01

authorization header we also need to

play07:04

define the token claims that map to user

play07:08

and group entities in the policy store

play07:10

schema verified permissions uses toen

play07:13

claims to map to policies in an is

play07:16

authorized with token

play07:18

call let's check the content of the

play07:21

token let's authenticate as Lis copy the

play07:25

identity token and use an online tool in

play07:28

order to check the claims in this token

play07:32

as you can see the token has a sub claim

play07:34

that identifies the user the group claim

play07:37

contains the groups that the user

play07:39

belongs to we're using the groups claim

play07:42

to define the actions allowed for each

play07:44

group as you see the groups have slashes

play07:47

in the beginning your identity provider

play07:50

May return the groups in a different

play07:52

format the audience validation is

play07:55

optional you can configure it if you

play07:57

want to validate the audience in the

play07:58

token

play08:00

you should be validating the audience of

play08:02

the token to make sure that the token is

play08:04

intended for your application never

play08:06

leave the audience validation unchecked

play08:08

in a production environment since this

play08:11

is the demo we are skipping this step

play08:14

it's time to Define actions allowed for

play08:16

each group we have two groups admin and

play08:20

user we are allowing all actions for the

play08:22

admin group and only get actions for the

play08:26

user group verified permissions create a

play08:29

policy store and the Lambda function

play08:32

that authorizes request we need to

play08:35

assign the new Lambda function as an

play08:37

authorizer to the API that we need to

play08:40

protect the function generates and

play08:43

enforces veried permissions

play08:44

authorization

play08:46

requests we are choosing now to make

play08:48

Amazon verified permissions to attach

play08:50

the authorizer to the API immediately

play08:53

click create policy store the resources

play08:56

are deployed using AWS Cloud information

play08:59

you can see the status of the deployment

play09:02

in the cloud formation

play09:04

conso once the deployment is complete

play09:06

let's check what was created for

play09:09

us now weate to the Amazon verified

play09:12

permissions

play09:13

counil you can see that a policy store

play09:16

is created it has two policies one for

play09:19

the admin group and one for the user

play09:22

group each policy defines the principle

play09:26

user group and the actions allowed

play09:30

you can also see what that a policy

play09:32

schema is created it defines the

play09:35

relationship between entities such as

play09:37

principles actions and

play09:40

resources let's check the Amazon API

play09:43

Gateway resources and make sure that a

play09:45

Lambda authorizer is attached to the API

play09:48

that we want to protect as you can see

play09:51

the authorizer is attached to every

play09:53

method of the API but options

play09:59

Let's test our

play10:01

configuration let's get the API Gateway

play10:04

URL of the pet store API I weate to the

play10:07

Amazon API Gateway console and check the

play10:10

stages copy the invoke URL of the pro

play10:14

stage open Postman let's configure the

play10:17

authorization for the request navigate

play10:20

to the authorization Tab and select the

play10:22

allos to point0

play10:24

type as you can see the authorization

play10:28

data will be passed in the authorization

play10:31

header of the HTTP request the bearer

play10:34

header prefix is added automatically by

play10:37

Postman before the actual value of the

play10:40

token choose the token name of your

play10:44

choice let's complete the configuration

play10:47

the grand type is authorization

play10:51

code the all URL is the authorization

play10:54

end point of the open ID connect

play10:58

provider the access token URL is a token

play11:01

end point of the opened connect

play11:07

provider the client ID and client secret

play11:10

are the client credentials that you

play11:12

created in the open ID connect provider

play11:15

the scope is the scope that you want to

play11:17

request the Callback URL is a URL that

play11:21

the open ID connect provider will

play11:23

redirect to after the user authenticates

play11:26

we using the postman callback URL click

play11:30

get new access token Postman will open a

play11:33

new window to authenticate with the open

play11:35

Ed connect provider enter the username

play11:38

and password of the user that you want

play11:40

to authenticate as Postman will redirect

play11:44

you to the postman call back URL with

play11:46

the authorization code Postman will

play11:49

exchange the authorization code for the

play11:51

token you can see the token in the

play11:54

postman

play11:56

environment let's authenticate as Alis

play11:59

send get pets request to the API you

play12:04

should get a 200 okay response with a

play12:07

list of

play12:08

pads send a post pets request to the API

play12:14

you should get a 200 okay response with

play12:16

the new pad because Ellis is the admin

play12:18

user and allowed to perform any actions

play12:21

in the

play12:22

application now let's authenticate as

play12:24

Bob send a get pets request to the API

play12:29

you should get a 200 okay response with

play12:31

a list of pets because Bob belongs to

play12:34

user group and user group is allowed to

play12:38

perform get requests now send a post

play12:41

pets request to the API you will see

play12:45

that request was forbidden because Bob

play12:48

is not allowed to create new

play12:51

pets with the announcement of quick

play12:53

start for open a connect we want to give

play12:56

a quick highlight to our partners this

play12:58

allow allows you to bring your own

play13:01

identity to AWS and leave the last mile

play13:04

of authorization integration to

play13:07

us this feature works with standard open

play13:10

connect identity providers and we are

play13:13

excited to announce that three of the

play13:15

top identity providers cyber art OCTA

play13:17

and transman security have partnered

play13:20

with us for lunch and highlighted how

play13:23

their identity provider works with this

play13:27

feature you can find more information

play13:30

about Amazon verified permissions by

play13:33

following these

play13:34

links thank you

Rate This

5.0 / 5 (0 votes)

関連タグ
AWSOpenID ConnectAPI管理セキュリティ認証認可CloudサーバーレスIAMアクセス制御