What is a Web Application Firewall (WAF)

Bot Shield Hero


Share This Post

WAF 是一种网络安全系统,它通过确保 Web 服务器只接收合法流量来帮助保护 Web 应用程序免受各种类型的攻击。


A web application firewall is a specific type of firewall that focuses on the traffic going to and leaving web apps. Standard firewalls act as the first level of security but today’s websites and web services need more security. This is where WAFs provide specialized capabilities and thwart attacks specifically aimed at the applications themselves.

Looking for a WAF Solution? Check out CDNetwork’s Application Shield(DDoS防护及Web应用防火墙).

应用防火墙 (WAF) 如何工作?

A WAF works by filtering, monitoring, and blocking suspicious HTTP/s traffic between a web application and the internet.

长久以来,传统防火墙一直是一种基本的网络安全策略。它们部署在网络边缘,在 OSI 模型的第3层到第4层中运行。它们的作用仅限于检查IP和TCP/UDP协议上的数据包,并根据IP地址、协议类型和端口号过滤流量。

A WAF on the other hand operates at Layer 7 (L7) of the OSI model and can understand web application protocols. They are essential to analyze the traffic going to and from a web application and to prevent attacks that might otherwise go undetected through a traditional network firewall and can be used as part of a positive or negative security model.

When deploying a WAF, it acts as a reverse-proxy shield between an application and the internet. A proxy server is an intermediary that protects a client machine. Reverse-proxies on the other hand ensures that the clients pass through it before reaching a server. Crucially, a WAF can be used to protect multiple applications that it is placed in front of.

A WAF uses a set of rules called policies to filter out malicious traffic from taking advantage of application vulnerabilities including the OWASP Top 10. These security policies are often based on known web attack signatures, including scanpoints like HTTP Headers, HTTP Request Body and HTTP Response Body. The set of rules can also be specified to detect patterns in URL or file extension, to restrict URI, header and body length, to detect SQL/XSS injection, zero-day exploits and even bots based on their signature detection and behavior

The key benefit of using a WAF is that these policies can be modified and implemented quickly and with ease. Some WAF providers also provide functionalities for load balancing, SSL offloading, and intelligent automation of these policy modifications using machine learning to optimize your cloud security. This makes it easy to adapt and respond to varying attack vectors and for Distributed Denial of Service (DDoS) protection.

仅靠 WAF 无法抵御所有攻击。但它可以增强web应用程序的安全性,以抵御以下常见攻击:

Cross-Site Forgery

These are attacks that force authenticated users of a web application to take actions that compromise the security of the app. Usually, an attacker tricks the user to click on a link by sending them a link via email. Once the user authentication and logins are completed, the user can be forced to perform requests such as transferring funds or changing their profile details and email addresses. If the attack is aimed at an admin account and becomes successful, it could compromise the entire web application.

Cross-Site Scripting

Cross-site scripting attacks are those where an attacker injects malware into a client’s browser to steal data including session cookies or edit the content to show false information. This usually happens when a dynamic website that contains scripts in JavaScript, PHP, and .NET is injected with malicious code. When a user loads the web page, the attacker’s malicious scripts are executed. For example, the user’s cookie may be sent to the attacker who can use it for impersonation.

SQL Injection

在这类攻击中,攻击者会尝试将恶意 SQL 命令注入具有用户输入数据字段(例如联系表单)的网站和应用程序。 注入的代码可以未经授权访问数据库并运行命令来提取或修改数据库中包含的私密信息。

Need DDoS Protection and high-performance security solutions? CDNetwork’s Flood Shield(DDoS云清洗) is perfect for DDoS attacks mitigation.

What Are The Different Types of WAFs?

A WAF protects web applications by utilizing threat intelligence and blocking attacks that satisfy certain pre-set criteria while allowing approved traffic. They help protect against cross-site forgery, cross-site scripting, SQL injection, and file inclusion where attackers try to gain unauthorized access to an application to steal sensitive data or compromise the application itself.

A WAF can be one of three types based on the way they are implemented.

Network-Based WAF

This is usually a hardware-based WAF and is installed locally. This means that it is placed close to the server and is, therefore, easier to access. As is the case with hardware-based deployments, they help minimize latency but can be expensive to store and maintain.

Host-Based WAF

基于主机的 WAF 是完全集成到应用程序软件中的 WAF。 它作为应用服务器内部的一个模块存在。 这种类型的 WAF 比基于网络的 WAF 更便宜,而且更易于定制。 但另一面,它们可能会过度消耗本地服务器资源并影响应用程序的性能。 它们的实施和维护也很复杂。

基于云的 WAF

A Cloud-based WAF is more affordable and requires fewer on-premises resources to manage. They are easier to implement and often delivered as SaaS by a vendor. offering a turnkey installation as simple as changing the DNS to redirect web traffic. Because of the cloud service model, they also have minimal upfront cost and can be continuously updated to keep up with the latest attacks in the threat landscape. CDNetworks offers a cloud-based WAF that is integrated with our global data centers and content delivery network (CDN) and prevents web application-layer attacks in real-time.

More To Explore