ELB listener security group is set to TCP all Affecting ELB service in AWS


Severity

0.0
medium
0
10
    Severity Framework
    Snyk CCSS
    Rule category
    Network / Ports

Is your enviroment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
    Frameworks
    CIS-Controls CSA-CCM ISO-27001 NIST-800-53 PCI-DSS SOC-2
  • Snyk ID SNYK-CC-00198
  • credit Snyk Research Team

Description

Elastic Load Balancing security groups should permit access only to necessary ports to prevent access to potentially vulnerable services on other ports.

How to fix?

Ensure that the aws_security_group associated with a load balancer does not have an ingress block that allows access to all TCP ports.

Invalid configurations:

  • ingress.from_port set to 0 and ingress.to_port set to 65535
  • ingress.protocol set to -1

Example Configuration

resource "aws_security_group" "elb-all-valid-elb-group" {
  name = "elb-all-valid-elb-group"
  description = "ELB All TCP Test"

  ingress {
    from_port = 80
    to_port = 80
    protocol = "tcp"
    cidr_blocks = ["192.169.1.1/32"]
  }
}