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
@@ -137,7 +137,15 @@ The Remediation Component does the following:
137
137
1. Create a Cloudflare Worker and a Worker KV per configured account.
138
138
2. Create a Worker Route(s) per configured zone. Any request matching the route would be handled by the worker.
139
139
3. For every matching incoming request, the worker checks whether it's IP, Country and AS have a decision against. It checks for this in it's KV store. If found it performs the corresponding remediation.
140
-
4. The Remediation Component also periodically updates the KV store with the latest decisions from CrowdSec.
140
+
4. The Remediation Component also periodically updates the KV store with the latest decisions from CrowdSec.
141
+
142
+
If your Cloudflare token has permission on D1, the remediation component will also automatically create a database to track:
143
+
- Number of requests processed
144
+
- Number of requests blocked
145
+
146
+
Those metrics are exposed through the prometheus endpoint and automatically sent to crowdsec for visualisation with `cscli`.
147
+
148
+
Metrics are stored in a D1 database to allow for easy retrieval by the remediation component. If your token does not have access to D1, a warning will be logged and metrics will be disabled.
log_only: false # If true, allow all requests, but still keep track of what would have been blocked in the metrics
184
+
script_name: ""
185
+
logpush: null
186
+
tags: []
187
+
compatibility_date: ""
188
+
compatibility_flags: []
174
189
175
190
log_level: info
176
191
log_media: "stdout"
@@ -193,7 +208,7 @@ For obtaining the `token`:
193
208
194
209
1. Sign in as a user who has access to the desired account.
195
210
196
-
Then click [this link](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22challenge_widgets%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22user_details%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22workers_kv_storage%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_routes%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%20%7B%22key%22%3A%20%22dns%22%2C%20%22type%22%3A%22read%22%7D%5D&name=) and create the token.
211
+
Then click [this link](https://dash.cloudflare.com/profile/api-tokens?permissionGroupKeys=%5B%7B%22key%22%3A%22account_settings%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22challenge_widgets%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22user_details%22%2C%22type%22%3A%22read%22%7D%2C%7B%22key%22%3A%22workers_kv_storage%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_routes%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22workers_scripts%22%2C%22type%22%3A%22edit%22%7D%2C%7B%22key%22%3A%22zone%22%2C%22type%22%3A%22read%22%7D%2C%20%7B%22key%22%3A%20%22dns%22%2C%20%22type%22%3A%22read%22%7D%2C%20%7B%22key%22%3A%22d1%22%2C%20%22type%22%3A%22edit%22%7D%5D&name=) and create the token.
197
212
198
213
Alternatively, you can go to [Tokens](https://dash.cloudflare.com/profile/api-tokens) and create the token.
199
214
@@ -205,6 +220,7 @@ The Remediation Component requires the following permissions to function:
205
220
| Account | Workers KV Storage | Edit |
206
221
| Account | Workers Scripts | Edit |
207
222
| Account | Account Settings | Read |
223
+
| Account | D1 | Edit |
208
224
| User | User Details | Read |
209
225
| Zone | DNS | Read |
210
226
| Zone | Workers Routes | Edit |
@@ -463,6 +479,41 @@ Cloudflare account token.
463
479
464
480
Account name.
465
481
482
+
#### `worker.log_only`
483
+
> bool
484
+
485
+
If true, allow all requests but keep track of what would have been blocked in the metrics.
486
+
487
+
Defaults to `false`
488
+
489
+
#### `worker.script_name`
490
+
> string
491
+
492
+
Name to use for the worker script.
493
+
494
+
Default to `crowdsec-cloudflare-worker-bouncer`.
495
+
496
+
#### `worker.logpush`
497
+
> bool
498
+
499
+
Enable logpush for the worker.
500
+
501
+
Default to no value.
502
+
503
+
#### `worker.compatibility_date`
504
+
> string
505
+
506
+
See https://developers.cloudflare.com/workers/configuration/compatibility-dates/.
507
+
508
+
Default to no value
509
+
510
+
#### `worker.compatibility_flags`
511
+
> list of strings
512
+
513
+
See https://developers.cloudflare.com/workers/configuration/compatibility-flags/.
0 commit comments