You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Adding custom parsers, scenarios, postoverflows, and AppSec files
152
152
153
-
You can ship your own parser and scenario files through Helm by using:
153
+
You can ship your own parser, scenario, postoverflow, AppSec configuration, AppSec rule, AppSec scenario, and AppSec postoverflow files through Helm by using:
154
154
155
155
- `config.parsers`
156
156
- `config.scenarios`
157
+
- `config.postoverflows`
158
+
- `appsec.configs`
159
+
- `appsec.rules`
160
+
- `appsec.scenarios`
161
+
- `appsec.postoverflows`
157
162
158
-
Those values are mounted into the agent pods as files and passed to CrowdSec as-is.
163
+
Those values are mounted into the relevant pods as files and passed to CrowdSec as-is.
159
164
160
165
`config.parsers` is split by parser stage:
161
166
@@ -165,19 +170,38 @@ Those values are mounted into the agent pods as files and passed to CrowdSec as-
165
170
166
171
`config.scenarios`is a flat map of scenario files.
167
172
173
+
`config.postoverflows` is split by postoverflow stage:
174
+
175
+
- `config.postoverflows.s00-enrich`
176
+
- `config.postoverflows.s01-whitelist`
177
+
178
+
`appsec.configs`, `appsec.rules`, and `appsec.scenarios` are flat maps of AppSec files.
179
+
180
+
`appsec.postoverflows` is split by postoverflow stage:
181
+
182
+
- `appsec.postoverflows.s00-enrich`
183
+
- `appsec.postoverflows.s01-whitelist`
184
+
168
185
What is allowed:
169
186
170
187
- `config.parsers.<stage>.<fileName>: |` with a string value
171
188
- `config.scenarios.<fileName>: |` with a string value
189
+
- `config.postoverflows.<stage>.<fileName>: |` with a string value
190
+
- `appsec.configs.<fileName>: |` with a string value
191
+
- `appsec.rules.<fileName>: |` with a string value
192
+
- `appsec.scenarios.<fileName>: |` with a string value
193
+
- `appsec.postoverflows.<stage>.<fileName>: |` with a string value
172
194
- file names with or without a `.yaml` / `.yml` suffix
173
-
- keys such as `my-parser`, `my-parser.yaml`, `test_scenario`, `custom.rule.yaml`
195
+
- keys such as `my-parser`, `my-parser.yaml`, `test_scenario`, `custom.rule.yaml`, `my-appsec-config`, `my-rule.yml`, `my-postoverflow`, `my-appsec-scenario.yaml`
174
196
175
197
What is not allowed:
176
198
177
199
- nested objects below the file name
178
200
- using a non-string value for a file entry
179
201
- adding custom stages under `config.parsers`
202
+
- adding custom stages under `config.postoverflows` or `appsec.postoverflows`
180
203
- forgetting to escape dots when using `--set` or `--set-file`
204
+
- enabling `appsec.configs`, `appsec.rules`, `appsec.scenarios`, or `appsec.postoverflows` without also enabling the AppSec component
181
205
182
206
This is valid in a values file:
183
207
@@ -218,6 +242,55 @@ config:
218
242
description: "Raise an alert on a specific event"
219
243
filter: "evt.Meta.log_type == 'special_event'"
220
244
blackhole: 10m
245
+
246
+
postoverflows:
247
+
s01-whitelist:
248
+
trusted-ip.yaml: |
249
+
name: mycorp/trusted-ip
250
+
description: "Whitelist a known source after overflow"
251
+
whitelist:
252
+
reason: "trusted source"
253
+
expression:
254
+
- evt.Overflow.Source_ip == "203.0.113.10"
255
+
256
+
appsec:
257
+
enabled: true
258
+
configs:
259
+
my-appsec-config: |
260
+
name: mycorp/my-appsec-config
261
+
default_remediation: ban
262
+
inband_rules:
263
+
- mycorp/my-rule
264
+
265
+
rules:
266
+
my-rule.yaml: |
267
+
name: mycorp/my-rule
268
+
zones:
269
+
- URI
270
+
transform:
271
+
- lowercase
272
+
match:
273
+
type: contains
274
+
value: /admin
275
+
action: ban
276
+
277
+
scenarios:
278
+
my-appsec-scenario: |
279
+
type: trigger
280
+
name: mycorp/my-appsec-scenario
281
+
description: "Generate an alert when the custom AppSec rule matches"
282
+
filter: evt.Meta.log_type == 'appsec'
283
+
blackhole: 2m
284
+
285
+
postoverflows:
286
+
s01-whitelist:
287
+
my-appsec-whitelist.yaml: |
288
+
name: mycorp/my-appsec-whitelist
289
+
description: "Whitelist a trusted source for AppSec alerts"
290
+
whitelist:
291
+
reason: "trusted appsec source"
292
+
expression:
293
+
- evt.Overflow.Source_ip == "203.0.113.11"
221
294
```
222
295
223
296
Minimal valid parser file example:
@@ -269,6 +342,18 @@ config:
269
342
270
343
The example above is invalid because `test-parser` becomes an object with a `yaml` field. Each file entry must be a single string.
271
344
345
+
The same rule applies to AppSec files. For example, this is not valid either:
346
+
347
+
```yaml
348
+
appsec:
349
+
configs:
350
+
my-appsec-config:
351
+
yaml: |
352
+
name: mycorp/my-appsec-config
353
+
```
354
+
355
+
Like parser and scenario files, AppSec file names can include `.yaml` or `.yml`, uppercase characters, underscores, or dots. The chart normalizes those keys into Kubernetes-safe volume names before mounting them, so the same filename flexibility is available for `config.postoverflows`, `appsec.configs`, `appsec.rules`, `appsec.scenarios`, and `appsec.postoverflows`.
356
+
272
357
#### Using a dedicated values file
273
358
274
359
If you have several custom items, the simplest approach is to keep them in a dedicated values file and pass it with `-f`:
0 commit comments