If you leave your cloud network unprotected, a single clever attack can bring your entire business to a halt, costing millions and destroying your reputation. That is why AWS offers three powerful, layered security services—WAF, Network Firewall, and Shield—to defend your infrastructure from the most common and devastating network-level threats. Understanding how these tools work together is not just theoretical; it is the foundation of every secure architecture you will design as an AWS Advanced Networking Specialist.
Jump to a section
A simple way to picture Network Security Implementation: WAF, Network Firewall, and Shield
The Head of Security at a busy city nightclub. They are responsible for protecting the venue and its patrons from trouble, using a layered approach that mirrors AWS network security. First, there is the bouncer at the front door, who checks IDs and guest lists—this is like AWS WAF (Web Application Firewall). The bouncer only looks at the person (the web request) and checks if they are on the approved list or are known troublemakers. If someone gets past the bouncer, they enter the main hallway where a second security guard monitors everyone's behaviour and checks bags for weapons. This is the AWS Network Firewall, which inspects all traffic (the people) moving deeper into the venue, looking for malicious patterns or prohibited items. Finally, if a fight breaks out or a glass gets smashed, the head of security calls in a specialised team to deal with the threat and ensure the venue stays open—this is AWS Shield, which protects against large-scale, volumetric attacks aimed at shutting the whole place down. The head of security coordinates all three layers, just as a network architect configures WAF, Network Firewall, and Shield together for comprehensive defence.
The key insight is that these are not redundant systems; each handles a specific layer of the problem. The bouncer (WAF) stops known attackers at the door. The hallway guard (Network Firewall) catches anything the bouncer missed. The specialist team (Shield) handles emergencies that threaten the entire building. A nightclub that only has a door bouncer will get overwhelmed by a riot, just as a web application protected only by WAF can be taken down by a massive DDoS (Distributed Denial of Service) attack that Shield is designed to absorb.
Let us break down network security on AWS from the ground up. Imagine your cloud infrastructure is a private estate with several buildings. You need to control who comes in the front gate, what they do once inside the main grounds, and protect against a massive storm that could flatten everything.
The first layer is the front gate guard: AWS WAF (Web Application Firewall). WAF protects your web applications (like a website or an API, which is a way for programs to talk to each other) from common attacks that exploit the application itself. For example, a common attack is an SQL injection, where an attacker types malicious database commands into a form on your website. WAF inspects the web request (the HTTP or HTTPS data) and blocks it if it matches a known malicious pattern. You configure WAF with rules—for instance, block all traffic from a specific country, or block requests that contain SQL commands. WAF operates at Layer 7 of the OSI model (the application layer), which is the layer that humans and applications interact with directly. It is incredibly fast and stateless in the sense that each request is inspected individually, but clever attackers can still bypass simple WAF rules by crafting requests that look normal but are dangerous.
The second layer is the estate's internal security patrol: AWS Network Firewall. This is not just for web traffic; it protects your entire Virtual Private Cloud (VPC), which is your private, isolated section of the AWS cloud. Traffic inside your VPC can be between different servers (EC2 instances), between a server and a database, or going out to the internet. Network Firewall inspects all this traffic at Layer 3 (network layer, IP addresses) and Layer 4 (transport layer, ports like TCP/UDP). It can do stateful inspection, meaning it remembers the state of a connection—so if a server sends a packet asking for data, the firewall knows that the returning packet is part of the same legitimate conversation and allows it through. It can also block traffic based on domain names, block malicious IP addresses from threat intelligence feeds (lists of known bad actors), and perform intrusion prevention (deep packet inspection to find malware in the traffic itself). Think of it as the guard who walks through the estate, not just checking IDs at the gate, but also looking at what people are carrying and where they are going.
The third layer is the storm shelter: AWS Shield. Shield is a managed DDoS (Distributed Denial of Service) protection service. A DDoS attack is when an attacker floods your network or application with so much garbage traffic that it becomes overwhelmed and cannot serve legitimate users—like a mob of hundreds of people rushing the gate all at once. Shield Standard is included automatically for every AWS customer at no extra cost; it protects against the most common, low-level DDoS attacks (like SYN floods or UDP reflection attacks). Shield Advanced is a paid service that gives you almost unlimited capacity to absorb the largest attacks, plus access to the AWS DDoS Response Team (DRT) who will help you mitigate the attack in real-time. Shield sits at the very edge of the AWS network, before traffic even reaches your VPC or your WAF. Its job is to absorb and filter out the volumetric garbage so that only clean traffic reaches your other security layers.
Why do you need all three? Because each layer covers a different attack surface. WAF only handles web application attacks (Layer 7). Network Firewall can handle non-web traffic (like SSH or database connections) and inspect deeper into packets. Shield is your last line of defence against the kind of attack that can knock your entire internet connection offline. A skilled attacker might try all three: a DDoS to distract you, then a SQL injection attack at the application layer. If you only have Shield, the SQL injection might get through. If you only have WAF, the DDoS might take you down before WAF even sees the traffic. Layering them is the essence of a 'defence in depth' strategy.
Here is how they interact in a typical AWS architecture:
CloudFront (AWS's content delivery network, CDN) or an Application Load Balancer (ALB) receives internet traffic.
Shield (Standard or Advanced) runs at the edge, before CloudFront/ALB, filtering out the volumetric attacks.
WAF is attached to CloudFront or the ALB, inspecting the remaining clean traffic for application-level attacks.
Traffic then passes to the Network Firewall inside the VPC, which inspects it further, especially if it is not web traffic or if it needs to be routed to different internal resources.
This layered approach ensures that even if one service is bypassed or overwhelmed, another is there to catch the threat. On the ANS-C01 exam, you must understand the specific responsibilities of each service and when to use them together versus standalone.
Identify the attack surface
Map out all the entry points to your AWS environment: web application endpoints (ALB, CloudFront, API Gateway), non-web services (SSH, database ports), and the overall internet bandwidth. This determines which AWS security services you need to deploy. Weakness here leads to blind spots in protection.
Enable AWS Shield Advanced (if required)
Attach AWS WAF to your web application endpoints
Associate a WAF web ACL with your CloudFront distribution, ALB, or API Gateway. Then add managed rule groups for common attacks (SQL injection, XSS, IP reputation) and custom rules for rate limiting and geographic blocking. This filters malicious application traffic at Layer 7.
Deploy AWS Network Firewall in your VPC
Create a Firewall policy with stateful and stateless rule groups. Deploy the firewall endpoints in separate subnets. Update your VPC route tables to force traffic between your public and private subnets (and optionally, to the internet) through the firewall. This inspects all internal and east-west traffic.
Configure logging and monitoring
Enable logging for all three services: WAF logs to S3 or CloudWatch, Network Firewall logs to S3 or CloudWatch, and Shield Advanced logs to S3. Set up CloudWatch alarms for anomaly detection (e.g., sudden spike in blocked requests). This provides visibility and enables you to respond quickly to attacks.
Test the security infrastructure
Simulate attacks in a staging environment using AWS-provided or third-party tools (with AWS approval). Verify that WAF blocks SQL injection, Network Firewall blocks malicious domains, and Shield Advanced absorbs a simulated DDoS. This validates that the layers work together and that you have not accidentally blocked legitimate traffic.
You are the cloud security engineer for a fast-growing e-commerce startup called 'ShopSwift', which sells handmade furniture online. The company hosts its main website on AWS using EC2 instances behind an Application Load Balancer, and its customer database is on Amazon RDS (Relational Database Service). The website is global, handling thousands of transactions per day.
One Monday morning, your boss calls you in a panic: the company's main competitor just suffered a massive data breach, and the CEO is terrified that the same will happen to ShopSwift. You have been tasked with implementing robust network security over the next two weeks.
Here is exactly how you, as an IT professional, would use WAF, Network Firewall, and Shield:
First, you enable AWS Shield Advanced immediately. You know that a DDoS attack is the easiest way to shut down an e-commerce site, and even a minute of downtime during a sale could cost thousands. You subscribe to Shield Advanced for the entire AWS Organisation, which protects the ALB, CloudFront (which you also enable for static assets), and your Elastic IPs. You also activate the cost protection feature, so if a DDoS attack causes a spike in your AWS bill, AWS will credit you back.
Second, you deploy AWS WAF on your Application Load Balancer. You are not using CloudFront for the main API yet, so the ALB is the front door. You create a set of rules:
You use the AWS-managed rule groups for SQL injection and cross-site scripting (XSS) to block those attacks out of the box.
You add an IP reputation list rule group that blocks traffic from known malicious IP addresses.
You create a custom rate-based rule: if a single IP makes more than 200 requests per five minutes to your login page, you block that IP for a day. This prevents brute-force login attacks.
You also add a geographic restriction rule to block traffic from countries your business does not serve, reducing the attack surface.
Third, you implement AWS Network Firewall inside your VPC. You place it in a dedicated subnet (the firewall subnet) and route all traffic between your public subnets (where the ALB and web servers live) and your private subnets (where the database lives) through it. This gives you east-west traffic inspection (traffic between servers inside the VPC). You configure stateful rules:
Allow outbound HTTPS traffic from the web servers to the internet (they need to download updates), but block SSH (Secure Shell) from the internet inbound to the web servers entirely.
Implement a domain list rule to block traffic to known malicious domains (using a threat intelligence feed).
Enable intrusion prevention to inspect every packet going to the database server for malicious payloads. If the WAF misses a SQL injection because the attacker encoded it cleverly, the Network Firewall catches it here because it re-assembles the entire stream.
Finally, you test everything. You use the AWS WAF testing tools to simulate attacks. You check CloudWatch metrics for the Network Firewall to see what traffic it is dropping. You run a penetration test (with AWS approval) to confirm that a simulated DDoS is absorbed by Shield Advanced without your website going down.
The result: ShopSwift is now protected against the three biggest threats—volumetric DDoS (Shield), application-layer attacks (WAF), and deep packet-level intrusions (Network Firewall). Your boss sleeps better, and you are ready for the advanced networking concepts on the ANS-C01 exam.
The ANS-C01 exam tests your understanding of these three services not as isolated tools, but as part of an integrated security architecture. You will face scenario-based questions that force you to decide which service to use, in which order, and with which configuration.
Here are the exact concepts the exam loves to test:
First, the exam will ask you to differentiate between the protection scopes of WAF, Network Firewall, and Shield. You will get a single question like: 'Which AWS service can protect against application-layer attacks such as SQL injection on an Application Load Balancer?' The answer is WAF. Another scenario: 'You need to block traffic based on domain names (FQDN) within your VPC.' The answer is Network Firewall. They will also test that Shield Standard protects against common infrastructure-layer attacks, but Shield Advanced is required for Layer 7 DDoS attacks and access to the DRT.
Second, the exam tests the integration points. You must know that AWS WAF can be attached to three resources: CloudFront, Application Load Balancer (ALB), or API Gateway. It cannot be attached directly to EC2 instances or a Network Load Balancer (NLB). If the question says 'protect a TCP-based non-HTTP service', you cannot use WAF; you must use Network Firewall or Security Groups. Similarly, Network Firewall is deployed in a VPC and requires route table entries to direct traffic through it. You need to know that it works at a per-VPC level and cannot inspect traffic that goes to a peered VPC unless you route it through the firewall first.
Third, the exam sets traps around stateful versus stateless inspection. WAF is stateless—it inspects each request individually. Network Firewall is stateful—it tracks connection states. Shield is also stateful in the sense that it monitors traffic patterns over time to detect anomalies. A common trap question will describe a scenario where a legitimate user's multiple requests are being blocked by a rate-based WAF rule during a short time window, and you need to tune the rule to allow burst traffic.
Fourth, the exam tests the concept of 'defence in depth' versus 'single layer of defence.' A typical question: 'Your website is being flooded with traffic that bypasses your WAF. What is the most likely issue?' The correct answer is that you are under a DDoS attack and Shield is not configured or is insufficient. Another trap: 'You need to block a specific IP address at the network level before it reaches your web server.' The correct answer is to use a Network ACL (Not network firewall for a simple IP block, though Network Firewall can do it too—but NACL is the simpler, stateless option). You must know the difference between stateless network ACLs and stateful Security Groups, and where Network Firewall fits between them.
Fifth, the exam will ask about logging and monitoring. You should know that all three services integrate with CloudWatch, AWS Config, and Amazon S3 for logging. WAF has a web ACL logging capability that you send to S3 or CloudWatch. Network Firewall sends logs to S3, CloudWatch, or a Kinesis Data Firehose. Shield Advanced provides DDoS attack reports and a detailed case of what happened. You will be asked to identify which service produces which type of log.
Finally, the exam loves to test fail-open versus fail-close behaviour for Network Firewall. If the firewall fails, does it allow all traffic (fail-open) or block all traffic (fail-close)? You need to know that you can configure the endpoint type, and that the default is fail-close for security. Misconfiguring this is a classic exam trap.
AWS WAF protects web applications at Layer 7 from SQL injection, XSS, and other application-layer attacks, but it does not protect against DDoS or non-HTTP traffic.
AWS Network Firewall is a stateful, managed firewall service that inspects all traffic in a VPC, including east-west traffic, and supports deep packet inspection and domain filtering.
AWS Shield Standard is a free, always-on service that protects against common infrastructure-layer DDoS attacks, while Shield Advanced provides enhanced protection and access to the DDoS Response Team.
Defence in depth means layering WAF, Network Firewall, and Shield together because each service covers a different attack surface that the others cannot fully address.
WAF can be attached to CloudFront, Application Load Balancer, or API Gateway, but not directly to EC2 instances or a Network Load Balancer.
Network Firewall requires you to update route tables in your VPC to route traffic through the firewall endpoints, otherwise it will not inspect any traffic.
These come up on the exam all the time. Here's how to tell them apart.
AWS WAF
Operates at Layer 7 (application layer) only, protecting HTTP/HTTPS traffic.
Stateless—inspects each request individually without tracking connections.
Attaches directly to CloudFront, ALB, or API Gateway endpoints.
AWS Network Firewall
Operates at Layers 3-7 (network through application), covering all IP traffic.
Stateful—tracks connection states and allows return traffic automatically.
Deployed as managed instances in a VPC and requires route table configuration.
AWS Shield Standard
Free and automatically enabled for all AWS customers.
Protects against common infrastructure-layer DDoS attacks (L3/L4).
No access to the AWS DDoS Response Team (DRT).
AWS Shield Advanced
Paid subscription (approx. $3,000/month plus data transfer fees).
Protects against larger, more sophisticated DDoS attacks including Layer 7.
Provides 24/7 access to the DRT and cost protection against attack-related bill spikes.
Security Groups
Stateful—return traffic is automatically allowed.
Attached at the resource level (EC2, ENI).
Only has allow rules; no explicit deny rules (implicit deny).
Network ACLs
Stateless—return traffic must be explicitly allowed by separate rules.
Attached at the subnet level.
Supports both allow and deny rules, evaluated in numeric order.
Application Load Balancer (ALB)
Operates at Layer 7 (HTTP/HTTPS) and can have WAF attached.
Supports advanced routing rules based on content.
Terminates TLS and can inspect application data.
Network Load Balancer (NLB)
Operates at Layer 4 (TCP/UDP) and cannot have WAF attached directly.
Best for ultra-low latency and high-throughput TCP traffic.
Does not terminate TLS by default; preserves the client connection state.
Mistake
WAF is enough to protect my entire network from all threats.
Correct
WAF only protects web applications at Layer 7. It cannot protect against non-HTTP traffic, DDoS attacks, or layer 3/4 threats.
Beginners often think WAF is a comprehensive firewall because the name includes 'Firewall'. They overlook the need for separate network-level protection.
Mistake
AWS Shield Standard is not useful because it is free and basic.
Correct
AWS Shield Standard is automatically enabled for all AWS customers and protects against the most common infrastructure-layer DDoS attacks, like SYN floods and UDP reflection.
People undervalue free services and assume they are weak. In reality, Shield Standard provides baseline protection that prevents many smaller attacks from affecting your services.
Mistake
Network Firewall and Security Groups do the same thing, so I only need one.
Correct
Security Groups are stateful firewalls attached to individual resources (like EC2 instances) and only allow/deny traffic. Network Firewall is deployed at the VPC edge and can do deep packet inspection, domain filtering, and intrusion prevention across all traffic.
The names 'firewall' and 'security group' sound similar. Beginners think they are redundant, not realising that Security Groups provide simple resource-level access control while Network Firewall provides centralised, advanced inspection.
Mistake
If I have Shield Advanced, I do not need WAF for application attacks.
Correct
Shield Advanced protects against volumetric DDoS attacks at Layers 3, 4, and 7, but it does not inspect the content of requests for SQL injection, XSS, or other application-layer exploits. WAF is still required for that.
Because Shield Advanced mentions Layer 7 protection against DDoS (like HTTP floods), beginners assume it covers all Layer 7 threats. They do not understand that a DDoS is just a flood of traffic, not a targeted exploit.
Mistake
Network Firewall can be attached directly to an Application Load Balancer like WAF.
Correct
Network Firewall is deployed as a managed instance in your VPC and requires configuring routing rules to pass traffic through it. It does not attach to ALBs or CloudFront; WAF is the service that attaches directly to those resources.
People think all AWS security services plug into the same endpoint because they all sound like 'firewalls'. The architecture integration method is different for each service.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
AWS WAF protects web applications at Layer 7 (HTTP/HTTPS) against attacks like SQL injection. AWS Network Firewall protects your entire VPC at Layers 3-7, including non-web traffic, and can do deep packet inspection and domain filtering.
Yes, if you are concerned about large DDoS attacks. WAF and Network Firewall can handle small DDoS attacks, but Shield Advanced is built to absorb massive volumetric attacks that would overwhelm your other services, and it gives you access to the AWS DDoS Response Team.
Yes, WAF supports IP set rules that can block or allow traffic from specific IP addresses or CIDR ranges. However, for simple IP blocking at the network level, a Network ACL is often more cost-effective and simpler.
Stateful means the firewall remembers the state of active connections. For example, if a server sends an outbound request, the firewall knows the returning response should be allowed without a separate inbound rule. This is more intelligent than stateless firewalls which inspect each packet in isolation.
You will see a significant and unusual spike in traffic to your resources, your site becomes slow or unreachable, and CloudWatch metrics show high network utilisation or 5xx errors. AWS Shield Advanced provides DDoS attack reports that confirm the attack and detail its characteristics.
Yes, but you must route the traffic through a central inspection VPC where the Network Firewall is deployed. By default, traffic between peered VPCs does not go through your firewall unless you explicitly configure the route tables.
You've finished Network Security Implementation: WAF, Network Firewall, and Shield. Continue through the ANS-C01 study guide to build a complete picture of the exam.
Done with this chapter?