ScaleSec / terraform_aws_scp

AWS Organizations Service Control Policies (SCPs) written in HashiCorp Terraform.
Other
231 stars 44 forks source link

Preventing AMIs from becoming public #57

Closed KevinHock closed 3 years ago

KevinHock commented 4 years ago

I know that https://github.com/ScaleSec/terraform_aws_scp/blob/main/security_controls_scp/modules/ec2/deny_public_ami.tf "Denies users the ability to launch EC2 instances with public AMIs.", but perhaps it's possible to stop it before it is made public.

ModifyImageAttribute is the action, --launch-permission "Add=[{Group=all}]" seems to be the condition.

https://docs.aws.amazon.com/cli/latest/reference/ec2/modify-image-attribute.html#examples

jdyke commented 3 years ago

ModifyImageAttribute does not support condition keys at this time

image

KevinHock commented 3 years ago

Thank you @jdyke ! ❤️