Skip to content

Commit

Permalink
Merge pull request #8402 from ministryofjustice/feature/7907-separate…
Browse files Browse the repository at this point in the history
…-out-passrole

Separate out `iam:PassRole` statements
  • Loading branch information
dms1981 authored Nov 1, 2024
2 parents 972d713 + 1296045 commit f9cf4c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 7 additions & 1 deletion terraform/environments/bootstrap/member-bootstrap/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ data "aws_iam_policy_document" "policy" {
"iam:listInstanceProfilesForRole",
"iam:listRolePolicies",
"iam:ListRoles",
"iam:PassRole",
"kinesis:PutRecord",
"kms:DescribeKey",
"kms:Decrypt",
Expand Down Expand Up @@ -564,6 +563,13 @@ data "aws_iam_policy_document" "policy" {
]
resources = ["*"] #tfsec:ignore:AWS099 tfsec:ignore:AWS097
}

statement {
actions = ["iam:PassRole"]
effect = "Allow"
resources = ["*"]
}

statement {
effect = "Allow"
actions = [
Expand Down
12 changes: 8 additions & 4 deletions terraform/environments/bootstrap/single-sign-on/policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,7 @@ data "aws_iam_policy_document" "developer_additional" {
statement {
sid = "iamForECSAllow"
effect = "Allow"
actions = [
"iam:PassRole"
]
actions = ["iam:PassRole"]
resources = ["*"]
condition {
test = "StringEquals"
Expand Down Expand Up @@ -1166,7 +1164,6 @@ data "aws_iam_policy_document" "reporting-operations" {
"dynamodb:Get*",
"dynamodb:Query",
"dynamodb:Scan",
"iam:PassRole",
"redshift:*",
"redshift-data:*",
"redshift-serverless:*",
Expand All @@ -1192,6 +1189,13 @@ data "aws_iam_policy_document" "reporting-operations" {
]
resources = ["*"] #tfsec:ignore:AWS099 tfsec:ignore:AWS097
}

statement {
actions = ["iam:PassRole"]
effect = "Allow"
resources = ["*"]
}

}

#tfsec:ignore:aws-iam-no-policy-wildcards
Expand Down

0 comments on commit f9cf4c5

Please sign in to comment.