Understanding the difference between a traditional firewall and a Web Application Firewall (WAF) is essential for modern cybersecurity.
As businesses increasingly rely on web applications, WAFs have become crucial for defending against sophisticated DDoS attacks and application-layer threats. Layer 7 attacks now represent over half of all DDoS incidents on AWS, making enterprise-grade WAF protection essential for operational resilience.
This article delves into the specifics of WAF, what they protect against, and how AWS WAF can offer comprehensive protection for your web applications.
The main difference between a firewall and a web application firewall (WAF) definition is that a firewall usually protects network and transport layers (layers 3 and 4). A WAF offers protection on the application layer (layer 7).
Traditional firewalls focus on volumetric and infrastructure attacks (SYN floods, UDP floods), while modern WAFs address sophisticated, behavior-mimicking attacks that appear legitimate. This distinction has become critical as attackers increasingly use AI and automation to craft precision-driven assaults at the application layer.
A WAF monitors HTTP/HTTPS requests and protects these web applications from malicious activities on layer 7 of the OSI model. Hence, a WAF is a necessary protection against a growing number of web security threats.
👉 In this article, you will mainly learn information about cloud-based WAFs.

SQL injection (SQLi): This can be done by entering a malicious code in SQL statements, via web page input (e.g. the user gives you an SQL statement that you will unknowingly run on your database). This malicious code can alter, steal or delete database data.
Cross-site scripting (XSS): A malicious script is injected into the code (e.g. HTTP, JavaScript, etc.) of a trusted website, allowing potentially sensitive user data such as cookies to be accessed. The code modified by this attack is not executed on the server but on the user's side.
Remote file inclusion (RFI): RFI is the process of embedding external files through vulnerabilities implemented in the web application. If the process allows modification of the path to a processed file (for example, if the path is included as a parameter), the attacker can use this path to input an external malicious file.
And more web application attacks and threats from the OWASP Top 10 publication.
These are composed of requests (HTTP GETs and DNS queries are popular) that are designed to consume application resources (memory, CPU, bandwidth). An example is an attacker who continuously uses a website functionality (submitting a contact form or any API requests) that they know causes database and application processing so that the underlying web service is busy with malicious requests and can't deliver to other users anymore.
Modern Layer 7 DDoS attacks have evolved significantly. Attackers now employ "low and slow" tactics and horizontal attacks targeting multiple services simultaneously with encrypted HTTPS traffic that's difficult to inspect. These attacks mimic legitimate user behavior, making them harder to distinguish from real traffic. Read more in our article about DDoS protection.
Bad bots are often programmed to do a variety of malicious jobs. They can try to break into user accounts, steal data, submit meaningless data through online forms, and perform other malicious activities. Bad bot activity is most often manifested by an abnormal increase or decrease in visits in unusual periods with a high rate of immediate leave (bounce).
With AWS WAF's Web Bot Authentication (WBA), you can cryptographically verify legitimate AI bots and agents while blocking malicious bot traffic with unprecedented accuracy.
A WAF is usually placed logically between users and web servers and analyzes and compares network traffic with the vulnerability database. A WAF creates a set of rules designed to protect your website and detects unwanted traffic. It usually blocks this traffic but can be set up to only monitor it.

Modern WAFs now employ machine learning and behavioral analysis to understand your traffic patterns within 15 minutes of activation, enabling rapid threat detection and mitigation within seconds rather than hours.
Want to find out how a WAF can help your particular use case?
Talk to a WAF specialist
The AWS WAF is a cloud-based solution that helps prevent attacks on the application layer 7 and a great web application firewall example. Due to the specific nature of these attacks, with an AWS WAF you can easily create customized rules against malicious requests which could have characteristics like being disguised as good traffic or coming from bad IPs, unexpected geographies, etc.
AWS WAF protection is tightly integrated with AWS services that AWS customers use to deliver content such as Amazon CloudFront CDN, the Application Load Balancer (ALB), and the Amazon API Gateway. But AWS WAF can be also used for the protection of services from other providers, but your content has to be served through the CloudFront distribution network.
You use an AWS WAF to control how an Amazon CloudFront distribution, an Amazon API Gateway, an Application Load Balancer or an AWS AppSync GraphQL API responds to web requests.

