Skip to content

Commit 9fedf66

Browse files
committed
add cross-service-confused-deputy-prevention.adoc
1 parent 773c70a commit 9fedf66

3 files changed

Lines changed: 69 additions & 0 deletions

File tree

latest/ug/doc-history.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ https://docs.aws.amazon.com/eks/latest/userguide/doc-history.rss
1919
[.updates]
2020
== Updates
2121

22+
[.update,date="2025-08-19"]
23+
=== Cross-service confused deputy prevention
24+
[.update-ulink]
25+
link:eks/latest/userguide/cross-service-confused-deputy-prevention.html[type="documentation"]
26+
27+
Added a topic with an example trust policy that you can apply for Cross-service confused deputy prevention.
28+
Amazon EKS accepts the `aws:SourceArn` and `aws:SourceAccount` conditions in the trust policy of an EKS cluster role.
29+
2230
[.update,date="2025-07-30"]
2331
=== Amazon EKS platform version update
2432
[.update-ulink]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
include::../attributes.txt[]
2+
3+
[.topic]
4+
[#cross-service-confused-deputy-prevention]
5+
= Cross-service confused deputy prevention in Amazon EKS
6+
:info_titleabbrev: Cross-service confused deputy prevention
7+
8+
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 <emphasis>calling service</emphasis>) calls another service (the <emphasis>called service</emphasis>). 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 this, {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.
9+
10+
We recommend using the link:IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourcearn[`aws:SourceArn`, type="documentation"], link:IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceaccount[`aws:SourceAccount`, type="documentation"] global condition context keys in resource policies to limit the permissions that Amazon Elastic Kubernetes Service (Amazon EKS) gives another service to the resource.
11+
12+
`aws:SourceArn`::
13+
Use `aws:SourceArn` to associate only one resource with cross-service access.
14+
15+
`aws:SourceAccount`::
16+
Use `aws:SourceAccount` to let any resource in that account be associated with the cross-service use.
17+
18+
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 are 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}[.replaceable]``servicename``:*:[.replaceable]``123456789012``:*`.
19+
20+
If the `aws:SourceArn` value does not contain the account ID, such as an Amazon S3 bucket ARN, you must use both `aws:SourceAccount` and `aws:SourceArn` to limit permissions.
21+
22+
[#cross-service-confused-deputy-cluster-role]
23+
== Amazon EKS cluster role cross-service confused deputy prevention
24+
:info_titleabbrev: Amazon EKS cluster role
25+
26+
An Amazon EKS cluster IAM role is required for each cluster. Kubernetes clusters managed by Amazon EKS use this role to manage nodes and the link:https://kubernetes-sigs.github.io/aws-load-balancer-controller/v2.7/guide/service/annotations/#legacy-cloud-provider[legacy Cloud Provider] uses this role to create load balancers with Elastic Load Balancing for services.
27+
These cluster actions can only affect the same account, so we recommend that you limit each cluster role to that cluster and account.
28+
This is a specific application of the {aws} recommendation to follow the _principle of least privilege_ in your account.
29+
30+
*Source ARN format*
31+
32+
The value of `aws:SourceArn` must be the ARN of an EKS cluster in the format `{arn-aws}:eks:[.replacable]``region``:[.replacable]``account``:cluster/[.replacable]``cluster-name```. For example, `{arn-aws}:eks:us-east-1:123456789012:cluster/my-cluster` .
33+
34+
*Trust policy format for EKS cluster roles*
35+
36+
The following example shows how you can use the `aws:SourceArn` and `aws:SourceAccount` global condition context keys in Amazon EKS to prevent the confused deputy problem.
37+
38+
[source,json,subs="verbatim,attributes,quotes"]
39+
----
40+
{
41+
"Version": "2012-10-17",
42+
"Statement": [
43+
{
44+
"Effect": "Allow",
45+
"Principal": {
46+
"Service": "eks.amazonaws.com"
47+
},
48+
"Action": "sts:AssumeRole",
49+
"Condition": {
50+
"ArnLike": {
51+
"aws:SourceArn": "{arn-aws}:eks:[.replaceable]`us-west-2`:[.replaceable]`123456789012`:cluster/[.replaceable]`my-cluster`"
52+
},
53+
"StringEquals": {
54+
"aws:SourceAccount": "123456789012"
55+
}
56+
}
57+
}
58+
]
59+
}
60+
----

latest/ug/security/security-eks.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ include::infrastructure-security.adoc[leveloffset=+1]
1919

2020
include::disaster-recovery-resiliency.adoc[leveloffset=+1]
2121

22+
include::cross-service-confused-deputy-prevention.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)