Skip to content

Commit b4c7063

Browse files
committed
merge
2 parents 678a861 + f569e9a commit b4c7063

185 files changed

Lines changed: 5414 additions & 5050 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Code quality
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
quality:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
cache: "npm"
18+
cache-dependency-path: crowdsec-docs/package-lock.json
19+
20+
21+
- name: Install dependencies
22+
run: npm ci
23+
working-directory: ./crowdsec-docs/
24+
25+
- name: Setup Biome
26+
uses: biomejs/setup-biome@v2
27+
with:
28+
version: latest
29+
30+
- name: Run Biome
31+
run: biome ci .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode
22
node_modules
3+
.history

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Online version of this documentation is available here: https://doc.crowdsec.net
66

77
The documentation is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
88

9+
## Pre-requisites
10+
11+
- Node.js (version 20 or later)
12+
- npm (Node package manager)
13+
- VSCode with recommended extensions installed (see `.vscode/extensions.json`)
14+
915
## Installation
1016

1117
```console
@@ -28,3 +34,12 @@ npm run build
2834

2935
This command generates static content into the `build` directory and can be served using any static contents hosting service.
3036
you can also use the `npm run serve` command to test the build locally.
37+
38+
## Linting and Formatting
39+
40+
This project uses [Biomes](https://biomejs.dev/) for linting and formatting. You can run the following commands:
41+
42+
```console
43+
npm run lint
44+
npm run format
45+
```

biome.json

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json",
3+
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
4+
"files": {
5+
"ignoreUnknown": false,
6+
"includes": [
7+
"crowdsec-docs/**/*.ts",
8+
"crowdsec-docs/**/*.tsx",
9+
"crowdsec-docs/**/*.css",
10+
"!**/node_modules/**",
11+
"!crowdsec-docs/plugins/**",
12+
"!crowdsec-docs/build/**"
13+
]
14+
},
15+
"formatter": {
16+
"enabled": true,
17+
"formatWithErrors": false,
18+
"indentStyle": "tab",
19+
"indentWidth": 4,
20+
"lineEnding": "lf",
21+
"lineWidth": 140,
22+
"attributePosition": "auto",
23+
"bracketSameLine": false,
24+
"bracketSpacing": true,
25+
"expand": "auto",
26+
"useEditorconfig": true
27+
},
28+
"linter": {
29+
"enabled": true,
30+
"rules": {
31+
"recommended": true,
32+
"style": {
33+
"useImportType": "off"
34+
}
35+
}
36+
},
37+
"javascript": {
38+
"formatter": {
39+
"jsxQuoteStyle": "double",
40+
"quoteProperties": "asNeeded",
41+
"trailingCommas": "es5",
42+
"semicolons": "always",
43+
"arrowParentheses": "always",
44+
"bracketSameLine": false,
45+
"quoteStyle": "double",
46+
"attributePosition": "auto",
47+
"bracketSpacing": true
48+
}
49+
},
50+
"html": { "formatter": { "selfCloseVoidElements": "always" } },
51+
"css": {
52+
"formatter": {
53+
"enabled": true,
54+
"indentStyle": "tab",
55+
"indentWidth": 4,
56+
"lineEnding": "lf",
57+
"lineWidth": 140
58+
}
59+
},
60+
"assist": {
61+
"enabled": true,
62+
"actions": { "source": { "organizeImports": "on" } }
63+
}
64+
}

crowdsec-docs/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v20.18.1

crowdsec-docs/.prettierrc

Lines changed: 0 additions & 6 deletions
This file was deleted.

crowdsec-docs/babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

crowdsec-docs/components.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
"tailwind": {
44
"config": "tailwind.config.js",
55
"css": "src/css/custom.css",
6-
"baseColor": "neutral",
7-
"prefix": "tw-",
8-
"cssVariables": false
6+
"baseColor": "gray",
7+
"prefix": "",
8+
"cssVariables": true
99
},
1010
"rsc": true,
1111
"aliases": {
12-
"utils": "@/src/utils",
13-
"components": "@/src/components",
14-
"ui": "@/src/ui",
15-
"hooks": "@/src/hooks",
16-
"lib": "@/src/lib"
12+
"utils": "@site/src/utils",
13+
"components": "@site/src/components",
14+
"ui": "@site/src/ui",
15+
"hooks": "@site/src/hooks",
16+
"lib": "@site/src/lib"
1717
},
18-
"style": "default"
18+
"style": "default",
19+
"iconLibrary": "lucide"
1920
}
2021

crowdsec-docs/docs/appsec/quickstart/nginxopenresty.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ title: Nginx / OpenResty
77
import Tabs from '@theme/Tabs';
88
import TabItem from '@theme/TabItem';
99
import CodeBlock from '@theme/CodeBlock';
10+
import UnderlineTooltip from '@site/src/components/underline-tooltip';
1011

1112
# CrowdSec WAF QuickStart for Nginx/OpenResty
1213

@@ -42,7 +43,7 @@ To begin setting up the AppSec Component, the initial step is to install a relev
4243

4344
We will utilize the [`crowdsecurity/appsec-virtual-patching`](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-virtual-patching) collection, which offers a wide range of rules aimed at identifying and preventing the exploitation of known vulnerabilities.
4445

45-
This [collection](/concepts.md#collections) is regularly updated to include protection against newly discovered vulnerabilities. Upon installation, it receives automatic daily updates to ensure your protection is always current.
46+
This <UnderlineTooltip tooltip="Collections are bundle of parsers, scenarios, postoverflows that form a coherent package.">collection</UnderlineTooltip> is regularly updated to include protection against newly discovered vulnerabilities. Upon installation, it receives automatic daily updates to ensure your protection is always current.
4647
Furthermore we also install the [`crowdsecurity/appsec-generic-rules`](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-generic-rules) collection. This collection contains detection scenarios for generic attack vectors. It provides some protection in cases where specific scenarios for vulnerabilities do not exist (yet).
4748

4849
On the machine where the Security Engine is installed, just execute the following command:
@@ -59,11 +60,11 @@ Executing this command will install the following items:
5960

6061
- The [*AppSec Rules*](/appsec/rules_syntax.md) contain the definition of malevolent requests to be matched and stopped
6162
- The [*AppSec Configuration*](/appsec/configuration.md#appsec-configuration) links together a set of rules to provide a coherent set
62-
- The [*CrowdSec Parser*](/concepts.md#parsers) and [*CrowdSec Scenario(s)*](/concepts.md#scenarios) bans for a longer duration repeating offenders
63+
- The <UnderlineTooltip tooltip="YAML files that extract relevant data from logs, such as IP addresses, timestamps, or request paths.">CrowdSec Parser</UnderlineTooltip> and <UnderlineTooltip tooltip="Behavioral rules written in a domain-specific language that define what malicious activity looks like, such as multiple failed logins in a short time.">CrowdSec Scenario(s)</UnderlineTooltip> bans for a longer duration repeating offenders
6364

6465
### Setup the Acquisition
6566

66-
Having installed the required components, it's time to configure the CrowdSec [Acquisition](/concepts.md#acquisition) to expose the Application Security Component to our web server. This configuration allows our Nginx/OpenResty server to send requests to the AppSec Component for evaluation and decision-making.
67+
Having installed the required components, it's time to configure the CrowdSec <UnderlineTooltip tooltip="Acquisition files tell CrowdSec where to find logs and which application they belong to.">Acquisition</UnderlineTooltip> to expose the Application Security Component to our web server. This configuration allows our Nginx/OpenResty server to send requests to the AppSec Component for evaluation and decision-making.
6768

6869
Steps:
6970
1. Create the `/etc/crowdsec/acquis.d/` directory (if it doesn't exist on your machine)
@@ -81,7 +82,7 @@ Steps:
8182

8283
The two important directives in this configuration file are:
8384

84-
- `appsec_config` is the name of the [*AppSec Configuration*](appsec/configuration.md#appsec-configuration) that was included in the [Collection](/concepts.md#collections) we just installed.
85+
- `appsec_config` is the name of the [*AppSec Configuration*](appsec/configuration.md#appsec-configuration) that was included in the <UnderlineTooltip tooltip="Collections are bundle of parsers, scenarios, postoverflows that form a coherent package.">Collection</UnderlineTooltip> we just installed.
8586
- the `listen_addr` is the IP and port the AppSec Component will listen to.
8687

8788
:::warning

crowdsec-docs/docs/appsec/quickstart/traefik.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ id: traefik
33
title: Traefik
44
---
55

6-
import FormattedTabs from '@site/src/components/FormattedTabs';
6+
import FormattedTabs from '@site/src/components/formatted-tabs';
7+
import UnderlineTooltip from '@site/src/components/underline-tooltip';
78

89
# CrowdSec WAF QuickStart for Traefik
910

@@ -20,7 +21,7 @@ Additionally, we'll show how to monitor these alerts through the [console](https
2021
1. If you're new to the [AppSec Component](/appsec/intro.md#introduction) or **W**eb **A**pplication **F**irewalls, start with the [Introduction](/appsec/intro.md#introduction) for a better understanding.
2122

2223
2. It's assumed that you have already installed:
23-
- **CrowdSec [Security Engine](intro.mdx)**: for installation, refer to the [QuickStart guide](/u/getting_started/installation/linux). The AppSec Component, which analyzes HTTP requests, is included within the security engine as a [Acquisition](/log_processor/data_sources/appsec.md).
24+
- **CrowdSec [Security Engine](intro.mdx)**: for installation, refer to the [QuickStart guide](/u/getting_started/installation/linux). The AppSec Component, which analyzes HTTP requests, is included within the security engine as a <UnderlineTooltip tooltip="Acquisition files tell CrowdSec where to find logs and which application they belong to.">Acquisition</UnderlineTooltip>.
2425
- Traefik Plugin **[Remediation Component](/u/bouncers/intro)**: Thanks to [maxlerebourg](https://github.com/maxlerebourg) and team they created a [Traefik Plugin](https://plugins.traefik.io/plugins/6335346ca4caa9ddeffda116/crowdsec-bouncer-traefik-plugin) that allows you to block requests directly from Traefik.
2526

2627
:::info
@@ -39,7 +40,7 @@ To begin setting up the AppSec Component, the initial step is to install a relev
3940

4041
We will utilize the [crowdsecurity/appsec-virtual-patching](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-virtual-patching) collection, which offers a wide range of rules aimed at identifying and preventing the exploitation of known vulnerabilities.
4142

42-
This [collection](/concepts.md#collections) is regularly updated to include protection against newly discovered vulnerabilities. Upon installation, it receives automatic daily updates to ensure your protection is always current.
43+
This <UnderlineTooltip tooltip="Collections are bundle of parsers, scenarios, postoverflows that form a coherent package.">collection</UnderlineTooltip> is regularly updated to include protection against newly discovered vulnerabilities. Upon installation, it receives automatic daily updates to ensure your protection is always current.
4344

4445
Furthermore we also install the [crowdsecurity/appsec-generic-rules](https://app.crowdsec.net/hub/author/crowdsecurity/collections/appsec-generic-rules) collection. This collection contains detection scenarios for generic attack vectors. It provides some protection in cases where specific scenarios for vulnerabilities do not exist (yet).
4546

@@ -63,7 +64,7 @@ Executing this command or updating the compose will install the following items:
6364

6465
- The [*AppSec Rules*](/appsec/rules_syntax.md) contain the definition of malevolent requests to be matched and stopped.
6566
- The [*AppSec Configuration*](/appsec/configuration.md#appsec-configuration) links together a set of rules to provide a coherent set.
66-
- The [*CrowdSec Parser*](/concepts.md#parsers) and [*CrowdSec Scenario(s)*](/concepts.md#scenarios) are used to detect and remediate persistent attacks.
67+
- The <UnderlineTooltip tooltip="YAML files that extract relevant data from logs, such as IP addresses, timestamps, or request paths.">CrowdSec Parser</UnderlineTooltip> and <UnderlineTooltip tooltip="Behavioral rules written in a domain-specific language that define what malicious activity looks like, such as multiple failed logins in a short time.">CrowdSec Scenario(s)</UnderlineTooltip> are used to detect and remediate persistent attacks.
6768

6869
Once you have updated your compose or installed via the command line, will we need to restart the container. However, before we do that, we need to setup the acquisition for the AppSec Component.
6970

0 commit comments

Comments
 (0)