Skip to content

Commit da84805

Browse files
authored
Doc improvements (crowdsecurity#644)
* fix crowdsecurity#640 : add faq about metrics and 'is my setup working' * up documentation go routines, fix crowdsecurity#637 * to merge along with crowdsecurity/hub#160 to improve forensic's doc
1 parent 4565d82 commit da84805

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

docs/faq.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,20 @@ SQLite by default as it's suitable for standalone/single-machine setups.
5353

5454
## How to control granularity of actions ? (whitelists, simulation etc.)
5555

56-
{{v1X.crowdsec.name}} support both [whitelists]((/Crowdsec/v1/write_configurations/whitelist/) and [simulation](/Crowdsec/v1/references/simulation/) :
56+
{{v1X.crowdsec.name}} support both [whitelists](/Crowdsec/v1/write_configurations/whitelist/) and [simulation](/Crowdsec/v1/references/simulation/) :
5757

5858
- Whitelists allows you to "discard" events or overflows
5959
- Simulation allows you to simply cancel the decision that is going to be taken, but keep track of it
6060

6161
{{v1X.profiles.htmlname}} allows you to control which decision will be applied to which alert.
6262

63+
## How to know if my setup is working correctly ? Some of my logs are unparsed, is it normal ?
64+
65+
Yes, crowdsec parsers only parse the logs that are relevant for scenarios :)
66+
67+
Take a look at `cscli metrics` [and understand what do they mean](/Crowdsec/v1/getting_started/crowdsec-tour/#reading-metrics) to know if your setup is correct.
68+
69+
6370
## How to add whitelists ?
6471

6572
You can follow this [guide](/Crowdsec/v1/write_configurations/whitelist/)

docs/v1.X/docs/getting_started/crowdsec-tour.md

+28
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,26 @@ INFO[0000] Local Api Bouncers Metrics:
190190

191191
</details>
192192

193+
### Reading metrics
194+
195+
Those metrics are a great way to know if your configuration is correct :
196+
197+
The `Acquisition Metrics` is a great way to know if your parsers are setup correctly :
198+
199+
- If you have 0 **LINES PARSED** for a source : You are probably *missing* a parser, or you have a custom log format that prevents the parser from understanding your logs.
200+
- However, it's perfectly OK to have a lot of **LINES UNPARSED** : Crowdsec is not a SIEM, and only parses the logs that are relevant to its scenarios. For example, [ssh parser](https://hub.crowdsec.net/author/crowdsecurity/configurations/sshd-logs), only cares about failed authentication events (at the time of writting).
201+
- **LINES POURED TO BUCKET** tell you that your scenarios are matching your log sources : it means that some events from this log source made all their way to an actual scenario
202+
203+
204+
The `Parser Metrics` will let you troubleshoot eventual parser misconfigurations :
205+
- **HITS** is how many events where fed to this specific parser
206+
- **PARSED** and **UNPARSED** indicate how many events successfully come out of the parser
207+
208+
For example, if you have a custom log format in nginx that is not supported by the default parser, you will end up seeing a lot of **UNPARSED** for this specific parser, and 0 for **PARSED**.
209+
210+
For more advanced metrics understanding, [take a look at the dedicated prometheus documentation](/Crowdsec/v1/observability/prometheus/).
211+
212+
193213
## Deploy dashboard
194214

195215
```bash
@@ -217,3 +237,11 @@ sudo cscli collections install crowdsecurity/nginx
217237
Collections are bundles of parsers/scenarios that form a coherent ensemble to analyze/detect attacks for a specific service. It is the most common way to deploy configurations.
218238

219239
They can be found and browsed on the {{v1X.hub.htmlname}}
240+
241+
## Scalability
242+
243+
Crowdsec uses go-routines for parsing and enriching logs, pouring events to buckets and manage outputs.
244+
245+
By default, one routine of each exists (should be enough to handle ~1K EP/s), and can be changed in `crowdsec_service` of the main configuration file via the [parser_routines](/Crowdsec/v1/references/crowdsec-config/#parser_routines), [buckets_routines](/Crowdsec/v1/references/crowdsec-config/#buckets_routines) and [output_routines](/Crowdsec/v1/references/crowdsec-config/#output_routines) directives.
246+
247+
Please keep in mind that thanks to the [http API]({{v1X.lapi.swagger}}), the workload of log parsing can be splitted amongst several agents pushing to a single {{v1X.lapi.Htmlname}}.

docs/v1.X/docs/user_guide/forensic_mode.md

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ INFO[13-11-2020 13:05:24] (14baeedafc1e44c08b806fc0c1cd92c4/crowdsec) crowdsecur
3535
And as these alerts are as well pushed to database, it mean you can view them in metabase, or using cscli !
3636

3737

38+
!!! warning
39+
To work in forensic mode, crowdsec-agent relies on [crowdsecurity/dateparse-enrich](https://hub.crowdsec.net/author/crowdsecurity/configurations/dateparse-enrich) to parse date formats. See dedicated hub page for supported formats.
40+
41+
3842
## Injecting alerts into existing database
3943

4044
If you already have a running crowdsec/Local API running and want to inject events into existing database, you can run crowdsec directly :

0 commit comments

Comments
 (0)