Bring your own Identity (BYOI) with OIDC and Amazon Verified Permissions | Amazon Web Services
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
😀 Amazon Verified Permissionsの紹介
Alexi Ianoは、Amazon Verified Permissionsという新しい機能を紹介しています。このサービスは、OpenID Connectアイデンティティプロバイダを利用して、API GatewayでホストされているAPIへのユーザーアクセスを認証・認可するプロセスを簡素化します。このサービスは、アプリケーション内での権限管理と認可を実装する際に、独自のシステムを構築する代わりに、権限の細かい設定を追加できる「認可としてのサービス」です。銀行アプリケーションの例として、ユーザーがお金を引き出すたびに、アプリケーションがAmazon Verified Permissionsにアクセス権を確認する必要があると説明されています。また、エンドツーエンドのアーキテクチャフローも紹介されています。
📝 Amazon Verified Permissionsの設定手順
この段落では、OpenID Connectプロバイダを使用してAPIを保護する手順が詳細に説明されています。まず、OpenID Connectプロバイダの設定を行い、API GatewayのAPIとステージを設定します。その後、Amazon Verified Permissionsコンソールから新しいポリシーストアを作成し、OIDCプロバイダの詳細を入力します。トークンの種類やトークンクレームのマッピングもここで設定されます。次に、各グループ(管理者とユーザー)が実行できるアクションを定義し、ポリシーストアとLambda関数を作成します。Lambda関数はAPIリソースに割り当てられ、リクエストの認証を担当します。デプロイメントのステータスはAWS CloudFormationコンソールで確認でき、デプロイメントが完了したら作成されたリソースを確認します。
🔒 APIの保護とテスト
最後の段落では、API GatewayのAPIを保護し、ユーザーグループに基づいてアクセス権限を設定する方法が説明されています。管理者グループはAPIへのフルアクセスを持ち、ユーザーグループは読み取り専用アクセス権限を持つように設定されています。Postmanを使用して、OpenID Connectプロバイダからアクセストークンを取得し、APIへのリクエストを認証する方法も紹介されています。管理者ユーザーとしてリクエストを送信すると、APIからの200 OK応答が得られ、ポストリクエストも成功します。一方、ユーザーグループのユーザーとしてリクエストを送信すると、ポストリクエストは禁止されます。また、新しい機能のクイックスタートガイドが提供され、パートナーシップの紹介もされています。
Mindmap
Keywords
💡Amazon認証許可
💡OpenID Connect
💡APIゲートウェイ
💡ポリシーストア
💡Lambda関数
💡ロールベースアクセス
💡トークン
💡カスタム認証者
💡グループクレーム
💡クイックスタートウィザード
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
hi I'm Alexi iano worldwide security and
identity partner Solutions architect
with Amazon verified permissions today
I'll be demonstrating a new feature that
makes it simple for you to use any open
ID connect identity providers and Amazon
verified permissions to authenticate and
authorize user access to any apis hosted
on Amazon API
Gateway Amazon verified permission
service enables you to implement
permissions management and authorization
within the applications that you
build it's authorization as a service
instead of building your own application
specific authorization system you can
add granular permissions into your
application your application or a
logical enforcement Point like Amazon
API Gateway can call Amazon verified
permissions to determine if a user can
access to a
resource verified permissions can check
a user's access rights based on the
policies in its policy story for example
in a banking application the application
would call Amazon verified permissions
every time when the user withdraws money
to ensure that the user is authorized to
take that
action let's have a look at the end to
end architecture flow to understand how
verified perm permissions accurates at
TR time for example serverless is a
common pattern in this diagram we deploy
an application using any open ID connect
provider as the identity provider a user
logs in locally of affiliation and the
identity provider generates custom
tokens as you can see the token can
contain different claim including a
group representing the user's role with
access or identity token the user can
request application in points the
browser or application sends the token
to the API Gateway API Gateway serves as
a policy enforcement point it stops the
request and executes a custom L
authorizer the authorizer performs the
is authorized to with stalking call to
verified permissions for a policy
decision Amazon verifi permissions
responds with an allow or deny decision
in this instance the decision was
allowed so the request proceeds to the
backend
API verified permissions launched quick
start a stepbystep wizard to walk you
through the setup process and
automatically apply verified permissions
policies to your API gway of resources
we enable role based or group based
access out of the box this covers the
authorization pattern that most builders
start with quick start will
autogenerate all of the components you
need to have an endtoend working
solution a quick start wizard will guide
you through the step-by-step
configuration process we are going to
review this process later in the video
when creating a new policy store in
Amazon verified permissions you can
choose an external open ID connect
provider option and provide its details
to Amazon verified
permissions you select what API and
Stage you want to protect with
authorization Amazon verified
permissions pulls all the required API
Gateway configuration and points and
actions
automatically using graphic user
interface you manually Define actions
allowed for each User Group verifi
permissions create a policy store
containing policy and schema and a
Lambda function that authorizes
request finally Amazon verified
permissions automatically assigns the
new Lambda function as an authorizer to
the API resources that you need to
protect the Lambda function generates
and enforces verified permissions
authorization
requests let's see how to use Amazon
verified permissions with an open it
connect identity provider to protect an
Amazon API Gateway
API you need to preconfig the oidc
identity provider of your choice we are
using key clock in this example create
users for this example I created two
users Alis and Bop create groups and
assign users to the
groups in this example Alis is in the
admin group and supposed to have full
access to the API Bop is in the user
group and supposed to have only read
access to the
API the open ID configuration allows you
to discover all the required values
needed to interact with a open ID
connect
provider create an Amazon API Gateway
API that you want to
protect we're using the pet store API
that is available as an example in the
Amazon API Gateway
console deploy a new stage of the API
that you want to protect we're using the
pro stage in this
example just to reiterate on the use
case our API has get and post methods I
want to secure this API based on the
users group membership admin users
should have full access to the API while
users belonging to the user group should
only have read access I'm going to use
Amazon verified permissions to achieve
this now get to the Amazon veried
permissions Management console click
create policy store in the top
right choose setup with API Gateway and
an identity provider and click
next choose the API that you want to
import actions and resources from in
this case select the pet store
API choose the deployment stage that you
want to import actions and resources
from and in this case we select the pro
stage finally click import API you will
see the map of imported resources and
actions click next choose external
opened connect provider option and
configure the oidc provider details we
need the issuer URL the issuer URL could
be found in the well-known open ID
connected provider configuration in
point token type select the token that
you are passing to a API Gateway in the
authorization header we also need to
define the token claims that map to user
and group entities in the policy store
schema verified permissions uses toen
claims to map to policies in an is
authorized with token
call let's check the content of the
token let's authenticate as Lis copy the
identity token and use an online tool in
order to check the claims in this token
as you can see the token has a sub claim
that identifies the user the group claim
contains the groups that the user
belongs to we're using the groups claim
to define the actions allowed for each
group as you see the groups have slashes
in the beginning your identity provider
May return the groups in a different
format the audience validation is
optional you can configure it if you
want to validate the audience in the
token
you should be validating the audience of
the token to make sure that the token is
intended for your application never
leave the audience validation unchecked
in a production environment since this
is the demo we are skipping this step
it's time to Define actions allowed for
each group we have two groups admin and
user we are allowing all actions for the
admin group and only get actions for the
user group verified permissions create a
policy store and the Lambda function
that authorizes request we need to
assign the new Lambda function as an
authorizer to the API that we need to
protect the function generates and
enforces veried permissions
authorization
requests we are choosing now to make
Amazon verified permissions to attach
the authorizer to the API immediately
click create policy store the resources
are deployed using AWS Cloud information
you can see the status of the deployment
in the cloud formation
conso once the deployment is complete
let's check what was created for
us now weate to the Amazon verified
permissions
counil you can see that a policy store
is created it has two policies one for
the admin group and one for the user
group each policy defines the principle
user group and the actions allowed
you can also see what that a policy
schema is created it defines the
relationship between entities such as
principles actions and
resources let's check the Amazon API
Gateway resources and make sure that a
Lambda authorizer is attached to the API
that we want to protect as you can see
the authorizer is attached to every
method of the API but options
Let's test our
configuration let's get the API Gateway
URL of the pet store API I weate to the
Amazon API Gateway console and check the
stages copy the invoke URL of the pro
stage open Postman let's configure the
authorization for the request navigate
to the authorization Tab and select the
allos to point0
type as you can see the authorization
data will be passed in the authorization
header of the HTTP request the bearer
header prefix is added automatically by
Postman before the actual value of the
token choose the token name of your
choice let's complete the configuration
the grand type is authorization
code the all URL is the authorization
end point of the open ID connect
provider the access token URL is a token
end point of the opened connect
provider the client ID and client secret
are the client credentials that you
created in the open ID connect provider
the scope is the scope that you want to
request the Callback URL is a URL that
the open ID connect provider will
redirect to after the user authenticates
we using the postman callback URL click
get new access token Postman will open a
new window to authenticate with the open
Ed connect provider enter the username
and password of the user that you want
to authenticate as Postman will redirect
you to the postman call back URL with
the authorization code Postman will
exchange the authorization code for the
token you can see the token in the
postman
environment let's authenticate as Alis
send get pets request to the API you
should get a 200 okay response with a
list of
pads send a post pets request to the API
you should get a 200 okay response with
the new pad because Ellis is the admin
user and allowed to perform any actions
in the
application now let's authenticate as
Bob send a get pets request to the API
you should get a 200 okay response with
a list of pets because Bob belongs to
user group and user group is allowed to
perform get requests now send a post
pets request to the API you will see
that request was forbidden because Bob
is not allowed to create new
pets with the announcement of quick
start for open a connect we want to give
a quick highlight to our partners this
allow allows you to bring your own
identity to AWS and leave the last mile
of authorization integration to
us this feature works with standard open
connect identity providers and we are
excited to announce that three of the
top identity providers cyber art OCTA
and transman security have partnered
with us for lunch and highlighted how
their identity provider works with this
feature you can find more information
about Amazon verified permissions by
following these
links thank you
5.0 / 5 (0 votes)