ポリシーの範囲
スコープは、ポリシーの適用対象を定義します。Cedar ポリシーごとに 3 つのコンポーネントを指定します。
permit( principal is AgentCore::OAuthUser, // WHO is making the request action == AgentCore::Action::"...", // WHAT they want to do resource is AgentCore::Gateway::"..." // WHICH resource they want to access )
エンティティと名前空間
Cedar はエンティティを使用してプリンシパル、アクション、リソースを表します。AgentCore Gateway のすべてのエンティティは AgentCore 名前空間を使用します。
エンティティ形式: Namespace::EntityType::"identifier"
Principal
プリンシパルは、認可リクエストを行うエンティティを識別します。プリンシパルタイプは、AgentCore Gateway が認証用にどのように設定されているかによって異なります。
OAuth ユーザープリンシパル
OAuth 認可を使用する場合、プリンシパルは AgentCore::OAuthUser です。
principal is AgentCore::OAuthUser
コンポーネント:
-
principal- 認可リクエストを行うエンティティ -
AgentCore::OAuthUser- OAuth 認証ユーザーを表すエンティティタイプ -
is- タイプチェック演算子 (OAuthUser エンティティに一致)
プリンシパルは OAuth 認証ユーザーです。各ユーザーには、JWT サブクレームからの一意の ID があります。
IAM エンティティプリンシパル
AWS_IAM 認可を使用する場合、プリンシパルは AgentCore::IamEntity です。
principal is AgentCore::IamEntity
コンポーネント:
-
principal- 認可リクエストを行うエンティティ -
AgentCore::IamEntity- IAM 認証された発信者を表すエンティティタイプ -
is- タイプチェック演算子 (任意の IamEntity に一致)
IAM プリンシパルには、呼び出し元の IAM ARN を含むid属性があります。この属性でパターンマッチングを使用して、アカウントベースまたはロールベースのアクセスコントロールを実装できます。
アクション
アクションは、リクエストされるオペレーションを指定します。
action == AgentCore::Action::"RefundTool___process_refund"
コンポーネント:
-
action- リクエストされているオペレーション -
AgentCore::Action::"RefundTool___process_refund"- 特定のアクションエンティティ -
==- 完全一致演算子 (この特定のアクションのみ)
アクションは MCP AgentCore Gateway のツール呼び出しを表します。各ツールには、対応するアクションエンティティがあります。
ターゲットタイプ別のアクション名
ポリシーのアクション識別子は、ゲートウェイで設定されたターゲットタイプによって異なります。
| 対象タイプ | アクション形式 | 例 |
|---|---|---|
|
MCP |
|
|
|
AgentCore ランタイム |
|
|
|
プロキシ (HTTP) |
|
|
複数のアクション
Cedar はワイルドカードアクションをサポートしていません。各アクションは、正確なアクション識別子 (AgentCore::Action::"ToolName___operation") を使用して明示的に参照する必要があります。1 つのルールで複数のツールをグループ化するには、ゲートウェイターゲット (アクショングループ) を使用し、そのターゲットに対してポリシーを書き込みます。
例えば、名前が Read で始まるツールにのみアクセスを許可するには、それぞれのツールを含む ReadToolsTarget というゲートウェイターゲットを作成し、次のようなポリシーを記述できます。
permit( principal, action in AgentCore::Action::"ReadToolsTarget", resource == AgentCore::Gateway::"<gateway-arn>" );
これにより、ポリシーの効果に応じて、そのターゲットに含まれるすべてのツールが許可されます。
[リソース]
リソースはリクエストのターゲットを識別します。
resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/refund-gateway"
コンポーネント:
-
resource- リクエストのターゲット -
AgentCore::Gateway- ゲートウェイインスタンスを表すエンティティタイプ -
==- 完全一致演算子 (この特定の AgentCore Gateway に一致)
AgentCore Gateway は、ツール呼び出しをルーティングする MCP サーバーです。
リソース固有の要件
1 つ以上の特定のアクションを指定する場合は、特定の AgentCore Gateway ARNs を使用する必要があります。
// Required: Specific Gateway ARN for specific action(s) resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/refund-gateway"
これは、以下に適用されます。
-
単一アクション:
action == AgentCore::Action::"ToolName" -
複数の特定のアクション:
action in [AgentCore::Action::"Tool1", AgentCore::Action::"Tool2"]
タイプチェックは、いずれかのアクションに一致する場合にのみ使用します。
// For policies covering any action (not specific tools) resource is AgentCore::Gateway
例:
// Blocks all actions forbid(principal, action, resource); // Allow any CallTool action permit(principal, action in AgentCore::Action::"CallTool", resource is AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-west-2:123456789012:gateway/refund-gateway");
特定の AgentCore Gateway ARNsを提供します。
-
AgentCore Gateway インスタンス間のセキュリティ分離
-
本番環境と開発環境の分離
-
AgentCore Gateway あたりのきめ細かなアクセスコントロール