resource "aws_network_acl" "acl-064e312a02d7f9e59" {
  #checkov:skip=CKV2_AWS_1: Ensure that all NACL are attached to subnets
  vpc_id = "vpc-0908d36b53ddf49ab"
}

resource "aws_network_acl" "acl-0d64cf0b114c51230" {
  #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-0980df54c744296e3", "subnet-0a5c6edf4a1f35f8a", "subnet-0f95e8ce9e3b7dba7"]

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

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

  vpc_id = "vpc-0908d36b53ddf49ab"
}

resource "aws_network_acl" "acl-0d670d8dc488bcd12" {
  #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 = "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-032f1787f7038bc6b", "subnet-063b31a3bf3569f5b"]

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

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

  vpc_id = "vpc-0908d36b53ddf49ab"
}

resource "aws_network_acl" "acl-0eccda57e5d97bd80" {
  #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    = "3"
    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"
  }

  subnet_ids = ["subnet-0107c4277f70d5b99", "subnet-042b194db0940aab3"]

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

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

  vpc_id = "vpc-0908d36b53ddf49ab"
}
