resource "aws_network_acl" "acl-02f85f85615d7b716" {
  #checkov:skip=CKV_AWS_231: Ensure no NACL allow ingress from 0.0.0.0:0 to port 3389
  egress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "99"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "6"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "5"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "8"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "35.159.2.37/32"
    from_port  = "22"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "10"
    to_port    = "22"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "80"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "9"
    to_port    = "80"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "2"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "162.49.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "3"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "192.168.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "4"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "52.29.227.44/32"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "7"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "52.28.185.218/32"
    from_port  = "22"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "11"
    to_port    = "22"
  }
  subnet_ids = ["subnet-05b72433dd34a6b9c", "subnet-081aec8de9e5335b3", "subnet-6f84b707", "subnet-7d502f07", "subnet-0f9b23aee0562f66b", aws_subnet.DEL-P2-IDMZ-1A.id, aws_subnet.DEL-P2-XEKS-EXT-1A.id, aws_subnet.DEL-P2-XEKS-EXT-1B.id, ]

  tags = {
    Name = "DEL-P2-PUB-ACL"
  }

  tags_all = {
    Name = "DEL-P2-PUB-ACL"
  }

  vpc_id = "vpc-de483db6"
}

resource "aws_network_acl" "acl-0aef9f28042d00396" {
  #checkov:skip=CKV_AWS_231: Ensure no NACL allow ingress from 0.0.0.0:0 to port 3389
  egress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "9"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "3"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "2"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "443"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "5"
    to_port    = "443"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "80"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "4"
    to_port    = "80"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "6"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "162.49.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "7"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "192.168.0.0/16"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "8"
    to_port    = "0"
  }

  subnet_ids = ["subnet-0283b4e92ceb4c06d", "subnet-0456356040d401324", "subnet-04beedb43c6b6a7ac", "subnet-0784b76f", "subnet-08595f42", "subnet-0bf6eebc4b2f838b3", "subnet-0dd66e5e8212ea8f6", "subnet-f14f308b", aws_subnet.DEL-P2-XEKS-INT-1A.id, aws_subnet.DEL-P2-XEKS-INT-1B.id]

  tags = {
    Name = "DEL-P2-APP-ACL"
  }

  tags_all = {
    Name = "DEL-P2-APP-ACL"
  }

  vpc_id = "vpc-de483db6"
}

resource "aws_network_acl" "acl-0f53910f9ac0edb5d" {
  #checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  #checkov:skip=CKV_AWS_231: Ensure no NACL allow ingress from 0.0.0.0:0 to port 3389
  egress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "1"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.0.0.0/8"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "2"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "162.49.169.189/32"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "3"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.27.0/24"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "4"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.34.29.0/26"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "5"
    to_port    = "65535"
  }

  ingress {
    action     = "allow"
    cidr_block = "0.0.0.0/0"
    from_port  = "1024"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "6"
    to_port    = "65535"
  }

  subnet_ids = ["subnet-03e8af36ccc0a1022", "subnet-05a2ce56bab8f05f6", "subnet-c88ab9a0"]

  tags = {
    Name = "DEL-P2-RDS-ACL"
  }

  tags_all = {
    Name = "DEL-P2-RDS-ACL"
  }

  vpc_id = "vpc-de483db6"
}

resource "aws_network_acl" "acl-d56f35bd" {
  #checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  tags = {
    App           = "Delivery"
    Business-unit = "Delivery-Services"
    Environment   = "prod"
    Name          = "DEL-P2-DEFAULT-NACL"
    Owner         = "Robert Dewilder"
    Project-code  = "SME -2000-0306B"
  }

  tags_all = {
    App           = "Delivery"
    Business-unit = "Delivery-Services"
    Environment   = "prod"
    Name          = "DEL-P2-DEFAULT-NACL"
    Owner         = "Robert Dewilder"
    Project-code  = "SME -2000-0306B"
  }

  vpc_id = "vpc-de483db6"
}
