Skip to content

Commit 5d1d879

Browse files
author
jdv
committed
retour PR
1 parent 51f5489 commit 5d1d879

File tree

1 file changed

+46
-43
lines changed

1 file changed

+46
-43
lines changed

crowdsec-docs/unversioned/getting_started/post_installation/health_check.mdx

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ We'll trigger the dummy scenario `crowdsecurity/http-generic-test` by accessing
3838
<CodeBlock className="language-bash">curl -I https://\<your-service-url\>/crowdsec-test-NtktlJHV4TfBSK3wvlhiOBnl</CodeBlock>
3939

4040
2️⃣ Confirm the alert has triggered for the scenario `crowdsecurity/http-generic-test`
41-
<CodeBlock className="language-bash">sudo cscli alerts list -s crowdsecurity/http-generic-test</CodeBlock>
41+
<CodeBlock className="language-bash">sudo cscli alerts list | grep crowdsecurity/http-generic-test</CodeBlock>
4242

4343
**Notes:**
4444
- Requests from private IP addresses won't trigger alerts (private IPs are whitelisted by default).
@@ -55,7 +55,7 @@ We'll trigger the dummy scenario `crowdsecurity/ssh-generic-test` by attempting
5555
<CodeBlock className="language-bash">ssh crowdsec-test-NtktlJHV4TfBSK3wvlhiOBnl@\<your-server-ip\></CodeBlock>
5656

5757
2️⃣ Confirm the alert has triggered for the scenario `crowdsecurity/ssh-generic-test`
58-
<CodeBlock className="language-bash">sudo cscli alerts list -s crowdsecurity/ssh-generic-test</CodeBlock>
58+
<CodeBlock className="language-bash">sudo cscli alerts list | grep crowdsecurity/ssh-generic-test</CodeBlock>
5959

6060
**Notes:**
6161
- This scenario can only be triggered again after a 5-minutes delay.
@@ -67,15 +67,13 @@ We'll trigger the dummy scenario `crowdsecurity/ssh-generic-test` by attempting
6767
If you've enabled an AppSec-capable bouncer with CrowdSec WAF, you can trigger the `crowdsecurity/appsec-generic-test` dummy scenario.
6868
It would have triggered along with the HTTP detection test, but it is worth mentioning here as well.
6969

70-
Here is how to trigger the `crowdsecurity/appsec-generic-test` dummy scenario by calling a *probe path* on your web server.
71-
7270
We'll trigger the dummy scenario `crowdsecurity/appsec-generic-test` by accessing a **probe path** on your web server.
7371

7472
1️⃣ Access your service URL with this path: `/crowdsec-test-NtktlJHV4TfBSK3wvlhiOBnl`
7573
<CodeBlock className="language-bash">curl -I https://\<your-service-url\>/crowdsec-test-NtktlJHV4TfBSK3wvlhiOBnl</CodeBlock>
7674

7775
2️⃣ Confirm the alert has triggered for the scenario `crowdsecurity/appsec-generic-test`
78-
<CodeBlock className="language-bash">sudo cscli alerts list -s crowdsecurity/appsec-generic-test</CodeBlock>
76+
<CodeBlock className="language-bash">sudo cscli alerts list | grep crowdsecurity/appsec-generic-test</CodeBlock>
7977

