Skip to content

feat(remediation-component): 📝 NodeJS Bouncer doc #740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions crowdsec-docs/sidebarsUnversioned.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -313,6 +315,11 @@ module.exports = {
label: "Nginx",
id: "bouncers/nginx",
},
{
type: "doc",
label: "Node.js",
id: "bouncers/node-js",
},
{
type: "doc",
label: "OpenResty",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions crowdsec-docs/unversioned/bouncers/node-js.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
id: node-js
title: Node.js
sidebar_position: 1
---

import useBaseUrl from '@docusaurus/useBaseUrl';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support bubbles

Suggested change
import RemediationSupportBadges from '@site/src/components/RemediationSupportBadges.tsx';

<p align="center">
<img src="https://raw.githubusercontent.com/crowdsecurity/nodejs-cs-bouncer/main/docs/assets/app-sec.webp" width="400px" align="center" alt="Crowdsec Bouncer logo" />
</p>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add links and bubbles

Suggested change
<p align="center">
&#x1F4DA; <a href="#installation/">Documentation</a>
&#x1F4A0; <a href="https://hub.crowdsec.net">Hub</a>
&#128172; <a href="https://discourse.crowdsec.net">Discourse </a>
</p>
<RemediationSupportBadges
Mode
Metrics
/>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add build pass + test pass

Suggested change
<p align="center">
<img src="https://img.shields.io/badge/build-pass-green" />
<img src="https://img.shields.io/badge/tests-pass-green" />
</p>

## 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either we make this doc page a "clone" of https://github.com/crowdsecurity/nodejs-cs-bouncer/blob/main/docs/USER_GUIDE.md

or we mention the userguide with a link here


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:

<img src={useBaseUrl('/img/bouncer/nodejs/screenshots/ban-wall.png')} alt="Ban wall" title="Ban wall" />

A captcha wall could look like:

<img src={useBaseUrl('/img/bouncer/nodejs/screenshots/captcha-wall.png')} alt="Captcha wall" title="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)