Skip to content

Commit 33173a4

Browse files
committed
fix ljo feedbacks
1 parent 915bdb1 commit 33173a4

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

crowdsec-docs/docs/appsec/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ You can follow our quick start guides depending on your web server:
6666

6767
- [Nginx/OpenResty](/appsec/quickstart/nginxopenresty.mdx)
6868
- [Traefik](/appsec/quickstart/traefik.mdx)
69-
- [How to setup CrowdSec WAF as Nginx Reverse Proxy](/u/user_guides/waf_rp_howto)
69+
- [CrowdSec WAF with Nginx Reverse Proxy](/u/user_guides/waf_rp_howto)
7070

7171
Or consider learning more about the AppSec capabilities:
7272

crowdsec-docs/unversioned/user_guides/waf_rp_howto.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@ title: CrowdSec WAF Reverse Proxy
55

66
## Introduction
77

8-
In this guide, we will showcase how to deploy the CrowdSec WAF as a Nginx Reverse Proxy, easily protecting a fleet of other web applications from a single point.
8+
In this guide, we will showcase how to deploy the CrowdSec WAF with Nginx reverse proxy, easily protecting a fleet of other web applications from a single point.
99

10-
We will set up a reverse proxy (Nginx) boosted with CrowdSec in front of our web server (Apache) to block malicious traffic before it reaches our application.
10+
We will set up a reverse proxy (Nginx) protected with CrowdSec in front of our web server (Apache) to block malicious traffic before it reaches our application.
1111

1212
**This article dives into the technical details of configuring CrowdSec WAF.**
1313

1414
To achieve robust protection, we'll use two key components that work in tandem: the **Security Engine** and the **Web Application Firewall (WAF)** *– enabled by an AppSec-capable Remediation Component aka **Bouncer**, in our case, CrowdSec’s NGINX Bouncer*
1515

16-
**The Security Engine**: excels at identifying persistent or recurring behaviours. It analyzes your web server/reverse proxy logs to identify suspicious patterns of behavior. For example, the http-probing scenario detects IPs rapidly requesting a large number of non-existent files – a common tactic used by vulnerability scanners searching known vulnerabilities, backdoors, or publicly exposed admin interfaces. While powerful and able to protect a large number service from various log sources, the Security Engine reacts **after** the suspicious event, once it’s logged by your web server.
16+
**The Security Engine**: excels at identifying persistent or recurring behaviours. It analyzes your web server/reverse proxy logs to identify suspicious patterns of behavior. For example, the http-probing scenario detects IPs rapidly requesting a large number of non-existent files – a common tactic used by vulnerability scanners searching known vulnerabilities, backdoors, or publicly exposed admin interfaces. While powerful and able to protect a large number service from various log sources, the Security Engine reacts **after** the request have been processed by your web server.
1717

18-
**The Web Application Firewall (WAF):** The WAF acts as your immediate gatekeeper, blocking malicious requests before they even reach your application or backend. With the help of the bouncer relaying the requests to the AppSec engine, it will apply virtual patching rules to block requests that are, without a doubt, malevolent. A great example is the `vpatch-env-access` rule, which blocks requests attempting to access .env files (which should never be publicly accessible\!). Our vpatching collection has hundreds of rules tailored to precisely block vulnerability attempts
18+
**The Web Application Firewall (WAF):** The WAF acts as your immediate response, blocking malicious requests before they even reach your application or backend. With the help of the bouncer/remediation component relaying the requests to the AppSec engine, it will apply virtual patching rules to block requests that are, without a doubt, malevolent. A great example is the `vpatch-env-access` rule, which blocks requests attempting to access .env files (which should never be publicly accessible\!). Our vpatching collection has hundreds of rules tailored to precisely block vulnerability attempts.
19+
20+
:::info
21+
Virtual Patching Rules focus on detecting and preventing the exploitation of a specific vulnerability, allowing very minimal risk of false positives.
22+
:::
1923

2024
**Together, these components provide layered protection, making it significantly harder for attackers to succeed.**
2125

22-
WAFs are powerful, but no matter what WAF vendors make you believe, determined attackers can often find ways to bypass your WAF configuration. Here, the Security Engine will rely on the WAF detection to make longer-term decisions against repeating malevolent IPs. This is what the `appsec-vpatch` scenario does: it bans IPs that trigger at least two distinct WAF rules for several hours.
26+
WAFs are powerful, but no matter what WAF vendors make you believe, determined attackers can often find ways to bypass your WAF configuration. Here, the Security Engine will rely on the WAF detection to make longer-term decisions against repeating malevolent IPs.
2327

2428
## Initial Setup
2529

@@ -36,8 +40,8 @@ server {
3640
server_name _;
3741
3842
location / {
39-
proxy_pass http://Y.Y.Y.Y:3000; # Your backend app
40-
proxy_set_header X-Real-IP $remote_addr;
43+
proxy_pass http://Y.Y.Y.Y:3000; # Allows passing requests to the backend web server.
44+
proxy_set_header X-Real-IP $remote_addr; # Important to keep track of the original IP.
4145
proxy_http_version 1.1;
4246
proxy_set_header Upgrade $http_upgrade;
4347
proxy_set_header Connection 'upgrade';
@@ -114,11 +118,11 @@ A.B.C.D - - [22/May/2025:08:32:50 +0000] "GET /favicon.ico HTTP/1.1" 404 438 "ht
114118

115119
:::warning
116120

117-
At this stage, check that the IPs appearing in your Apache's and Nginx's log are the real originating IP.
121+
At this stage, check that both Apache's and Nginx's logs are the real originating IP (ie. `A.B.C.D`)
118122

119123
:::
120124

121-
## Time to beef up our security - Security Engine
125+
## Time to level up our security - Security Engine
122126

123127
As soon as our server is online, hordes of malevolent IPs will jump on it with clear bad intentions. What is currently happening is this:
124128

@@ -128,16 +132,16 @@ Thus, it is time to step up our security with CrowdSec. We will deploy the Secur
128132

129133
![harden setup](/img/harden-setup.png)
130134

131-
To install CrowdSec on our reverse proxy, let’s grab the crowdsec repository:
135+
To [install CrowdSec on our reverse proxy](https://doc.crowdsec.net/u/getting_started/installation/linux), let’s grab the crowdsec repository:
132136

133137
```bash
134-
$ curl -s https://install.crowdsec.net | sudo sh
138+
curl -s https://install.crowdsec.net | sudo sh
135139
```
136140

137141
And let’s install crowdsec:
138142

139143
```bash
140-
# apt install crowdsec
144+
sudo apt install crowdsec
141145
```
142146

143147
The relevant part of the install log is the following:
@@ -164,7 +168,7 @@ Accept it in the console:
164168
To complete our setup, we need the ability to block bad IPs and requests before they reach Apache, our little bro. We will install the Nginx bouncer (or remediation component) for this. The bouncer can block IPs when instructed by CrowdSec. As simple as this:
165169

166170
```bash
167-
# apt install crowdsec-nginx-bouncer
171+
sudo apt install crowdsec-nginx-bouncer
168172
```
169173

170174
What matters in the installation output is that:

0 commit comments

Comments
 (0)