Skip to content

Commit 7d4bb5d

Browse files
committed
up
1 parent c024190 commit 7d4bb5d

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

crowdsec-docs/docs/appsec/alerts_and_scenarios.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The generated event looks like:
1616
- `evt.Meta.service` is set to `appsec`
1717
- `evt.Meta.log_type`:
1818
- `appsec-block` for blocked requests (_InBand_ rule matched for ex)
19-
- `appsec-info` for non-blocked reuqests that triggered _OutOfBand_ rule
19+
- `appsec-info` for reuqests that triggered _OutOfBand_ rule (not blocked)
2020
- `evt.Meta.source_ip` is set to the source (client) IP
2121
- `evt.Meta.target_host` is set to the FQDN if present (`Host` header in the HTTP request)
2222
- `evt.Meta.target_uri` is set to the full URI of the HTTP request
@@ -85,20 +85,28 @@ rules:
8585
value: test
8686
```
8787
88-
Let ensure it's loaded as an _OutOfBand_ rule:
88+
Let ensure it's loaded as an _OutOfBand_ rule, first by creating a new appsec-config:
8989
90-
```yaml title="/etc/crowdsec/appsec-configs/appsec-default.yaml"
91-
name: crowdsecurity/appsec-default
90+
```yaml title="/etc/crowdsec/appsec-configs/appsec-oob.yaml"
91+
name: crowdsecurity/appsec-oob
9292
default_remediation: ban
93-
inband_rules:
94-
- crowdsecurity/base-config
95-
- crowdsecurity/vpatch-*
96-
- crowdsecurity/generic-*
9793
#Let's add our rule as an out-of-band rule
9894
outofband_rules:
9995
- crowdsecurity/foobar-access
10096
```
10197
98+
And then make sure this appsec-config is loaded:
99+
100+
```yaml title="/etc/crowdsec/acquis.d/appsec.yaml"
101+
appsec_configs:
102+
- crowdsecurity/appsec-default
103+
- crowdsecurity/appsec-oob
104+
labels:
105+
type: appsec
106+
listen_addr: 127.0.0.1:7422
107+
source: appsec
108+
```
109+
102110
#### The Scenario
103111
104112
We can now create a scenario that will trigger when a single IPs triggers this rule on distinct URLs:

0 commit comments

Comments
 (0)