resource "aws_network_acl" "acl-072f8d159076b4450" {
  # 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    = "100"
    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    = "300"
    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    = "200"
    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    = "301"
    to_port    = "443"
  }

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

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

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

  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 = "10.11.113.0/26"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "1"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.11.113.128/26"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "305"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "10.11.176.192/27"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "89"
    to_port    = "0"
  }

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

  subnet_ids = ["subnet-037445b9354c33764", "subnet-044489ff0e602a228", "subnet-05a08dd6751dfb4f3", "subnet-085ad4bf749412a9c", "subnet-091d415e84d3ad6ae", "subnet-0e268ae5a00809daa", "subnet-0fff313ff187a1d15"]

  tags = {
    Name    = "GRPS-D2-PUB-NACL"
    Project = "DEL"
  }

  tags_all = {
    Name    = "GRPS-D2-PUB-NACL"
    Project = "DEL"
  }

  vpc_id = "vpc-0a688f309559be28f"
}

resource "aws_network_acl" "acl-0ad9e24ad7fadd8b8" {
  # checkov:skip=CKV2_AWS_1:Ensure that all NACL are attached to subnets
  tags = {
    Name = "GRPS-D2-DEFAULT"
  }

  tags_all = {
    Name = "GRPS-D2-DEFAULT"
  }

  vpc_id = "vpc-0a688f309559be28f"
}

resource "aws_network_acl" "acl-0c231a521e9af3660" {
  # 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    = "100"
    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    = "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    = "3"
    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    = "4"
    to_port    = "443"
  }

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

  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 = "172.34.23.0/24"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "6"
    to_port    = "0"
  }

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

  subnet_ids = ["subnet-0527845886cfd91e1", "subnet-066e66ae2e940b71a", "subnet-07b033204f1a9028b", "subnet-084454866899874e0", "subnet-084fff3deeba8d595", "subnet-0c6709abf71b43246", "subnet-0fe077bb20ec8bbb1", aws_subnet.GRPS-D2-IAPP-1A.id, aws_subnet.GRPS-D2-IAPP-1B.id, aws_subnet.GRPS-D2-IAPP-1C.id, aws_subnet.GRPS-D2-XEKS-251-1A.id, aws_subnet.GRPS-D2-XEKS-251-1B.id]

  tags = {
    Name    = "GRPS-D2-APP-NACL"
    Project = "DEL"
  }

  tags_all = {
    Name    = "GRPS-D2-APP-NACL"
    Project = "DEL"
  }

  vpc_id = "vpc-0a688f309559be28f"
}
