IAM-EC2-1 |
Check that the ability to terminate EC2 instances are appropriately scoped or are only assumable to authorized principals. |
In Production or Production-like environments,no one other than IaC tools should have access to delete resources. Even in development, unintentional termination of EC2 instances can delay project timelines or delivery. If ec2:TerminateInstances has a wildcard resource policy ( Resource *) that isn’t scoped with a condition statement such as ec2:ResourceTag, unauthorized EC2 instances might be inadvertently terminated. |
For unauthorized principals, either remove ec2:TerminateInstances or appropriately scope with Condition keys. Remove ec2:TerminateIntances for unauthorized principals. |
|
ec2:TerminateInstances
|
IAM-EC2-5 |
Check that only authorized principals can manage security groups. |
A security group acts as a virtual firewall for your instance to control inbound and outbound traffic. Security groups act at the instance level, not the subnet level. Thus, security groups are one piece to providing network perimiter protection. |
For unauthorized principals, remove the permissions to invoke security group IAM actions. |
https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
|
ec2:AuthorizeSecurityGroupEgress ec2:AuthorizeSecurityGroupIngress ec2:ApplySecurityGroupsToClientVpnTargetNetwork ec2:CreateSecurityGroup ec2:DeleteSecurityGroup ec2:RevokeSecurityGroupEgress ec2:RevokeSecurityGroupIngress ec2:UpdateSecurityGroupRuleDescriptionsEgress ec2:UpdateSecurityGroupRuleDescriptionsIngress
|