Compare commits
2 Commits
f0521563b5
...
31cad6e3cb
| Author | SHA1 | Date | |
|---|---|---|---|
| 31cad6e3cb | |||
| 039354993e |
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal 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/
|
||||||
@@ -2,3 +2,9 @@
|
|||||||
|
|
||||||
This configuration includes a reverse proxy using caddy, headscale (VPN) and watchtower (automatic updates).
|
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)
|
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.
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
CROWDSEC_API_KEY=8lbUZjrGQp9JZln2pa5G1SCj0Fc8f9SaZUwqLm+6ZJQ
|
|
||||||
6
services/crowdsec/appsec.yaml
Normal file
6
services/crowdsec/appsec.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
appsec_configs:
|
||||||
|
- crowdsecurity/appsec-default
|
||||||
|
labels:
|
||||||
|
type: appsec
|
||||||
|
listen_addr: 0.0.0.0:7422
|
||||||
|
source: appsec
|
||||||
@@ -18,6 +18,7 @@ services:
|
|||||||
- ${SERVICE_PATH}/crowdsec/config/acquis.yaml:/etc/crowdsec/acquis.yaml:ro
|
- ${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/config.yaml:/etc/crowdsec/config.yaml
|
||||||
- ${SERVICE_PATH}/crowdsec/config:/etc/crowdsec
|
- ${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
|
- ${SERVICE_PATH}/crowdsec/data:/var/lib/crowdsec/data
|
||||||
- /var/log/traefik:/var/log/crowdsec:ro
|
- /var/log/traefik:/var/log/crowdsec:ro
|
||||||
- /var/log/syslog:/var/log/syslog:ro
|
- /var/log/syslog:/var/log/syslog:ro
|
||||||
|
|||||||
@@ -3,19 +3,24 @@ services:
|
|||||||
extends:
|
extends:
|
||||||
file: ${TEMPLATES_PATH}
|
file: ${TEMPLATES_PATH}
|
||||||
service: default
|
service: default
|
||||||
image: docker.io/headscale/headscale
|
image: docker.io/headscale/headscale
|
||||||
container_name: headscale
|
container_name: headscale
|
||||||
volumes:
|
volumes:
|
||||||
- ${SERVICE_PATH}/headscale/config:/etc/headscale
|
- ${SERVICE_PATH}/headscale/config:/etc/headscale
|
||||||
- ${SERVICE_PATH}/headscale/lib:/var/lib/headscale
|
- ${SERVICE_PATH}/headscale/lib:/var/lib/headscale
|
||||||
- ${SERVICE_PATH}/headscale/run:/var/run/headscale
|
- ${SERVICE_PATH}/headscale/run:/var/run/headscale
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:8080:8080 # api
|
- 127.0.0.1:8080:8080 # api
|
||||||
- 127.0.0.1:9090:9090 # metrics
|
- 127.0.0.1:9090:9090 # metrics
|
||||||
command: serve
|
command: serve
|
||||||
environment:
|
environment:
|
||||||
networks:
|
networks:
|
||||||
- ip4net
|
- ip4net
|
||||||
labels:
|
labels:
|
||||||
# Watchtower
|
# Traefik
|
||||||
- "com.centurylinklabs.watchtower.enable=true"
|
- "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"
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ http:
|
|||||||
updateIntervalSeconds: 60
|
updateIntervalSeconds: 60
|
||||||
crowdsecMode: stream
|
crowdsecMode: stream
|
||||||
crowdsecAppsecEnabled: true
|
crowdsecAppsecEnabled: true
|
||||||
|
crowdsecAppsecFailureBlock: true
|
||||||
|
crowdsecAppsecUnreachableBlock: true
|
||||||
crowdsecAppsecHost: crowdsec:7422
|
crowdsecAppsecHost: crowdsec:7422
|
||||||
crowdsecLapiScheme: http
|
crowdsecLapiScheme: http
|
||||||
crowdsecLapiHost: crowdsec:8080
|
crowdsecLapiHost: crowdsec:8080
|
||||||
# generated using "docker exec crowdsec cscli bouncers add crowdsecBouncer"
|
# generated using "docker exec crowdsec cscli bouncers add crowdsecBouncer"
|
||||||
crowdseclapikey: {{ env "TRAEFIK_CROWDSEC_API_KEY" }}
|
crowdsecLapikey: {{ env "TRAEFIK_CROWDSEC_API_KEY" }}
|
||||||
forwardedHeadersTrustedIPs:
|
forwardedHeadersTrustedIPs:
|
||||||
- 10.0.0.0/8
|
- 10.0.0.0/8
|
||||||
clientTrustedIPs:
|
clientTrustedIPs:
|
||||||
|
|||||||
Reference in New Issue
Block a user