Cross-service confused deputy prevention
Important
End of support notice: Existing customers will be able to use Amazon QLDB until end of support on 07/31/2025. For more details, see
Migrate an Amazon QLDB Ledger to Amazon Aurora PostgreSQL
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. In AWS, cross-service impersonation can result in the confused deputy problem.
Cross-service impersonation can occur when one service (the calling service) calls another service (the called service). The calling service can be manipulated to use its permissions to act on another customer's resources in a way it should not otherwise have permission to access. To prevent the confused deputy problem, AWS provides tools that help you protect your data for all services with service principals that have been given access to resources in your account.
We recommend using the aws:SourceArn
and aws:SourceAccount
global condition context keys in resource
policies to limit the permissions that Amazon QLDB gives another service to the
resource. If you use both global condition context keys, the aws:SourceAccount
value and the account in the aws:SourceArn
value must use the same account ID
when they're used in the same policy statement.
The following table lists possible values of aws:SourceArn
for the ExportJournalToS3
and StreamsJournalToKinesis
QLDB API operations. These
operations are in scope for this security issue because they call AWS Security Token Service (AWS STS) to
assume an IAM role that you specify.
API operation | Called service | aws:SourceArn |
---|---|---|
ExportJournalToS3 |
AWS STS (AssumeRole ) |
Allows QLDB to assume the role for any QLDB resources in the account:
Currently, QLDB only supports this wildcard ARN for journal exports. |
StreamsJournalToKinesis |
AWS STS (AssumeRole ) |
Allows QLDB to assume the role for a specific QLDB stream:
Note: You can only specify a stream ID in the ARN after the stream resource is created. Using this ARN, you can allow the role to only be used for a single QLDB stream. Allows QLDB to assume the role for any QLDB streams of a ledger:
Allows QLDB to assume the role for any QLDB streams in the account:
Allows QLDB to assume the role for any QLDB resources in the account:
|
The most effective way to protect against the confused deputy problem is to use the
aws:SourceArn
global condition context key with the full ARN of the
resource. If you don't know the full ARN of the resource or if you're specifying multiple
resources, use the aws:SourceArn
global context condition key with wildcard
characters (*
) for the unknown portions of the ARN—for example,
arn:aws:qldb:us-east-1:
.123456789012
:*
The following trust policy example for an IAM role shows how you can use the
aws:SourceArn
and aws:SourceAccount
global condition context
keys to prevent the confused deputy problem. With this trust policy, QLDB can assume the
role for any QLDB stream in the account 123456789012
for the ledger
myExampleLedger
only.
To use this policy, replace us-east-1
,
123456789012
, and myExampleLedger
in the example with your own information.
{ "Version": "2012-10-17", "Statement": { "Sid": "ConfusedDeputyPreventionExamplePolicy", "Effect": "Allow", "Principal": { "Service": "qldb.amazonaws.com" }, "Action": [ "sts:AssumeRole" ], "Condition": { "ArnEquals": { "aws:SourceArn": "arn:aws:qldb:
us-east-1
:123456789012
:stream/myExampleLedger
/*" }, "StringEquals": { "aws:SourceAccount": "123456789012
" } } } }