To protect your Amazon Bedrock service roles from the confused deputy problem, ensure that cross-service confused deputy prevention is implemented for the role policies. The confused deputy problem is a security issue where an entity lacking permission to perform an action manipulates a more-privileged entity into executing the action on its behalf. In AWS, this can occur through cross-service impersonation, where one service (the calling service) invokes another service (the called service). The calling service can be exploited to use its permissions to access another customer's resources, which it should not have the authority to do. To mitigate this risk, AWS provides tools to protect your data across all services with service principals that have access to your resources. AWS recommend using the "aws:SourceArn" and "aws:SourceAccount" global condition context keys in role policies to limit the permissions that Amazon Bedrock gives another service to the resource. Use "aws:SourceArn" if you want only one resource to be associated with the cross-service access. Use "aws:SourceAccount" if you want to allow any cloud resource in that AWS account to be associated with the cross-service use.
Protecting AWS resources against the confused deputy problem is crucial because this security vulnerability can allow a malicious user to trick a service with higher privileges into performing unauthorized actions on their behalf, potentially leading to data breaches, unauthorized access, or resource manipulation.
AWS employs IAM service roles for various Bedrock resources, including agents, knowledge bases, prompt flows, model customization jobs, and Bedrock Studio workspaces. These roles enable Amazon Bedrock to carry out tasks for you. As an example, the Audit and Remediation steps outlined on this KB page utilize service roles associated with Amazon Bedrock agents.
Audit
To determine if the trust relationship policies configured for your Amazon Bedrock service roles protect against the confused deputy problem, perform the following operations:
Remediation / Resolution
The most effective way to protect against the confused deputy problem is to use the "aws:SourceArn" condition context key with the full ARN of the Amazon Bedrock resource. If you don't know the full ARN of the Bedrock resource or if you need to specify multiple Bedrock resources, use the "aws:SourceArn" key with wildcards (i.e. *) for the unknown portions of the ARN. For example, "arn:aws:bedrock:\<aws-region\>:\<aws-account-id\>:agent/*". To update the trust relationship policies configured for your Amazon Bedrock service roles in order to implement cross-service confused deputy prevention, perform the following operations:
References
- AWS Documentation
- Cross-service confused deputy prevention
- AWS global condition context keys
- Service roles
- Create a service role for Agents for Amazon Bedrock
- Agents for Amazon Bedrock
- AWS Command Line Interface (CLI) Documentation
- list-agents
- get-agent
- get-role
- update-assume-role-policy