AWS Network Firewall

A managed, VPC-wide firewall and IPS that inspects traffic from Layer 3 to Layer 7, in any direction. It is the answer to "protect the entire VPC in a sophisticated way" — beyond what a security group or NACL can express, and deeper into the network than WAF reaches.

Một firewall và IPS quản lý ở cấp toàn VPC, soi traffic từ Layer 3 tới Layer 7, theo mọi hướng. Đây là đáp án cho "bảo vệ cả VPC một cách tinh vi" — vượt xa những gì security group hay NACL diễn đạt được, và đi sâu vào mạng hơn tầm với của WAF.

The things that make it exam-recognisable: it can filter by domain and protocol, does intrusion prevention, uses the Gateway Load Balancer internally, and deploys as a central inspection VPC behind a Transit Gateway.

Những điểm nhận diện trong đề: lọc được theo domain và protocol, làm ngăn chặn xâm nhập (IPS), dùng Gateway Load Balancer bên trong, và triển khai thành một inspection VPC tập trung phía sau Transit Gateway.

Where it sits — the network-protection familyNó nằm ở đâu — họ công cụ bảo vệ mạng

AWS network protection is a stack of tools at different layers. Network Firewall is the VPC-wide, L3–L7, any-direction one — it does not replace the others, it sits above them. Know which question each answers. Bảo vệ mạng trên AWS là một chồng công cụ ở các tầng khác nhau. Network Firewall là cái ở cấp toàn VPC, L3–L7, mọi hướng — nó không thay thế các cái kia, mà đứng trên chúng. Nhớ mỗi cái trả lời câu hỏi nào.

ToolCông cụ Scope & layerPhạm vi & tầng AnswersTrả lời cho
Security GroupSecurity Group per ENI / instance · stateful · allow-only · L4theo ENI / instance · stateful · chỉ allow · L4 who may reach this instanceai được tới instance này
NACL per subnet · stateless · allow + deny · L4theo subnet · stateless · allow + deny · L4 coarse allow/deny at the subnet edgeallow/deny thô ở biên subnet
WAF L7 HTTP on CloudFront / ALB / API GatewayL7 HTTP trên CloudFront / ALB / API Gateway malicious web requests (SQLi, XSS, rate)request web độc hại (SQLi, XSS, rate)
Shield edge · DDoS protectionedge · chống DDoS volumetric / DDoS attackstấn công DDoS / volumetric
Firewall ManagerFirewall Manager org-wide policy managerquản lý policy toàn tổ chức manage WAF/SG/Network Firewall across accountsquản lý WAF/SG/Network Firewall xuyên account
Network FirewallNetwork Firewall whole VPC · L3–L7 · any direction · stateful + IPScả VPC · L3–L7 · mọi hướng · stateful + IPS sophisticated whole-VPC filtering: domains, protocols, threatslọc cả VPC tinh vi: domain, protocol, mối đe doạ

What it inspects — any direction, L3 to L7Nó soi gì — mọi hướng, L3 tới L7

You route the traffic you want inspected through the firewall. It can sit on any path in or out of the VPC: to and from the internet, to a peered VPC, and to and from Direct Connect or Site-to-Site VPN. Bạn định tuyến traffic cần soi đi xuyên qua firewall. Nó đặt được trên bất kỳ đường vào/ra VPC: đi/đến internet, tới VPC đã peer, và đi/đến Direct Connect hoặc Site-to-Site VPN.

AWS Network Firewall inspecting traffic in every direction. On the left, your VPC with private subnets. In the centre, a red AWS Network Firewall band that all traffic passes through, labelled Layer 3 to Layer 7. On the right, the four things it inspects traffic to and from: the internet, a peered VPC, Direct Connect, and Site-to-Site VPN. Every path between the VPC and those destinations crosses the firewall. Internally it uses the AWS Gateway Load Balancer, fully managed by AWS. route any path through it — inbound, outbound, VPC-to-VPC, VPN/DX Your VPC private subnets workloads AWS Network Firewall L3 → L7 uses Gateway Load Balancer internet (in & out) peered VPC Direct Connect Site-to-Site VPN every arrow crosses the firewall · fully managed (no appliances to run)

Think of it as a checkpoint you can place on any road in or out of the VPC. Unlike a security group (tied to an ENI) or WAF (tied to an HTTP entry point), the firewall inspects whole flows regardless of direction — which is why "inspect VPC-to-VPC and egress traffic centrally" points straight here.

Coi nó như một trạm kiểm soát đặt được trên bất kỳ con đường vào/ra VPC. Khác security group (gắn vào ENI) hay WAF (gắn vào điểm vào HTTP), firewall soi cả luồng bất kể hướng nào — nên đề "soi traffic VPC-với-VPC và egress một cách tập trung" là trỏ thẳng vào đây.

