Skip to content

Commit 1482c18

Browse files
committed
up
1 parent b9246e9 commit 1482c18

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

crowdsec-docs/docs/appsec/configuration.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,42 @@ listen_addr: 127.0.0.1:7422
9797
source: appsec
9898
```
9999

100+
## Allowlisting
101+
102+
### Fully allow a specific IP or range
103+
104+
If you want to ignore all rule matches for a specific IP or range, you can use a [centralized allowlist](local_api/allowlists.md).
105+
106+
Rules will be processed as usual, but the request will not be blocked even if a rule matches.
107+
108+
### Disable specific rules for a specific IP/range
109+
110+
If you want to disable rule(s) for a specific IP (or range), you will need to use the `pre_eval` hook (refer to the section above for more details):
111+
112+
```yaml title="/etc/crowdsec/appsec-configs/my_config.yaml"
113+
name: custom/my_config
114+
pre_eval:
115+
- filter: req.RemoteAddr == "1.2.3.4"
116+
apply:
117+
- RemoveInBandRuleByName("generic-wordpress-uploads-php")
118+
```
119+
120+
### Disable appsec for a specific FQDN
121+
122+
If your reverse-proxy forwards all requests to crowdsec, regardless of the FQDN, you can disable the appsec for specific domain with a custom appsec-config:
123+
124+
```yaml title="/etc/crowdsec/appsec-configs/my_config.yaml"
125+
name: custom/my_config
126+
pre_eval:
127+
- filter: req.URL.Host == "foo.com"
128+
apply:
129+
- CancelEvent()
130+
- CancelAlert()
131+
- SetRemediation("allow")
132+
```
133+
134+
With this config, the rules will still be evaluated, but no alert or event will be generated, and if a rule matches, the remediation will be set to `allow`(ie, instruct the bouncer to let the request through).
135+
100136
## Appsec configuration
101137

102138
The AppSec configuration is referenced by the acquisition configuration (`appsec_config`, `appsec_configs` or `appsec_config_path`):

0 commit comments

Comments
 (0)