Ensure that IAM role trust policies used by Amazon Bedrock AgentCore implement cross-service confused deputy prevention by including the aws:SourceArn and/or aws:SourceAccount global condition context keys. The confused deputy problem is a security issue where an entity that doesn't have permission to perform an action can coerce a more-privileged entity to perform the action on its behalf. In AWS, cross-service impersonation can result in the confused deputy problem when one service (the calling service) calls another service (the called service), and the calling service is manipulated into using its permissions to act on another customer's resources.
When Amazon Bedrock AgentCore assumes an IAM role to interact with other AWS services on your behalf, it acts as the service principal bedrock-agentcore.amazonaws.com. Without proper conditions in the trust policy, a malicious actor could potentially trick the AgentCore service into assuming your IAM role and performing operations on resources it should not have access to. By adding aws:SourceArn and aws:SourceAccount condition keys to the trust policy's sts:AssumeRole statement, you ensure that only AgentCore resources within your specific account and ARN scope can assume the role, preventing unauthorized cross-account or cross-resource impersonation.
The aws:SourceArn condition key restricts role assumption to a specific AgentCore resource ARN (or ARN pattern), while aws:SourceAccount ensures that only your account can trigger the role assumption via the AgentCore service. Using both keys together provides the strongest protection. If you do not know the full ARN, you may use wildcard characters — for example, arn:aws:bedrock-agentcore:us-east-1:123456789012:* — to constrain access to all AgentCore resources within your account and region.
Without cross-service confused deputy prevention, IAM trust policies that allow bedrock-agentcore.amazonaws.com to assume a role without condition constraints are vulnerable to confused deputy attacks. A malicious actor could craft a scenario in which the AgentCore service is used as an intermediary to assume your IAM role and access or modify resources that the attacker cannot directly reach. This can result in unauthorized data access, privilege escalation, and potential data exfiltration from AWS services that your AgentCore execution role has permissions to access. The impact is particularly severe because AgentCore execution roles often carry broad permissions to interact with AWS services such as S3, DynamoDB, Lambda, and others.
Adding aws:SourceArn and aws:SourceAccount conditions to trust policies is a zero-cost, low-complexity security control that eliminates an entire class of cross-service privilege escalation attacks. This aligns with AWS security best practices and the principle of least privilege, ensuring that the AgentCore service can only assume your role when acting on behalf of your own resources within your own account.
Audit
To determine if IAM roles used by Amazon Bedrock AgentCore implement cross-service confused deputy prevention, perform the following operations:
Remediation / Resolution
To implement cross-service confused deputy prevention for IAM roles used by Amazon Bedrock AgentCore, perform the following operations:
References
- AWS Documentation
- Cross-service confused deputy prevention
- The confused deputy problem
- aws:SourceArn
- aws:SourceAccount
- Identity and access management for Amazon Bedrock AgentCore
- AWS Command Line Interface (CLI) Documentation
- list-roles
- get-role
- update-assume-role-policy
- CloudFormation Documentation
- AWS::IAM::Role
- Terraform Documentation
- Resource: aws_iam_role
- Data Source: aws_iam_policy_document