resource "aws_network_acl" "acl-016fbe498291e100b" {
  #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 = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "2"
    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  = "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    = "5"
    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    = "6"
    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    = "7"
    to_port    = "0"
  }

  subnet_ids = ["subnet-0233663b2f739f323", "subnet-03ef80e640c887b3b", "subnet-0c9119f3d13572a90", "subnet-0eeaa50c1a984327c", "subnet-00ac3353a516939db", "subnet-05749b4b2a01954fb", aws_subnet.MSRV-D2-XAPP-1A.id, aws_subnet.MSRV-D2-XAPP-1B.id]

  tags = {
    Business-unit = "Delivery-Media-Services"
    Environment   = "DEV2"
    Name          = "MSRV-D2-APP-NACL"
    Owner         = "Mandar Padsalgikar"
    Project-code  = "SME - 2000-0306G"
    Project-name  = "Delivery_Media_Services"
  }

  tags_all = {
    Business-unit = "Delivery-Media-Services"
    Environment   = "DEV2"
    Name          = "MSRV-D2-APP-NACL"
    Owner         = "Mandar Padsalgikar"
    Project-code  = "SME - 2000-0306G"
    Project-name  = "Delivery_Media_Services"
  }

  vpc_id = "vpc-0c5e47df523da268c"
}

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

  tags_all = {
    Name = "MSRV-D2-DEFAULT-NACL"
  }

  vpc_id = "vpc-0c5e47df523da268c"
}

resource "aws_network_acl" "acl-050d86c81a9a8bcb2" {
  #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 = "0.0.0.0/0"
    from_port  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "17"
    rule_no    = "2"
    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  = "80"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "6"
    rule_no    = "5"
    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-088a45ea7e660e244", "subnet-0d5a11600a7ae68b4", "subnet-0e56cd20eb3dbbef6"]

  tags = {
    Business-unit = "Delivery-Media-Services"
    Environment   = "DEV2"
    Name          = "MSRV-D2-PUB-NACL"
    Owner         = "Mandar Padsalgikar"
    Project-code  = "SME - 2000-0306G"
    Project-name  = "Delivery_Media_Services"
  }

  tags_all = {
    Business-unit = "Delivery-Media-Services"
    Environment   = "DEV2"
    Name          = "MSRV-D2-PUB-NACL"
    Owner         = "Mandar Padsalgikar"
    Project-code  = "SME - 2000-0306G"
    Project-name  = "Delivery_Media_Services"
  }

  vpc_id = "vpc-0c5e47df523da268c"
}

resource "aws_network_acl" "acl-053bd33a9cbb3b16d" {
  #checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  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  = "0"
    icmp_code  = "0"
    icmp_type  = "0"
    protocol   = "-1"
    rule_no    = "2"
    to_port    = "0"
  }

  subnet_ids = ["subnet-04515d844e4006963", "subnet-0e017e6937c51813c"]

  tags = {
    Business-unit = "Delivery-Media-Services"
    Environment   = "DEV2"
    Name          = "MSRV-D2-RDS-NACL"
    Owner         = "Mandar Padsalgikar"
    Project-code  = "SME - 2000-0306G"
    Project-name  = "Delivery_Media_Services"
  }

  tags_all = {
    Business-unit = "Delivery-Media-Services"
    Environment   = "DEV2"
    Name          = "MSRV-D2-RDS-NACL"
    Owner         = "Mandar Padsalgikar"
    Project-code  = "SME - 2000-0306G"
    Project-name  = "Delivery_Media_Services"
  }

  vpc_id = "vpc-0c5e47df523da268c"
}