Fine-grained controls — rules, actions, loggingKiểm soát chi tiết — rule, action, logging

Thousands of rules, matched however you need, each with an action of allow / drop / alert. Plus active flow inspection (intrusion prevention) against known network threats. Rule-match logs stream to S3, CloudWatch Logs, or Firehose. Hàng nghìn rule, khớp theo mọi kiểu bạn cần, mỗi rule có action allow / drop / alert. Kèm active flow inspection (ngăn chặn xâm nhập) chống các mối đe doạ mạng đã biết. Log rule khớp đẩy tới S3, CloudWatch Logs, hoặc Firehose.

IP & portIP & port Filter on addresses and ports at scale — e.g. tens of thousands of IPs in a block list.Lọc theo địa chỉ và cổng ở quy mô lớn — ví dụ hàng chục nghìn IP trong danh sách chặn.
ProtocolProtocol Allow/block by protocol — e.g. block the SMB protocol for outbound communications.Cho/chặn theo protocol — ví dụ chặn giao thức SMB cho traffic đi ra.
Stateful domain listsStateful domain list Allow outbound only to *.mycorp.com or an approved software repo — domain-based egress control.Chỉ cho ra *.mycorp.com hoặc repo phần mềm được duyệt — kiểm soát egress theo domain.
Regex patternsMẫu regex General pattern matching on traffic with regular expressions.Khớp mẫu tổng quát trên traffic bằng biểu thức chính quy.
ActionsAction For matching traffic: allow, drop, or alert (log without blocking).Với traffic khớp: allow, drop, hoặc alert (ghi log mà không chặn).
Active flow inspection (IPS)Active flow inspection (IPS) Intrusion-prevention against network threats — like a Gateway Load Balancer appliance, but AWS-managed.Ngăn chặn xâm nhập trước các mối đe doạ mạng — như một appliance Gateway Load Balancer, nhưng do AWS quản lý.
Domain-based egress is the signature use caseEgress theo domain là use case đặc trưng "Instances may only reach *.mycorp.com and our package repo, nothing else on the internet" is a stateful domain list — and it is the classic Network Firewall question, because neither a security group (no domains, no egress-by-name) nor WAF (HTTP entry points only) can express it. "Instance chỉ được tới *.mycorp.com và repo gói của chúng ta, ngoài ra không được ra internet" chính là một stateful domain list — và là câu hỏi Network Firewall kinh điển, vì cả security group (không có domain, không lọc egress theo tên) lẫn WAF (chỉ ở điểm vào HTTP) đều không diễn đạt nổi.

Central architecture — inspection VPC + Transit GatewayKiến trúc tập trung — inspection VPC + Transit Gateway

At scale you don't put a firewall in every VPC. You route everything through a Transit Gateway to one shared inspection VPC that holds the Network Firewall, then back out. That covers North-South (egress to internet, to VPN/DX) and East-West (VPC-to-VPC) from a single place. Ở quy mô lớn, bạn không đặt firewall vào mọi VPC. Bạn định tuyến mọi thứ qua một Transit Gateway tới một inspection VPC dùng chung chứa Network Firewall, rồi quay ra. Cách đó phủ cả Bắc-Nam (ra internet, tới VPN/DX) lẫn Đông-Tây (VPC-với-VPC) từ một chỗ duy nhất.

Centralised AWS Network Firewall architecture, following the AWS reference diagram. VPC 1 on 10.0.1.0/24 (top left) and VPC 2 on 10.0.2.0/24 (bottom left) each have instances. An AWS Transit Gateway sits in the centre. An Egress VPC on 192.168.0.0/24 at the top holds a NAT Gateway then an Internet Gateway then the internet. An Inspection VPC on 192.168.1.0/26 on the right holds the AWS Network Firewall. A VPN Connection and an AWS Direct Connect Gateway are at the bottom. Three coloured flows all leave VPC 1's instances into the Transit Gateway, hairpin across to the AWS Network Firewall and back to the Transit Gateway, and then go out to their destination: red is North-South egress to the internet, going up to the Egress VPC's NAT Gateway, Internet Gateway and out to the internet; yellow is North-South to the VPN Connection or Direct Connect Gateway at the bottom; blue is East-West VPC to VPC, returning to VPC 2. Everything attaches to the Transit Gateway; the firewall is the hairpin that every flow crosses. each flow: VPC → TGW → firewall → back to TGW → destination North-South · VPC egress to the internet North-South · VPC to VPN or Direct Connect East-West · VPC to VPC Egress VPC · 192.168.0.0/24 NAT GW IGW internet VPC 1 · 10.0.1.0/24 Instances VPC 2 · 10.0.2.0/24 Instances AWS Transit Gateway Inspection VPC · 192.168.1.0/26 AWS Network Firewall VPN Connection AWS Direct Connect Gateway hairpin ↔ inspected here everything attaches to the TGW · the firewall is the hairpin every flow crosses · one firewall protects the fleet

