feat: add optional CrowdSec Console enrollment configuration

This commit is contained in:
2026-07-19 22:03:44 +08:00
parent 14873961d0
commit dc0de6fcc1
2 changed files with 28 additions and 0 deletions
+24
View File
@@ -94,6 +94,30 @@ Cleanup test decision when done:
docker exec -it $(docker ps --filter label=com.docker.swarm.service.name=crowdsec_crowdsec -q | head -n1) cscli decisions delete --ip <YOUR_TEST_IP>
```
### 7) Optional: enable CrowdSec Console (web UI)
1. Open https://app.crowdsec.net and create/get an enrollment key for this instance.
2. In `swarm/.env`, set:
```env
CROWDSEC_ENROLL_KEY=<paste_enroll_key_from_console>
CROWDSEC_ENROLL_INSTANCE_NAME=swarm-edge-01
CROWDSEC_ENROLL_TAGS=swarm,traefik,production
```
3. Redeploy CrowdSec:
```bash
make deploy-crowdsec
```
4. Confirm enrollment from logs:
```bash
docker service logs --since 10m crowdsec_crowdsec
```
5. Access the web UI at https://app.crowdsec.net (your instance should appear under your organization).
### Notes:
```yaml
# Declaring the user list
+4
View File
@@ -7,6 +7,10 @@ services:
DOCKER_HOST: tcp://tasks.socket-proxy:2375
COLLECTIONS: "crowdsecurity/traefik"
CUSTOM_CS_LAPI_KEY: ${CROWDSEC_LAPI_KEY:?Variable not set}
# Optional CrowdSec Console enrollment (https://app.crowdsec.net)
ENROLL_KEY: ${CROWDSEC_ENROLL_KEY:-}
ENROLL_INSTANCE_NAME: ${CROWDSEC_ENROLL_INSTANCE_NAME:-}
ENROLL_TAGS: ${CROWDSEC_ENROLL_TAGS:-}
deploy:
restart_policy:
condition: any