Skip to content

Why does AgentCore CreatePolicyEngine return AccessDenied in sa-east-1 when IAM simulation allows it?

0

On an AWS account I control, one Amazon Bedrock AgentCore Policy CreatePolicyEngine call in sa-east-1 using temporary credentials from the assumed IAM role sentinela-agentcore-v1-provisioner returned AccessDenied.

The role’s persisted policy allows bedrock-agentcore:CreatePolicyEngine subject to these conditions:

  • aws:RequestedRegion = sa-east-1
  • aws:RequestTag/SentinelaLab matches the lab tag value sent in the request
  • aws:TagKeys is limited to SentinelaLab

CloudTrail shows the expected request tag and errorCode=AccessDenied, with no errorMessage. IAM Policy Simulator returned Allowed for this role and action using the matching region and tag context. I found no permissions boundary, session policy, or AWS Organizations SCP. I have not retried the request or changed IAM.

Are there additional AgentCore Policy service-side authorization prerequisites, account or Region eligibility checks, or limitations on these IAM conditions for CreatePolicyEngine that the simulator does not model? Which read-only checks can distinguish these possibilities?

  • Thanks for your guidance. The original CreatePolicyEngine issue is resolved; the Policy Engine is ACTIVE in sa-east-1.

    Tagged CreateLogGroup now returns HTTP 400 AccessDeniedException requiring the dependent permission logs:TagResource. Two controlled attempts failed (request IDs 4e9e5fff-461f-4d48-85de-7aa9ed9a7103 and 9ef68968-38e6-4dc7-b509-f4410a98d497).

    The provisioner role explicitly allows logs:TagResource on the exact log group ARN without :*, as AWS documents. Its conditions restrict aws:TagKeys to SentinelaLab, and use StringEqualsIfExists for aws:RequestTag/SentinelaLab and aws:ResourceTag/SentinelaLab. A separate logs:CreateLogGroup Allow requires the exact requested tag value with StringEquals.

    No permissions boundary, session policy, or Organizations SCP applies. IAM simulation allows the action, but the real call is denied. CloudTrail does not expose the ARN or condition keys evaluated for the dependent tagging check.

    Could an AWS engineer clarify: (1) which ARN is evaluated for logs:TagResource during tagged creation; (2) which of those three condition keys are available in that dependent context; (3) the recommended least-privilege pattern for mandatory tags; and (4) whether this is an undocumented limitation or authorization issue?

    We have stopped retries and IAM changes pending clarification. The log group is for a synthetic defensive research lab with strict resource and tag isolation.

  • For logs:TagResource, a log group ARN without the :* suffix is ​​used. However, it cannot be conclusively determined from public documentation whether the same ARN is used for the dependent authorization within CreateLogGroup. However, regarding the evaluation of the internal ARN for CreateLogGroup's authorization dependencies, we cannot guarantee that the same format is used. I believe testing is required for this part. https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_LogGroup.html

    Use this version to refer to the ARN in IAM policies when specifying permissions for most API actions. The exception is when specifying permissions for TagResource, UntagResource, and ListTagsForResource. The permissions for those three actions require the ARN version that doesn't include a trailing :*.

1 Answer
0
Accepted Answer

Hello.

The IAM Policy Simulator only evaluates the logic of the identity-based policy you provide.
Even if your policy for "bedrock-agentcore:*" is correct, the actual rejection may have been for a different service or action, which could be recorded as a separate event in CloudTrail.
Please check the CloudTrail audit logs to see the detailed error message.

Also, try the following IAM policy.
This is an IAM role suggested for managing Bedrock AgentCore.
Please change the region code to the region you are using.
https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/policy-permissions.html#policy-permissions-management-role

{
"Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "GatewayManagement",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:CreateGateway",
        "bedrock-agentcore:UpdateGateway",
        "bedrock-agentcore:GetGateway",
        "bedrock-agentcore:DeleteGateway",
        "bedrock-agentcore:ListGateways",
        "bedrock-agentcore:InvokeGateway",
        "bedrock-agentcore:CreateGatewayTarget",
        "bedrock-agentcore:UpdateGatewayTarget",
        "bedrock-agentcore:GetGatewayTarget",
        "bedrock-agentcore:DeleteGatewayTarget",
        "bedrock-agentcore:ListGatewayTargets"
      ],
      "Resource": [
        "arn:aws:bedrock-agentcore:us-east-1:123456789012:gateway/*"
      ]
    },
    {
      "Sid": "PolicyEngineManagement",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:CreatePolicyEngine",
        "bedrock-agentcore:UpdatePolicyEngine",
        "bedrock-agentcore:GetPolicyEngine",
        "bedrock-agentcore:DeletePolicyEngine",
        "bedrock-agentcore:ListPolicyEngines",
        "bedrock-agentcore:ListPolicyEngineSummaries",
        "bedrock-agentcore:GetPolicyEngineSummary"
      ],
      "Resource": [
        "arn:aws:bedrock-agentcore:us-east-1:123456789012:policy-engine/*"
      ]
    },
    {
      "Sid": "PolicyManagement",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:CreatePolicy",
        "bedrock-agentcore:UpdatePolicy",
        "bedrock-agentcore:GetPolicy",
        "bedrock-agentcore:DeletePolicy",
        "bedrock-agentcore:ListPolicies",
        "bedrock-agentcore:ListPolicySummaries",
        "bedrock-agentcore:GetPolicySummary"
      ],
      "Resource": [
        "arn:aws:bedrock-agentcore:us-east-1:123456789012:policy-engine/*/policy/*"
      ]
    },
    {
      "Sid": "PolicyGeneration",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:StartPolicyGeneration",
        "bedrock-agentcore:GetPolicyGeneration",
        "bedrock-agentcore:ListPolicyGenerations",
        "bedrock-agentcore:ListPolicyGenerationAssets"
      ],
      "Resource": [
        "arn:aws:bedrock-agentcore:us-east-1:123456789012:policy-engine/*/policy-generation/*"
      ]
    },
    {
      "Sid": "IAMPassRole",
      "Effect": "Allow",
      "Action": [
        "iam:PassRole"
      ],
      "Resource": [
        "arn:aws:iam::123456789012:role/*BedrockAgentCore*"
      ],
      "Condition": {
        "StringEquals": {
          "iam:PassedToService": "bedrock-agentcore.amazonaws.com"
        }
      }
    },
    {
      "Sid": "IAMReadAccess",
      "Effect": "Allow",
      "Action": [
        "iam:GetRole",
        "iam:GetRolePolicy",
        "iam:ListAttachedRolePolicies",
        "iam:ListRolePolicies"
      ],
      "Resource": [
        "arn:aws:iam::123456789012:role/*"
      ]
    },
    {
      "Sid": "PolicyScopeManagement",
      "Effect": "Allow",
      "Action": [
        "bedrock-agentcore:ManageResourceScopedPolicy",
        "bedrock-agentcore:ManageAdminPolicy"
      ],
      "Resource": [
        "arn:aws:bedrock-agentcore:us-east-1:123456789012:gateway/*"
      ]
    }
  ]
}
EXPERT

answered a month ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.