View a markdown version of this page

認可フロー - Amazon Bedrock AgentCore

認可フロー

Amazon Bedrock AgentCore Gateway は、受信リクエストに対して Cedar ポリシーを評価します。このセクションでは、認可情報がリクエストからポリシー評価にどのように流れるかについて説明します。

リクエスト処理

Amazon Bedrock AgentCore Gateway は、各リクエストから 2 つの重要な情報を処理します。

  1. JWT トークン - ユーザーに関する OAuth クレームが含まれます。

    { "sub": "12345678-1234-1234-1234-123456789012", "iss": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Vg2efaoGO", "username": "refund-agent", "scope": "aws.cognito.signin.user.admin refund:write", "role": "admin", "department": "finance" }
  2. MCP ツールコールリクエスト - 実際のツール呼び出し:

    { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "RefundTool___process_refund", "arguments": { "orderId": "12345", "amount": 450, "reason": "Defective product" } } }

Cedar 認可リクエスト

Gateway は両方のソースから情報を抽出し、Cedar 認可リクエストを構築します。

認可リクエストを完了する:

{ "principal": "AgentCore::OAuthUser::\"12345678-1234-1234-1234-123456789012\"", "action": "AgentCore::Action::\"RefundTool___process_refund\"", "resource": "AgentCore::Gateway::\"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/refund-gateway\"", "context": { "input": { "orderId": "12345", "amount": 450, "reason": "Defective product" } } }

コンポーネント:

Principal

JWT トークンのサブクレームから作成:

AgentCore::OAuthUser::"12345678-1234-1234-1234-123456789012"
アクション

ツール名から抽出:

AgentCore::Action::"RefundTool___process_refund"
[リソース]

Gateway インスタンス:

AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/refund-gateway"
Context

ツール引数が含まれます。

{ "input": { "orderId": "12345", "amount": 450, "reason": "Defective product" } }

Entity Store - JWT クレームは、OAuthUser エンティティにタグとして保存されます。

{ "uid": { "type": "AgentCore::OAuthUser", "id": "12345678-1234-1234-1234-123456789012" }, "attrs": { "id": "12345678-1234-1234-1234-123456789012" }, "tags": { "username": "refund-agent", "iss": "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Vg2efaoGO", "scope": "aws.cognito.signin.user.admin refund:write", "role": "admin", "department": "finance" } }

ポリシーの評価

Cedar は以下を評価します。

  1. プリンシパルチェック: プリンシパルは OAuthUser ですか? ✓ (一致)

  2. アクションチェック: アクションは RefundTool___process_refund ですか? ✓ (一致)

  3. リソースチェック: リソースは返金ゲートウェイですか? ✓ (一致)

  4. 条件チェック:

    • プリンシパルにユーザー名タグはありますか? ✓ (はい、JWT から)

    • username = "refund-agent"? ✓ (はい)

    • context.input.amount < 500 ですか? ✓ (450 < 500)

結果: 許可 - すべてのチェックに合格し、返金が承認されます。