Skip to content

Files

Latest commit

 

History

History
42 lines (29 loc) · 1.12 KB

aws-ec2-no-excessive-port-access.md

File metadata and controls

42 lines (29 loc) · 1.12 KB

Pattern: Excessive port access for AWS EC2

Issue: -

Description

Ensure access to specific required ports is allowed, and nothing else.

Resolution: Set specific allowed ports.

Examples

The following example will fail the aws-ec2-no-excessive-port-access check.

 resource "aws_network_acl_rule" "bad_example" {
   egress         = false
   protocol       = "all"
   rule_action    = "allow"
   cidr_block     = "0.0.0.0/0"
 }
 

The following example will pass the aws-ec2-no-excessive-port-access check.

 resource "aws_network_acl_rule" "good_example" {
   egress         = false
   protocol       = "tcp"
   from_port      = 22
   to_port        = 22
   rule_action    = "allow"
   cidr_block     = "0.0.0.0/0"
 }
 

Further reading