8078
**Notes:**
8179
- This scenario can only be triggered again after a 1-minute delay.
@@ -145,15 +143,15 @@ Were all the tests related to your setup successful?
145143
- 💡 Hint:
146144
- The hub page of the collection you installed provides an example of the acquisition configuration file to create.
147145
- For example:
148-
- The [NGINX collection hub page](https://app.crowdsec.net/hub/author/crowdsecurity/collections/nginx)
149-
- Or the [SSHD collection hub page](https://app.crowdsec.net/hub/author/crowdsecurity/collections/sshd) (that is contained in the Linux Collection).
146+
- The [NGINX collection hub page ↗️](https://app.crowdsec.net/hub/author/crowdsecurity/collections/nginx)
147+
- Or the [SSHD collection hub page ↗️](https://app.crowdsec.net/hub/author/crowdsecurity/collections/sshd) (that is contained in the Linux Collection).
150148
- Make sure that the **type** declared in the matches the **parser** expected to be used: nginx, apache, syslog, etc.
151149
</details>
152150

153151
<details id="troubleshooting_collection">
154152
<summary>📦 Collection Troubleshooting -- Are the right parsers and scenarios installed?</summary>
155153

156-
CrowdSec, via its [**Hub**](https://app.crowdsec.net/hub/collections) uses collections to package correct parsers and detection scenarios for your services.
154+
CrowdSec, via its [**Hub** ↗️](https://app.crowdsec.net/hub/collections) uses collections to package correct parsers and detection scenarios for your services.
157155
- On regular **host** installations, CrowdSec usually detects your services (like nginx or ssh) and installs the appropriate collections automatically.
158156
- On **Docker**, **Kubernetes**, or **custom setups**, you may need to install them manually.
159157

@@ -168,10 +166,10 @@ Were all the tests related to your setup successful?
168166
- If they’re listed, the right collection is likely installed.
169167

170168
#### 📥 Install missing collections
171-
1. Visit the [CrowdSec Hub](https://hub.crowdsec.net/) and search for a collection matching your service, like:
172-
- [nginx](https://app.crowdsec.net/hub/author/crowdsecurity/collections/nginx)
173-
- [apache](https://app.crowdsec.net/hub/author/crowdsecurity/collections/apache)
174-
- [linux](https://app.crowdsec.net/hub/author/crowdsecurity/collections/linux)
169+
1. Visit the [CrowdSec Hub ↗️](https://hub.crowdsec.net/) and search for a collection matching your service, like:
170+
- [nginx ↗️](https://app.crowdsec.net/hub/author/crowdsecurity/collections/nginx)
171+
- [apache ↗️](https://app.crowdsec.net/hub/author/crowdsecurity/collections/apache)
172+
- [linux ↗️](https://app.crowdsec.net/hub/author/crowdsecurity/collections/linux)
175173
- etc...
176174
2. Follow the installation instructions on the collection’s page, including any required acquisition setup.
177175

@@ -193,7 +191,8 @@ Were all the tests related to your setup successful?
193191
- 💡 make sure it will be up after restart, activate the service
194192

195193
If the service fails to start, you can check the logs for more information:
196-
<CodeBlock className="language-bash">sudo journalctl -u crowdsec</CodeBlock>
194+
For linux systems, the logs are typically located in `/var/log/crowdsec.log`.
195+
<CodeBlock className="language-bash">less /var/log/crowdsec.log</CodeBlock>
197196

198197
Common reasons the service might fail::
199198
- Misconfiguration in the `config.yaml` file.
@@ -227,6 +226,7 @@ This connection allows you to:
227226

228227
**Notes:**
229228
- On a fresh install, it might take a few minutes before any decisions appear.
229+
- Restarting the CrowdSec service will force it to perform a first pull.
230230
</details>
231231

232232
### Were all the tests successful ?
@@ -237,20 +237,21 @@ Were all the tests related to your setup successful?
237237
🛠️ If not, check the troubleshooting section below.
238238

239239
<details>
240-
<summary>🐞 Connectivity Troubleshooting</summary>
240+
<summary>🐞 Connectivity Troubleshooting</summary>
241241

242242
Let’s verify your CAPI connection step-by-step.
243243

244244
Check CAPI status:
245245
<CodeBlock className="language-bash">sudo cscli capi status</CodeBlock>
246-
- Should show:
247-
- `INFO You can successfully interact with Central API (CAPI)`
248-
- Along with information about the connectivity config file path and if your Security engine is enrolled in CrowdSec console.
249246

250-
Common issues include:
247+
**Should show:**
248+
- `INFO You can successfully interact with Central API (CAPI)`
249+
- Along with information about the connectivity config file path and if your Security engine is enrolled in CrowdSec console.
250+
251+
**Common issues include:**
251252
- Missing `online_api_credentials.yaml` in your CrowdSec config directory
252253
- If they don't exist, you can create them by running the command:
253-
<CodeBlock className="language-bash">sudo cscli capi register</CodeBlock>
254+
<CodeBlock className="language-bash">sudo cscli capi register</CodeBlock>
254255
- Firewall rules blocking outbound connections to the CrowdSec Central API (api.crowdsec.net)
255256
- DNS resolution issues.
256257
- Proxy server configuration.
@@ -281,13 +282,12 @@ OR do it from a device with a different public IP address than the client you're
281282

282283
1️⃣ Find your public IP:
283284
<CodeBlock className="language-bash">curl api.ipify.org</CodeBlock>
284-
or
285-
<CodeBlock className="language-bash">curl curl ipinfo.io/ip</CodeBlock>
286285

287286
2️⃣ Add a ban decision for your IP (valid for 1 minute):
288-
<CodeBlock className="language-bash">sudo cscli decisions add ban --ip \<your-public-ip\> --duration 1m --reason "CrowdSec remediation test"</CodeBlock>
287+
<CodeBlock className="language-bash">sudo cscli decisions add --ip \<your-public-ip\> --duration 1m --reason "CrowdSec remediation test"</CodeBlock>
289288

290-
3️⃣ Try accessing your service (e.g. website, API). from the same public IP address.
289+
*Wait a few seconds to ensure the decision is processed by the bouncer.*
290+
3️⃣ Try accessing your service (e.g. website, API). from the same public IP address.
291291
➡️ You should be blocked by the bouncer. returning a forbidden response (HTTP 403) or a captcha challenge.
292292

293293
4️⃣ Wait for 1 minute, then check the decisions list to see if the decision has been removed
@@ -305,31 +305,34 @@ You might want to continue to the next recommended steps:
305305
<details>
306306
<summary>🐞 **Remediation Troubleshooting**</summary>
307307

308-
Before diving into troubleshooting, remember that a bouncer is a separate component that connects to the Security Engine and regularly pulls decisions (like bans or captchas) to apply them at its level (firewall, web server, etc.). If remediation isn’t working, it’s often due to issues in this communication loop.
309-
310-
<details>
311-
<summary>Bouncer Configuration Troubleshooting</summary>
312-
313-
* Verifying that the bouncer is registered and active.
314-
* Checking bouncer logs for errors.
315-
* Troubleshooting communication issues between the bouncer and the CrowdSec LAPI.
316-
* Firewall configuration for the bouncer.
317-
* Specific troubleshooting steps for common bouncers (firewall-bouncer, nginx-bouncer, etc.).)
318-
319-
</details>
308+
Before diving into troubleshooting, remember that a remediation components (AKA **bouncer**) is a separate component that connects to the Security Engine and regularly pulls decisions (like bans or captchas) to apply them at its level (firewall, web server, etc.). If remediation isn’t working, it’s often due to issues in this communication loop.
309+
You can find more information about bouncers in the [Bouncers documentation](https://doc.crowdsec.net/docs/next/bouncers/intro).
310+
The full list of available bouncers is available on the [CrowdSec Hub ↗️](https://app.crowdsec.net/hub/remediation-components).
320311

321312
<details>
322-
<summary>Profile Troubleshooting</summary>
323-
324-
* Verifying profile configuration.
325-
* Troubleshooting errors related to profile application.
326-
* Understanding the impact of profiles on detection and remediation.)
327-
313+
<summary>Is your Bouncer Installed and Connected to your Security engine</summary>
314+
315+
- Check bouncers linked to your Security Engine:
316+
<CodeBlock className="language-bash">sudo cscli bouncers list</CodeBlock>
317+
You should see:
318+
- The bouncer name
319+
- A tick in the valid column indicating that the bouncer is properly registered and connected to your Security Engine.
320+
- a recent `Last API pull` datasources
321+
322+
- If your bouncer is not valid or not pulling it might be an issue with the bouncer configuration authentication in its configuration file.
323+
- If you don't see your bouncer listed, you should add it
324+
- You can try to re-register your bouncer with the command:
325+
<CodeBlock className="language-bash">sudo cscli bouncers add</CodeBlock>
326+
- Copy the provided token and paste it in your bouncer configuration file.
327+
- Then restart the bouncer service.
328+
329+
- If your bouncer is on a different machine, ensure it can reach the Security Engine Local API.
330+
- If you are using a bouncer in a container, ensure that the container can reach the Security Engine Local API.
328331
</details>
329332
</details>
330333

331334
## 💬 Your feedback is important!
332335

333336
Help us improve this health check guide!
334-
[📨 Open an issue on GitHub](https://github.com/crowdsecurity/crowdsec-docs/issues/new) or
335-
🗣️ Join the conversation on [Discord](https://discord.gg/wGN7ShmEE8)
337+
[📨 Open an issue on GitHub ↗️](https://github.com/crowdsecurity/crowdsec-docs/issues/new) or
338+
🗣️ Join the conversation on [Discord ↗️](https://discord.gg/wGN7ShmEE8)

0 commit comments

Comments
 (0)