Compare commits

...

2 Commits

Author SHA1 Message Date
31cad6e3cb add crowdsec console enrollment 2026-01-21 16:29:22 +00:00
039354993e cleanup gitignore, improve crowdsec 2026-01-21 16:25:39 +00:00
7 changed files with 38 additions and 7 deletions

12
.gitignore vendored Normal file
View File

@@ -0,0 +1,12 @@
# Ignore these files
**/services/.env
# Ignore these folders
letsencrypt/
certs/
log-dashboard/
lib/
**/headscale/config/
**/headscale/run/
**/crowdsec/config/
**/crowdsec/data/

View File

@@ -2,3 +2,9 @@
This configuration includes a reverse proxy using caddy, headscale (VPN) and watchtower (automatic updates).
It is particularly useful if you do not own an IPV4 address, as this could be deployed on a server. In this case it was deployed on an oracle server and automated using an ansible playbook found on this [repository](https://gitea.crescentec.ch/chriswin/vps-ansible)
For Crowdsec, if an enrollment to your console is wanted, run the following command:
```
docker compose -it exec cscli console enroll $ENROLLMENT_KEY
```
where the the enrollment can be found in your console under the engine page.

View File

@@ -1 +0,0 @@
CROWDSEC_API_KEY=8lbUZjrGQp9JZln2pa5G1SCj0Fc8f9SaZUwqLm+6ZJQ

View File

@@ -0,0 +1,6 @@
appsec_configs:
- crowdsecurity/appsec-default
labels:
type: appsec
listen_addr: 0.0.0.0:7422
source: appsec

View File

@@ -18,6 +18,7 @@ services:
- ${SERVICE_PATH}/crowdsec/config/acquis.yaml:/etc/crowdsec/acquis.yaml:ro
- ${SERVICE_PATH}/crowdsec/config/config.yaml:/etc/crowdsec/config.yaml
- ${SERVICE_PATH}/crowdsec/config:/etc/crowdsec
- ${SERVICE_PATH}/crowdsec/appsec.yaml:/etc/crowdsec/acquis.d/appsec.yaml
- ${SERVICE_PATH}/crowdsec/data:/var/lib/crowdsec/data
- /var/log/traefik:/var/log/crowdsec:ro
- /var/log/syslog:/var/log/syslog:ro

View File

@@ -17,5 +17,10 @@ services:
networks:
- ip4net
labels:
# Watchtower
- "com.centurylinklabs.watchtower.enable=true"
# Traefik
- "traefik.enable=true"
- "traefik.http.routers.headscale.rule=Host(`headscale.${PUBLIC_DOMAIN}`)"
- "traefik.http.routers.headscale.entrypoints=https"
- "traefik.http.routers.headscale.tls.certresolver=myresolver"
- "traefik.http.routers.headscale.tls=true"
- "traefik.http.routers.headscale.middlewares=crowdsec-bouncer@file"

View File

@@ -10,11 +10,13 @@ http:
updateIntervalSeconds: 60
crowdsecMode: stream
crowdsecAppsecEnabled: true
crowdsecAppsecFailureBlock: true
crowdsecAppsecUnreachableBlock: true
crowdsecAppsecHost: crowdsec:7422
crowdsecLapiScheme: http
crowdsecLapiHost: crowdsec:8080
# generated using "docker exec crowdsec cscli bouncers add crowdsecBouncer"
crowdseclapikey: {{ env "TRAEFIK_CROWDSEC_API_KEY" }}
crowdsecLapikey: {{ env "TRAEFIK_CROWDSEC_API_KEY" }}
forwardedHeadersTrustedIPs:
- 10.0.0.0/8
clientTrustedIPs: