Skip to content

Commit d91d8ad

Browse files
authored
[PRM-581] Prevent BAU Administrator access from deleting .tfstate files (#465)
1 parent c8fb60f commit d91d8ad

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

infrastructure/policies.tf

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,29 @@ resource "aws_iam_policy" "read_only_role_extra_permissions" {
4040
Workspace = "core"
4141
}
4242
}
43+
44+
resource "aws_iam_policy" "administrator_permission_restrictions" {
45+
name = "AdministratorRestriction"
46+
policy = jsonencode({
47+
Version = "2012-10-17",
48+
Statement = [
49+
{
50+
Effect = "Deny",
51+
Action = [
52+
"s3:DeleteObject",
53+
"s3:DeleteObjectVersion",
54+
"s3:PutLifecycleConfiguration",
55+
"s3:PutObject",
56+
"s3:RestoreObject"
57+
],
58+
Resource = [
59+
"arn:aws:s3:::*/*.tfstate"
60+
]
61+
}
62+
]
63+
})
64+
tags = {
65+
Name = "AdministratorRestriction"
66+
Workspace = "core"
67+
}
68+
}

0 commit comments

Comments
 (0)