Skip to content

Commit 40cb239

Browse files
author
jdv
committed
PR comments fixes
1 parent 2f26cf9 commit 40cb239

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

crowdsec-docs/docs/contributing/specs/bouncer_appsec_specs.mdx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ The Bouncer applies the appropriate remediation *(we’ll only focus on ban/bloc
2525
* Forwarding protocol
2626
* [Config and support requirements](#extra-details-and-requirements)
2727

28-
Here is an existing remediation components *(bouncers)* for Nginx and its lua dependency
28+
Here is an existing remediation components *(bouncers)* for Nginx and its lua dependency.
29+
It's one of the most complete bouncer with AppSec capabilities and Metrics. A good example to follow for your implementation.
2930
[*cs-nginx-bouncer*](https://github.com/crowdsecurity/cs-nginx-bouncer) *\+ [lua-cs-bouncer](https://github.com/crowdsecurity/lua-cs-bouncer/)* (dependency)
3031

31-
And the yet prototyped but functional [NGINX NJS version](https://github.com/crowdsecurity/cs-nginx-njs-bouncer/pull/1/files) (doesn’t have appsec capabilities yet)
32+
And a more recent and soon finalized [Node JS bouncer](https://github.com/crowdsecurity/nodejs-cs-bouncer) (for a different implementation, to be used in code)
3233

3334
⚠️ **Your bouncer must always delete/clean it’s resources on shutdown**
3435

@@ -121,7 +122,7 @@ Allows to pull all decisions from LAPI and then periodically get a delta
121122
* Have the code be able to handle 100k to be safe for the nominal case
122123
* Storing in memory is ideal, we recommend to convert IPs to integers
123124
* The decisions format is the following:
124-
* See [decisions example in appendix](#appendix)
125+
* See [decisions example in appendix](#decision-example)
125126
* There can be multiple decisions per IP
126127
* Store each decisions independently as they have their own remediation action and TTL
127128
* Ranges are stored too
@@ -162,7 +163,7 @@ If a remediation is found and for the LAPI timeout fallback here are the remedia
162163
* Remediation priority
163164
* There is a priority in the remediation to take in account if an IP has multiple
164165
* Default priority order **Ban** then **Captcha**
165-
* Metrics (TBD)
166+
* Metrics see below and in the [detailed metrics specs](/contributing/specs/bouncer_metrics_specs)
166167

167168
### Logging
168169

@@ -189,7 +190,7 @@ Each push must reset the internal counter for the metrics (i.e., we have only se
189190
Each metric about blocked requests must have an `origin` label whose value is the origin of the decision and a `remediation_type` label whose value is the type of remediation that was applied (e.g., `ban` or `captcha`).
190191
A `processed` metric must also be present that counts the number of requests that were processed by the RC (regardless of whether they were blocked or not). This metric has no label.
191192

192-
A full sample payload can be found in the appendix.
193+
A full sample payload can be found in the [appendix](#metrics-payload).
193194

194195
## AppSec Capability (request forwarding)
195196

@@ -485,7 +486,7 @@ You can refer to the AppSec documentation to test request forwarding.
485486

486487
More details about metrics in [Metrics specs](/contributing/specs/bouncer_metrics_specs/)
487488

488-
```
489+
```json
489490
{
490491
"remediation_components": [ {
491492
"type": "my-bouncer-stat",

crowdsec-docs/docs/contributing/specs/bouncer_metrics_specs.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,4 +365,5 @@ catch Exception as e:
365365
Remediation metrics have already been implemented in various languages and frameworks. You can use it as inspiration for your own implementation:
366366

367367
- The [LUA library](https://github.com/crowdsecurity/lua-cs-bouncer/) used by the [NGINX remediation component](https://docs.crowdsec.net/u/bouncers/nginx/)
368-
- The [PHP library](https://github.com/crowdsecurity/php-remediation-engine) used by the [WordPress remediation component](https://docs.crowdsec.net/u/bouncers/wordpress).
368+
- The [PHP library](https://github.com/crowdsecurity/php-remediation-engine) used by the [WordPress remediation component](https://docs.crowdsec.net/u/bouncers/wordpress).
369+
- The [Firewall Bouncer](https://github.com/crowdsecurity/cs-firewall-bouncer) written in Go. Used for nftables/iptables.

0 commit comments

Comments
 (0)