diff --git a/crowdsec-docs/sidebarsUnversioned.js b/crowdsec-docs/sidebarsUnversioned.js index d0843e2b..2a82e63b 100644 --- a/crowdsec-docs/sidebarsUnversioned.js +++ b/crowdsec-docs/sidebarsUnversioned.js @@ -213,11 +213,13 @@ module.exports = { type: "doc", id: "console/decisions/decisions_intro", }, - items: [{ - type: "doc", - id: "console/decisions/decisions_management", - label: "Decisions Management 🏅" - }], + items: [ + { + type: "doc", + id: "console/decisions/decisions_management", + label: "Decisions Management 🏅", + }, + ], }, { type: "category", @@ -313,6 +315,11 @@ module.exports = { label: "Nginx", id: "bouncers/nginx", }, + { + type: "doc", + label: "Node.js", + id: "bouncers/node-js", + }, { type: "doc", label: "OpenResty", diff --git a/crowdsec-docs/static/img/bouncer/nodejs/screenshots/ban-wall.png b/crowdsec-docs/static/img/bouncer/nodejs/screenshots/ban-wall.png new file mode 100644 index 00000000..4911dea7 Binary files /dev/null and b/crowdsec-docs/static/img/bouncer/nodejs/screenshots/ban-wall.png differ diff --git a/crowdsec-docs/static/img/bouncer/nodejs/screenshots/captcha-wall.png b/crowdsec-docs/static/img/bouncer/nodejs/screenshots/captcha-wall.png new file mode 100644 index 00000000..be2c5b2c Binary files /dev/null and b/crowdsec-docs/static/img/bouncer/nodejs/screenshots/captcha-wall.png differ diff --git a/crowdsec-docs/unversioned/bouncers/node-js.mdx b/crowdsec-docs/unversioned/bouncers/node-js.mdx new file mode 100644 index 00000000..a1281ec7 --- /dev/null +++ b/crowdsec-docs/unversioned/bouncers/node-js.mdx @@ -0,0 +1,61 @@ +--- +id: node-js +title: Node.js +sidebar_position: 1 +--- + +import useBaseUrl from '@docusaurus/useBaseUrl'; + +

+ Crowdsec Bouncer logo +

+ +## Overview +This bouncer allows you to protect your Node.js application from IPs that have been detected by CrowdSec. Depending on the decision taken by CrowdSec, user will either get denied (403) or have to fill a captcha (401). + +It supports ban and captcha remediation, and all decisions with Ip or Range scope. + +## Requirements + +- `Node.js >= 20` + +## Installation + +```bash +npm install @crowdsec/nodejs-bouncer +``` + +## Features + +- CrowdSec Local API support + + - Handle `ip` and `range` scoped decisions + - `Live mode` or `Stream mode` + +- Support IpV4 and Ipv6 (Ipv6 range decisions are yet only supported in `Live mode`) + +## Usage + +When a user is suspected by CrowdSec to be malevolent, the bouncer would either display a captcha to resolve or +simply a page notifying that access is denied. If the user is considered as a clean user, the page will be accessible +as normal. + +A ban wall could look like: + +Ban wall + +A captcha wall could look like: + +Captcha wall + +With the provided bouncer, it is possible to customize all the colors of these pages so that they integrate +best with your design. + +On the other hand, all texts are also fully customizable. This will allow you, for example, to present translated pages +in your users' language. + +## Resources + +- [GitHub Repository](https://github.com/crowdsecurity/nodejs-cs-bouncer) +- [Complete User Guide](https://github.com/crowdsecurity/nodejs-cs-bouncer/blob/main/docs/USER_GUIDE.md) +- [Developer Guide](https://github.com/crowdsecurity/nodejs-cs-bouncer/blob/main/docs/DEVELOPER.md) \ No newline at end of file