Skip to content

Commit 351072d

Browse files
authored
fix: block ssm:StartSession for ec2 and managed instances (#387)
Update the SCP so that ssm:StartSession is blocked for EC2 and SSM managed instances.
1 parent d55d8fc commit 351072d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

terragrunt/org_account/organization/scp_deny_ec2_connect.tf

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,18 @@ data "aws_iam_policy_document" "scp_deny_ec2_connect" {
1111
"*"
1212
]
1313
}
14-
}
1514

15+
statement {
16+
effect = "Deny"
17+
actions = [
18+
"ssm:StartSession"
19+
]
20+
resources = [
21+
"arn:aws:ec2:*:*:instance/*",
22+
"arn:aws:ssm:*:*:managed-instance/*"
23+
]
24+
}
25+
}
1626

1727
resource "aws_organizations_policy" "scp_deny_ec2_connect" {
1828
name = "Deny EC2 Instance Connect"

0 commit comments

Comments
 (0)