AWS Network Firewall now offers automated internet firewall mode (Preview). In this mode, Network Firewall applies your centrally defined rules to traffic at the internet gateway of each of your virtual private clouds (VPCs). It also performs built-in network address translation (NAT) for outbound-only connections. A subnet that reaches the internet needs only one route, directly to the internet gateway. You no longer need to deploy firewall endpoints and NAT gateways in each VPC and configure the routes between them and the subnets. If you’re new to internet traffic inspection, you can start with AWS managed rule groups for Network Firewall. AWS security experts maintain and update these rule groups to help protect your workloads against changing threats. You can deploy these managed rule groups centrally across your environment.
With automated internet firewall mode, you can:
- Inspect traffic at the internet gateway – Each VPC gets its own firewall for inbound and outbound IPv4 and IPv6 traffic, with built-in NAT for outbound-only IPv4 connections.
- Manage centrally, inspect in each VPC – You define policies in AWS Network Security Manager or start from an AWS managed template. Each VPC’s traffic passes its own firewall, so each VPC you add brings its own inspection capacity. The same central policy also works for VPCs with overlapping Classless Inter-Domain Routing (CIDR) ranges.
- Extend coverage to new VPCs – You can create a scope that includes all existing and future VPCs, so your policy applies to new VPCs when teams create them.
In this post, we explain how automated internet firewall mode works and how it fits your existing architecture. We also walk through the steps to deploy it across your environment.
How automated internet firewall mode works
In automated internet firewall mode, Network Firewall applies your rules at the internet gateway of each VPC. Before this launch, inspecting a VPC’s internet traffic meant routing each subnet through a firewall endpoint. Resources that needed outbound-only connectivity also went through a NAT gateway. This mode helps simplify that model by moving inspection to each VPC’s internet gateway. Each subnet now has one route to the internet gateway, where the firewall inspects the traffic and performs built-in NAT (Figure 1).
Figure 1: Outbound traffic before and after automated internet firewall
Each VPC gets its own firewall, not a share of one. When you use VPC endpoint associations to protect multiple VPCs with one firewall, those VPCs share that firewall’s capacity in each Availability Zone. In automated internet firewall mode, each VPC’s firewall supports throughput of up to 100 Gbps in each Availability Zone (Service quotas). It also works when VPCs have overlapping CIDR ranges, because their traffic doesn’t meet in a shared inspection network where the addresses would conflict.
The firewall inspects inbound and outbound traffic. For outbound-only connectivity, the firewall first inspects the traffic and then performs NAT, so your rules and logs see each workload’s private IP address. Built-in NAT translates outbound IPv4 connections from resources without a public IP address, and IPv6 traffic isn’t translated. If your destinations accept only allowlisted source addresses, an Amazon VPC IP Address Manager (IPAM) policy lets you choose the NAT addresses that automated internet firewall mode uses (NAT for outbound traffic).
The firewall uses Network Firewall Next Generation firewall policies. You can start from AWSManagedTemplateIGWFirewallBaseline, an AWS managed template that AWS security experts maintain. You can then add AWS managed rule groups and your own rule groups.
Automated internet firewall mode only inspects traffic that crosses the internet gateway. For traffic between VPCs and to on-premises networks over AWS Direct Connect or AWS Site-to-Site VPN, we recommend a transit gateway-attached Network Firewall.
Subnet connectivity options
Before this launch, a public subnet had a direct route to the internet gateway, and its resources used public IP addresses, so they could connect out and accept inbound connections. A private subnet had no direct route, and its resources reached the internet through a NAT gateway. With automated internet firewall mode, a subnet that reaches the internet can route 0.0.0.0/0 directly to the internet gateway, so the route table no longer separates public from private. Instead, each subnet’s connectivity type decides how its resources reach the internet. You set it in the Network Security Manager policy, not on the subnet. Table 1 maps each type to the model you know.
| Connectivity type | Works like | What happens |
| Flexible (recommended) | A public and a private subnet in one | A resource with a public IP address, such as an Elastic IP address, gets bidirectional access, as in a public subnet. A resource without one gets outbound-only access through built-in NAT, similar to a private subnet. |
| Bidirectional | A public subnet | Resources with a public IP address connect out and accept inbound connections. Resources without one can’t reach the internet. |
| Outbound-only | A private IPv4 subnet behind a NAT gateway, or an IPv6 subnet behind an egress-only internet gateway | Unsolicited inbound connections are dropped. Resources without a public IP address connect out through built-in NAT, and resources with one keep their own address. |
| Excluded | A subnet without a firewall | Traffic bypasses the firewall and built-in NAT. |
The firewall inspects traffic in each type except excluded (Figure 2). Each policy sets one default connectivity type for all subnets in scope. You can override it for specific subnets based on tags or on Amazon Resource Name (ARN). When a subnet matches more than one override, the first one in the list applies.
Figure 2: Flexible, bidirectional, and outbound-only subnets are inspected. Excluded subnets aren’t.
Connectivity types also decide which inbound connections reach your resources. The firewall inspects inbound connections to resources with a public IP address in flexible and bidirectional subnets, such as the Network Load Balancer for a non-HTTP service in Figure 3. Figure 3 also shows the outbound path, where instances without a public IP address connect out through the firewall and then built-in NAT. For web applications and APIs, we still recommend AWS WAF on Amazon CloudFront in front of an Application Load Balancer. You can set that load balancer’s subnet to excluded so Network Firewall doesn’t inspect the same request again. Keep in mind that excluded applies in both directions, so any outbound traffic from that subnet also bypasses the firewall.
Figure 3: Inbound and outbound traffic showing inbound, outbound, and excluded connections
Managing automated internet firewall mode
You manage automated internet firewall mode in AWS Network Security Manager. With AWS Organizations, a central security team deploys policies from the Network Security Manager administrator account to the whole organization, to organizational units (OUs), or to specific accounts. Network Security Manager also supports a single-account model, where it applies policies only to that account’s VPCs. You can start from the Network Firewall console or the Network Security Manager console, but the firewall itself is read-only outside Network Security Manager.
Network Security Manager uses three components (Figure 4):
- Policy – Combines rules and templates with the connectivity type, enforcement mode, logging, and priority. Rules are the building blocks. A traffic inspection rule decides how the firewall handles traffic, and a firewall configuration rule sets options such as the enforcement mode or logging. A template is an ordered, reusable group of rules, such as
AWSManagedTemplateIGWFirewallBaseline, that you can share across policies. - Scope – Selects your organization, OUs, accounts, or VPCs.
- Deployment – Binds a policy to a scope. Network Security Manager then creates and manages a firewall in each VPC in scope.
Figure 4: A deployment binds a policy to a scope, and Network Security Manager creates a firewall in each VPC in scope
This model matters most when you manage many VPCs. Because Network Security Manager applies the policy at the internet gateway, the firewall is designed so that VPC owners and subnet owners without the proper privileges can’t bypass inspection by changing routes. Subnets set to excluded and Availability Zones where automated internet firewall mode isn’t supported aren’t inspected.
Many organizations want one security baseline everywhere, while some accounts, organizational units, or applications need rules in addition to the baseline. To do this, you create two policies, each deployed to its own scope. The organization policy holds a baseline template, and the Account A policy holds the same baseline template plus Account A’s rules (Figure 5). The template lets you maintain the baseline rules once and reuse them in both policies. Where policies overlap, the policy with the lower priority number applies in full, and the policies don’t merge. In Account A, the Account A policy (priority 100) wins over the organization policy (priority 1000), so it must include the baseline template. Its enforcement mode, logging, and connectivity type also replace the organization policy’s. To learn more, see How AWS Network Security Manager works.
Figure 5: The Account A policy, priority 100, takes priority in Account A. Other accounts get the organization policy, priority 1000.
Getting started
We recommend starting in monitor mode, especially in VPCs with existing workloads. In monitor mode, the firewall logs what your rules would do but doesn’t drop traffic because of them. After the logs show the results you expect, switch the policy to enforce. In this example, we create a policy in monitor mode in six steps.
- Start from the AWS Management Console for Network Firewall. On the Firewalls page, open the Internet firewalls tab and choose Create in AWS Network Security Manager. The Quick create and deploy page opens in the Network Security Manager console. Select Network Firewall automated internet firewall as the firewall type.
Figure 6: Create a new internet firewall
- Define protections. Choose Manage templates and add
AWSManagedTemplateIGWFirewallBaseline. Under Enforcement mode, select Monitor, and choose destinations for alert logs and flow logs.
Figure 7: Define protections and set destinations for logs
- Enter a name for the policy and check its Policy priority. Where policies overlap, the lower number takes priority. The new policy gets a priority that evaluates after your existing policies of the same firewall type, and you can change it later in the policy editor.
Figure 8: Set the policy details
- Set the scope. For example, you can set the scope for Accounts and OUs to include the entire organization and the scope for VPCs to include all existing and future VPCs. To learn more about scopes, see How AWS Network Security Manager works.
Figure 9: Set the scope
- Choose the Subnet connectivity type. For example, select Flex (recommended).
Figure 10: Choose the subnet connectivity type
- Review your settings and choose Create and deploy. Cross-account visibility lets Network Security Manager see resources in the accounts in the scope.
Figure 11: Review and deploy
Network Security Manager then creates a firewall at the internet gateway of each VPC in scope. For the full steps, including the organization baseline with account-specific rules, see Getting started with automated internet firewall.
Migrating existing VPCs to automated internet firewall mode
When you deploy automated internet firewall mode to an existing VPC, you might not need to change routes on day one. With the flexible type, the firewall inspects existing resources and keeps the addresses they already use (Figure 12):
- Instance with an Elastic IP address – The firewall inspects its traffic, and the instance keeps its Elastic IP address.
- Instance behind a NAT gateway – The firewall inspects the traffic after the NAT gateway translates it and doesn’t translate it again. Your rules and logs see the NAT gateway’s private IP address as the source.
- Instance with no public IP address in a subnet that routes to the internet gateway – The firewall inspects its traffic, and built-in NAT gives it outbound-only access, which it didn’t have before. To keep resources without a public IP address isolated from the internet, set the subnet’s connectivity type to bidirectional instead. Resources with a public IP address then keep bidirectional connectivity, and resources without one can’t reach the internet.
Figure 12: Day-one source addresses in an existing VPC with Flexible subnets
Later, at your own pace, you can retire each NAT gateway by routing its subnets directly to the internet gateway. Built-in NAT then takes over. The source address changes to one that automated internet firewall mode assigns or one from your IPAM policy pool, so update allow lists that name the NAT gateway’s address first. Your logs then show each workload’s private IP address. If you inspect inbound or outbound internet traffic today with Network Firewall endpoints, automated internet firewall mode can take over that inspection. After you confirm that your new policy covers the same rules, you can remove the endpoints and routes that you use for internet traffic. For each architecture, see Working with existing architectures.
Availability and pricing
Automated internet firewall mode (Preview) is available in all AWS commercial Regions. For pricing, see AWS Network Firewall pricing. During the preview, some features and instance types aren’t supported. For the list, see Automated internet firewall. Features, service quotas, and console labels can change during the preview. Your use of the preview is subject to the Betas and Previews section of the AWS Service Terms.
Conclusion
In this post, we showed you how automated internet firewall mode applies Network Firewall inspection and built-in NAT at the internet gateway of your VPCs. You define and control policies centrally in Network Security Manager. It is designed so that VPC owners without the proper privileges can’t route around it, and your policy applies to new VPCs in scope when teams create them. To learn more, see Automated internet firewall in the Network Firewall Developer Guide.
If you have questions about this post, contact AWS Support or start a new thread on AWS re:Post.
