diff --git a/README.md b/README.md index fc73118..2df7c54 100644 --- a/README.md +++ b/README.md @@ -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 ``` +### 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= +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 diff --git a/swarm/crowdsec.yml b/swarm/crowdsec.yml index 7158059..99cd874 100644 --- a/swarm/crowdsec.yml +++ b/swarm/crowdsec.yml @@ -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