Review Network Firewall use in the VPC

Choose VPC firewall controls for the traffic inspection you need.

Description

Check whether the workload needs additional inspection beyond its security groups, network ACLs and any central inspection path.

Potential impact

A firewall policy cannot block traffic that bypasses its endpoints.

Remediation

If you need AWS Network Firewall, select its policy and firewall subnets. For stateful inspection, route requests and replies through the same endpoint.

Examples

The second excerpt adds a firewall to aws_vpc.example and references a policy and subnet. Configure the routes to its endpoint separately.

Before

hcl
resource "aws_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}

After

hcl
resource "aws_vpc" "example" {
  cidr_block = "10.0.0.0/16"
}

resource "aws_networkfirewall_firewall" "example" {
  name                = "example"
  firewall_policy_arn = aws_networkfirewall_firewall_policy.example.arn
  vpc_id              = aws_vpc.example.id

  subnet_mapping {
    subnet_id = aws_subnet.example.id
  }

  tags = {
    Tag1 = "Value1"
    Tag2 = "Value2"
  }
}

References