-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_2.tf
31 lines (30 loc) · 1.01 KB
/
example_2.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
resource "aws_iam_role" "example_2_role" {
assume_role_policy = jsonencode(
{
Statement = [
{
Effect = "Allow"
Action = "sts:AssumeRole"
Principal = {
AWS = "arn:aws:iam::111222333444:root" # SNYK-CC-TF-118 violation due to "arn:aws:iam::111222333444:root"
}
},
{
Effect = "Allow"
Action = "sts:AssumeRoleWithWebIdentity"
Principal = {
Federated = "arn:aws:iam::111222333444:oidc-provider/oidc.eks.us-west-2.amazonaws.com/id/FOO"
}
Condition = {
StringLike = {
"oidc.eks.us-west-2.amazonaws.com/id/FOO:aud" = "sts.amazonaws.com"
"oidc.eks.us-west-2.amazonaws.com/id/FOO:sub" = "system:serviceaccount:*:*" # This allows any Kubernetes Service Account in any Kubernetes Namespace in EKS Cluster ID `FOO` to assume `example_role`
}
}
}
]
Version = "2012-10-17"
}
)
managed_policy_arns = []
}