resource "aws_network_acl" "acl-02c1baf6cad4cc33e" {
  #checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  vpc_id = "vpc-0c3d88ad57c642489"
}

resource "aws_network_acl" "acl-039cc4eba42e4957e" {
  #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  = "-1"
    icmp_type  = "-1"
    protocol   = "1"
    rule_no    = "111"
    to_port    = "0"
  }

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

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

  ingress {
    action     = "allow"
    cidr_block = "10.11.117.64/27"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "7"
    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.12.246.64/27"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "2"
    to_port    = "0"
  }

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

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

  subnet_ids = ["subnet-05fd550bb89383422", "subnet-08b089699be9c353c"]

  tags = {
    Name    = "MCSEC-P1-RDS-NACL"
    Project = "DEL"
  }

  tags_all = {
    Name    = "MCSEC-P1-RDS-NACL"
    Project = "DEL"
  }

  vpc_id = "vpc-0c3d88ad57c642489"
}

resource "aws_network_acl" "acl-08f13ff95a00c198a" {
  #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  = "-1"
    icmp_type  = "-1"
    protocol   = "1"
    rule_no    = "344"
    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 = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "120"
    to_port    = "0"
  }

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

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

  ingress {
    action     = "allow"
    cidr_block = "54.221.196.0/24"
    from_port  = "4118"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "304"
    to_port    = "4118"
  }

  subnet_ids = ["subnet-019eda3d2da6d1140", "subnet-0e55b77e7fc07a732"]

  tags = {
    Name    = "MCSEC-P1-PUB-NACL"
    Project = "DEL"
  }

  tags_all = {
    Name    = "MCSEC-P1-PUB-NACL"
    Project = "DEL"
  }

  vpc_id = "vpc-0c3d88ad57c642489"
}

resource "aws_network_acl" "acl-0a1fb2264ec6a02cf" {
  #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  = "-1"
    icmp_type  = "-1"
    protocol   = "1"
    rule_no    = "12"
    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 = "10.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "4"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "160.33.0.0/16"
    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 = "172.0.0.0/8"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "10"
    to_port    = "0"
  }

  ingress {
    action     = "allow"
    cidr_block = "172.29.16.0/21"
    from_port  = "6432"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "9"
    to_port    = "6432"
  }

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

  ingress {
    action     = "allow"
    cidr_block = "52.29.93.229/32"
    from_port  = "8001"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "11"
    to_port    = "8001"
  }

  ingress {
    action     = "allow"
    cidr_block = "54.221.196.0/24"
    from_port  = "4118"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "5"
    to_port    = "4118"
  }

  subnet_ids = ["subnet-0769f5e072fd5f71c", "subnet-0b3ba946ae21cf94f"]

  tags = {
    Name    = "MCSEC-P1-APP-NACL"
    Project = "DEL"
  }

  tags_all = {
    Name    = "MCSEC-P1-APP-NACL"
    Project = "DEL"
  }

  vpc_id = "vpc-0c3d88ad57c642489"
}