The updated AWS WAF console delivers:
AWS WAF now includes built-in Layer 7 DDoS protection:
Cryptographic bot verification framework for enterprise environments:
Before choosing the right type of security rules, you should understand what vulnerabilities your web application has. If you need help finding this out, contact us for a consultation.
You can select from a variety of AWS managed rule groups to protect your application from multiple threats. These rules are written by security experts who have extensive and up-to-date knowledge of threats and vulnerabilities. Managed rules are continuously updated to protect against emerging threats.
These managed rules include:
You can write custom rules specific to your web application/database to block undesired patterns in parts of the HTTP/HTTPS request, such as headers, method, query string, URI, body and IP address. These custom rules can be used together with AWS Managed Rules.
You can also find rules created by security vendors that have built their own rule sets on AWS WAF on the AWS Marketplace. AWS WAF now features a dedicated Marketplace page for direct deployment of partner solutions.
AWS provides the AWS WAF Security Automations Solution which automatically deploys a set of AWS WAF rules that filter common web-based attacks, but also provide advanced log analysis. This automated solution leverages AWS WAF's APIs to react to threats detected from logs, honeypot URLs, and more to automatically update rules and block malicious IP addresses. An example of this is shown below.

If you are already using services like Amazon CloudFront or Application Load Balancer, you can be up and running with an AWS WAF within a few minutes. And you don't have to re-architect your whole network infrastructure when starting with an AWS WAF, which is sometimes necessary for WAFs from other providers. There is also no additional software to deploy, any DNS configuration or SSL/TLS certificate to manage. With pre-configured rule packs, security configuration is automatically customized based on your application type, eliminating complex manual setup.
Like other AWS services, you pay only for what you use, based on the number of rules you deploy and the volume of web requests your application receives. To optimize costs, it's crucial to limit AWS WAF monitoring to only the parts of your application or website where it's truly needed. With bundled service offerings, you can combine CDN, WAF, Route53, and CloudWatch into transparent, predictable pricing tiers.
The AWS WAF is a fully managed service, so you don't have to worry about scaling and updates/patches. With Managed Rules for your AWS WAF, you can quickly get started and protect your web application or APIs against common threats. Managed rules are automatically updated so you can spend more time building applications.
The Stormit team helps organizations protect their websites and applications against all commonly known attacks and exploits by leveraging the protection of AWS Services, such as AWS WAF and AWS Shield. Thanks to the free AWS Well-Architected review, it's easy to understand how to integrate these services into your architecture.
This reference architecture below includes several AWS Edge Services that the Stormit team recommends using because it can help you improve your web application's resiliency against known web application attacks, but also secure your application and infrastructure in other ways. This architecture is intended for those who use only AWS services.

Here is an example of Stormit's recommended architecture for those who use servers outside of the AWS Cloud.

Layer 7 attacks now represent a significant portion of DDoS incidents on AWS. Attackers increasingly employ:
Modern WAF solutions must combine traffic pattern analysis, behavioral biometrics, and automated response to detect and mitigate these sophisticated threats in real time.
We offer a free AWS Well-Architected review to evaluate your architecture and guide you in following AWS best practices. Our consultation includes AWS Edge Services like Amazon CloudFront, AWS WAF, Amazon Route 53, and AWS Shield to enhance your application's security.
An AWS Solutions Architect with over 5 years of experience in designing, assessing, and optimizing AWS cloud architectures. At Stormit, he supports customers across the full cloud lifecycle — from pre-sales consulting and solution design to AWS funding programs such as AWS Activate, Proof of Concept (PoC), and the Migration Acceleration Program (MAP).