The shape to memorise: workload VPCs attach to a Transit Gateway, which forces traffic through the inspection VPC's firewall before it reaches the internet (via an egress VPC), on-prem (via VPN/DX), or another VPC. One firewall protects everything.

Dáng cần thuộc: các VPC workload gắn vào Transit Gateway, TGW ép traffic đi qua firewall trong inspection VPC trước khi tới internet (qua egress VPC), tới on-prem (qua VPN/DX), hay tới VPC khác. Một firewall bảo vệ tất cả.

Keep the flow symmetricGiữ luồng đối xứng Stateful inspection needs both directions of a flow to hit the same firewall endpoint. In a multi-AZ Transit Gateway design that means enabling appliance mode on the inspection VPC's TGW attachment — otherwise return traffic can land on a different AZ's endpoint and get dropped. Soi stateful cần cả hai chiều của một luồng tới cùng một firewall endpoint. Trong thiết kế Transit Gateway đa AZ, điều đó nghĩa là bật appliance mode trên TGW attachment của inspection VPC — nếu không, traffic chiều về có thể rơi vào endpoint ở AZ khác và bị drop.

Things that catch you outNhững chỗ dễ sập bẫy

  • It is not WAF. WAF filters HTTP requests at CloudFront/ALB/API Gateway; Network Firewall filters whole-VPC L3–L7 traffic. "Block SQL injection on our web app" is WAF; "only allow egress to these domains" is Network Firewall. Nó không phải WAF. WAF lọc request HTTP ở CloudFront/ALB/API Gateway; Network Firewall lọc traffic L3–L7 cả VPC. "Chặn SQL injection trên web app" là WAF; "chỉ cho egress tới các domain này" là Network Firewall.
  • Traffic must be routed to it. The firewall only inspects paths you send through it — via route tables (single VPC) or a Transit Gateway (central). Deploying it does nothing until routing points at it. Phải định tuyến traffic tới nó. Firewall chỉ soi những đường bạn gửi qua nó — bằng route table (một VPC) hoặc Transit Gateway (tập trung). Dựng lên mà chưa trỏ route thì chưa làm gì cả.
  • Stateful needs symmetric routing. Multi-AZ central designs need appliance mode on the TGW attachment, or return packets miss the firewall and drop. Stateful cần định tuyến đối xứng. Thiết kế tập trung đa AZ cần appliance mode trên TGW attachment, nếu không gói chiều về lệch khỏi firewall và bị drop.
  • Alert ≠ block. An alert action logs a match without stopping it — useful for tuning, but it is not protection until you switch matching rules to drop. Alert ≠ chặn. Action alert ghi log một match mà không chặn — hữu ích để tinh chỉnh, nhưng chưa phải bảo vệ cho tới khi bạn đổi rule khớp sang drop.
  • Firewall Manager manages, it doesn't inspect. Use Firewall Manager to push Network Firewall rules across accounts; the packet inspection is done by Network Firewall itself. Firewall Manager để quản lý, không soi gói. Dùng Firewall Manager để đẩy rule Network Firewall xuyên account; việc soi gói do chính Network Firewall làm.

Exam reflexesPhản xạ khi thi

The question says…Đề nói… AnswerĐáp án
"Protect the entire VPC, sophisticated, L3–L7, managed""Bảo vệ cả VPC, tinh vi, L3–L7, quản lý sẵn" AWS Network FirewallAWS Network Firewall
"Allow outbound only to *.mycorp.com / approved domains""Chỉ cho ra *.mycorp.com / domain được duyệt" Network Firewall stateful domain listNetwork Firewall stateful domain list
"Block the SMB protocol outbound across the VPC""Chặn giao thức SMB đi ra khắp VPC" Network Firewall protocol ruleNetwork Firewall protocol rule
"Central inspection of VPC-to-VPC and egress traffic""Soi tập trung traffic VPC-với-VPC và egress" Network Firewall in an inspection VPC behind a Transit GatewayNetwork Firewall trong inspection VPC sau Transit Gateway
"Intrusion prevention (IPS) for network threats, managed""Ngăn chặn xâm nhập (IPS) cho mối đe doạ mạng, có quản lý" Network Firewall active flow inspectionNetwork Firewall active flow inspection
"Filter HTTP attacks (SQLi/XSS) on a web app""Lọc tấn công HTTP (SQLi/XSS) trên web app" WAF — not Network FirewallWAF — không phải Network Firewall
"Manage firewall rules across many accounts""Quản lý rule firewall xuyên nhiều account" AWS Firewall ManagerAWS Firewall Manager