File tree Expand file tree Collapse file tree 3 files changed +33
-2
lines changed
Expand file tree Collapse file tree 3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ module "aws_custom_policies" {
44 " IAMServicesSupervisor" = {
55 description = " Policy granting IAM services admins permissions to make changes to user accounts"
66 filename = " level-4-iam-services-supervisor-policy.json"
7+ },
8+ " EnforceMFAForUsers" = {
9+ description = " Policy enforcing MFA for devops security users"
10+ filename = " enforce-mfa-for-users-policy.json"
711 }
812 }
913}
Original file line number Diff line number Diff line change 1+ {
2+ "Version" : " 2012-10-17" ,
3+ "Statement" : [
4+ {
5+ "Sid" : " EnforceMFAForUsers" ,
6+ "Effect" : " Deny" ,
7+ "NotAction" : [
8+ " iam:CreateVirtualMFADevice" ,
9+ " iam:EnableMFADevice" ,
10+ " iam:GetUser" ,
11+ " iam:GetMFADevice" ,
12+ " iam:ListMFADevices" ,
13+ " iam:ListVirtualMFADevices" ,
14+ " iam:ResyncMFADevice" ,
15+ " sts:GetSessionToken"
16+ ],
17+ "Resource" : " *" ,
18+ "Condition" : {
19+ "BoolIfExists" : {
20+ "aws:MultiFactorAuthPresent" : " false"
21+ }
22+ }
23+ }
24+ ]
25+ }
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ module "iam_read_only_group" {
55 group_name = " read-only-group"
66 policy_arn = {
77 " ReadOnlyAccess" = " arn:aws:iam::aws:policy/ReadOnlyAccess" ,
8- " IAMUserChangePassword" = " arn:aws:iam::aws:policy/IAMUserChangePassword"
8+ " IAMUserChangePassword" = " arn:aws:iam::aws:policy/IAMUserChangePassword" ,
9+ " EnforceMFAForUsers" = module.aws_custom_policies.policy_arns[" EnforceMFAForUsers" ]
910 }
1011}
1112
@@ -15,7 +16,8 @@ module "iam_services_supervisor_group" {
1516
1617 group_name = " iam-services-supervisor-group"
1718 policy_arn = {
18- " IAMServicesSupervisor" = module.aws_custom_policies.policy_arns[" IAMServicesSupervisor" ]
19+ " IAMServicesSupervisor" = module.aws_custom_policies.policy_arns[" IAMServicesSupervisor" ],
20+ " EnforceMFAForUsers" = module.aws_custom_policies.policy_arns[" EnforceMFAForUsers" ]
1921 }
2022}
2123
You can’t perform that action at this time.
0 commit comments