Commit aa26e2f
committed
Remove dangerous iam:PassRole and redundant SSM permissions from EC2 policy
Security fix: EC2 instances do not need iam:PassRole permission as they never create resources requiring role assignment. This was a privilege escalation risk.
Also removed SSM permissions (ssmmessages, ssm:SendCommand, ssm:GetCommandInvocation, etc.) as these are:
1. Already provided by the AmazonSSMManagedInstanceCore managed policy attached at line 71
2. Not needed by EC2 instances (these are for SENDING commands TO instances, not receiving them)
Kept S3 wildcard access as EC2 instances need to read/write datastream data.
This is the minimal security hardening change with zero functional impact.1 parent ded1ec6 commit aa26e2f
1 file changed
+0
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | 23 | | |
46 | 24 | | |
47 | 25 | | |
48 | 26 | | |
49 | 27 | | |
50 | 28 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 29 | | |
60 | 30 | | |
61 | 31 | | |
| |||
0 commit comments