mirror of
https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin.git
synced 2026-07-21 11:38:59 +02:00
Exemples -> Examples (#116)
* Exemples -> Examples * Exemples -> Examples * Uppercase * Uppercase v2 * Uppercase v3 * Uppercases * Another one * Add whoami because .gitignore is ignoring conf folder
This commit is contained in:
@@ -26,19 +26,19 @@ run_local:
|
|||||||
docker-compose -f docker-compose.local.yml up -d --remove-orphans
|
docker-compose -f docker-compose.local.yml up -d --remove-orphans
|
||||||
|
|
||||||
run_behindproxy:
|
run_behindproxy:
|
||||||
docker-compose -f exemples/behind-proxy/docker-compose.cloudflare.yml up -d --remove-orphans
|
docker-compose -f examples/behind-proxy/docker-compose.cloudflare.yml up -d --remove-orphans
|
||||||
|
|
||||||
run_cacheredis:
|
run_cacheredis:
|
||||||
docker-compose -f exemples/redis-cache/docker-compose.redis.yml up -d --remove-orphans
|
docker-compose -f examples/redis-cache/docker-compose.redis.yml up -d --remove-orphans
|
||||||
|
|
||||||
run_trustedips:
|
run_trustedips:
|
||||||
docker-compose -f exemples/trusted-ips/docker-compose.trusted.yml up -d --remove-orphans
|
docker-compose -f examples/trusted-ips/docker-compose.trusted.yml up -d --remove-orphans
|
||||||
|
|
||||||
run_binaryvm:
|
run_binaryvm:
|
||||||
cd exemples/binary-vm/ && sudo vagrant up
|
cd examples/binary-vm/ && sudo vagrant up
|
||||||
|
|
||||||
run_tlsauth:
|
run_tlsauth:
|
||||||
docker-compose -f exemples/tls-auth/docker-compose.tls-auth.yml down && docker-compose -f exemples/tls-auth/docker-compose.tls-auth.yml up -d && docker-compose -f exemples/tls-auth/docker-compose.tls-auth.yml restart && docker-compose -f exemples/tls-auth/docker-compose.tls-auth.yml logs -f
|
docker-compose -f examples/tls-auth/docker-compose.tls-auth.yml down && docker-compose -f examples/tls-auth/docker-compose.tls-auth.yml up -d && docker-compose -f examples/tls-auth/docker-compose.tls-auth.yml restart && docker-compose -f examples/tls-auth/docker-compose.tls-auth.yml logs -f
|
||||||
|
|
||||||
run:
|
run:
|
||||||
docker-compose -f docker-compose.yml up -d --remove-orphans
|
docker-compose -f docker-compose.yml up -d --remove-orphans
|
||||||
@@ -53,16 +53,16 @@ restart:
|
|||||||
docker-compose -f docker-compose.yml restart
|
docker-compose -f docker-compose.yml restart
|
||||||
|
|
||||||
restart_behindproxy:
|
restart_behindproxy:
|
||||||
docker-compose -f exemples/behind-proxy/docker-compose.cloudflare.yml restart
|
docker-compose -f examples/behind-proxy/docker-compose.cloudflare.yml restart
|
||||||
|
|
||||||
restart_cacheredis:
|
restart_cacheredis:
|
||||||
docker-compose -f exemples/redis-cache/docker-compose.redis.yml restart
|
docker-compose -f examples/redis-cache/docker-compose.redis.yml restart
|
||||||
|
|
||||||
restart_trustedips:
|
restart_trustedips:
|
||||||
docker-compose -f exemples/trusted-ips/docker-compose.trusted.yml restart
|
docker-compose -f examples/trusted-ips/docker-compose.trusted.yml restart
|
||||||
|
|
||||||
restart_tlsauth:
|
restart_tlsauth:
|
||||||
docker-compose -f exemples/tls-auth/docker-compose.tls-auth.yml
|
docker-compose -f examples/tls-auth/docker-compose.tls-auth.yml
|
||||||
|
|
||||||
show_logs:
|
show_logs:
|
||||||
docker-compose -f docker-compose.yml restart
|
docker-compose -f docker-compose.yml restart
|
||||||
@@ -74,15 +74,15 @@ show_dev_logs:
|
|||||||
docker-compose -f docker-compose.dev.yml logs -f
|
docker-compose -f docker-compose.dev.yml logs -f
|
||||||
|
|
||||||
clean_all_docker:
|
clean_all_docker:
|
||||||
docker-compose -f exemples/behind-proxy/docker-compose.cloudflare.yml down --remove-orphans
|
docker-compose -f examples/behind-proxy/docker-compose.cloudflare.yml down --remove-orphans
|
||||||
docker-compose -f exemples/redis-cache/docker-compose.redis.yml down --remove-orphans
|
docker-compose -f examples/redis-cache/docker-compose.redis.yml down --remove-orphans
|
||||||
docker-compose -f exemples/trusted-ips/docker-compose.trusted.yml down --remove-orphans
|
docker-compose -f examples/trusted-ips/docker-compose.trusted.yml down --remove-orphans
|
||||||
docker-compose -f exemples/tls-auth/docker-compose.tls-auth.yml down --remove-orphans
|
docker-compose -f examples/tls-auth/docker-compose.tls-auth.yml down --remove-orphans
|
||||||
docker-compose -f docker-compose.local.yml down --remove-orphans
|
docker-compose -f docker-compose.local.yml down --remove-orphans
|
||||||
docker-compose -f docker-compose.yml down --remove-orphans
|
docker-compose -f docker-compose.yml down --remove-orphans
|
||||||
|
|
||||||
clean_vagrant:
|
clean_vagrant:
|
||||||
cd exemples/binary-vm/ && sudo vagrant destroy -f
|
cd examples/binary-vm/ && sudo vagrant destroy -f
|
||||||
|
|
||||||
|
|
||||||
show_metrics:
|
show_metrics:
|
||||||
|
|||||||
@@ -272,10 +272,10 @@ docker-compose up -d
|
|||||||
|
|
||||||
#### Use certificates to authenticate with CrowdSec
|
#### Use certificates to authenticate with CrowdSec
|
||||||
|
|
||||||
You can follow the example in `exemples/tls-auth` to view how to authenticate with client certificates with the LAPI.
|
You can follow the example in `examples/tls-auth` to view how to authenticate with client certificates with the LAPI.
|
||||||
In that case, communications with the LAPI must go through HTTPS.
|
In that case, communications with the LAPI must go through HTTPS.
|
||||||
|
|
||||||
A script is available to generate certificates in `exemples/tls-auth/gencerts.sh` and must be in the same directory as the inputs for the PKI creation.
|
A script is available to generate certificates in `examples/tls-auth/gencerts.sh` and must be in the same directory as the inputs for the PKI creation.
|
||||||
|
|
||||||
#### Use HTTPS to communicate with the LAPI
|
#### Use HTTPS to communicate with the LAPI
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ To communicate with the LAPI in HTTPS you need to either accept any certificates
|
|||||||
Set the `crowdsecLapiScheme` to https.
|
Set the `crowdsecLapiScheme` to https.
|
||||||
|
|
||||||
Crowdsec must be listening in HTTPS for this to work.
|
Crowdsec must be listening in HTTPS for this to work.
|
||||||
Please see the [tls-auth exemple](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/tls-auth/README.md) or the official documentation: [docs.crowdsec.net/docs/local_api/tls_auth/](https://docs.crowdsec.net/docs/local_api/tls_auth/)
|
Please see the [tls-auth example](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/tls-auth/README.md) or the official documentation: [docs.crowdsec.net/docs/local_api/tls_auth/](https://docs.crowdsec.net/docs/local_api/tls_auth/)
|
||||||
|
|
||||||
#### Manually add an IP to the blocklist (for testing purposes)
|
#### Manually add an IP to the blocklist (for testing purposes)
|
||||||
|
|
||||||
@@ -293,21 +293,21 @@ docker exec crowdsec cscli decisions add --ip 10.0.0.10 -d 10m # this will be ef
|
|||||||
docker exec crowdsec cscli decisions remove --ip 10.0.0.10
|
docker exec crowdsec cscli decisions remove --ip 10.0.0.10
|
||||||
```
|
```
|
||||||
|
|
||||||
### Exemples
|
### Examples
|
||||||
|
|
||||||
#### 1. Behind another proxy service (ex: clouflare) [exemples/behind-proxy/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/behind-proxy/README.md)
|
#### 1. Behind another proxy service (ex: clouflare) [examples/behind-proxy/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/behind-proxy/README.md)
|
||||||
|
|
||||||
#### 2. With Redis as an external shared cache [exemples/redis-cache/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/redis-cache/README.md)
|
#### 2. With Redis as an external shared cache [examples/redis-cache/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/redis-cache/README.md)
|
||||||
|
|
||||||
#### 3. Using Trusted IP (ex: LAN OR VPN) that won't get filtered by crowdsec [exemples/trusted-ips/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/trusted-ips/README.md)
|
#### 3. Using Trusted IP (ex: LAN OR VPN) that won't get filtered by crowdsec [examples/trusted-ips/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/trusted-ips/README.md)
|
||||||
|
|
||||||
#### 4. Using Crowdsec and Traefik installed as binary in a single VM [exemples/binary-vm/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/binary-vm/README.md)
|
#### 4. Using Crowdsec and Traefik installed as binary in a single VM [examples/binary-vm/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/binary-vm/README.md)
|
||||||
|
|
||||||
#### 5. Using https communication and tls authentication with Crowdsec [exemples/tls-auth/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/tls-auth/README.md)
|
#### 5. Using https communication and tls authentication with Crowdsec [examples/tls-auth/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/tls-auth/README.md)
|
||||||
|
|
||||||
#### 6. Using Crowdsec and Traefik in Kubernetes [exemples/kubernetes/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/kubernetes/README.md)
|
#### 6. Using Crowdsec and Traefik in Kubernetes [examples/kubernetes/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/kubernetes/README.md)
|
||||||
|
|
||||||
#### 7. Using Traefik in standalone mode without Crowdsec [exemples/standalone-mode/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/exemples/standalone-mode/README.md)
|
#### 7. Using Traefik in standalone mode without Crowdsec [examples/standalone-mode/README.md](https://github.com/maxlerebourg/crowdsec-bouncer-traefik-plugin/blob/main/examples/standalone-mode/README.md)
|
||||||
|
|
||||||
### Local Mode
|
### Local Mode
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Exemple
|
# Example
|
||||||
## Behind another proxy service (ex: clouflare)
|
## Behind another proxy service (ex: clouflare)
|
||||||
|
|
||||||
You need to configure your Traefik to trust Forwarded headers by your front proxy
|
You need to configure your Traefik to trust Forwarded headers by your front proxy
|
||||||
+1
-1
@@ -14,7 +14,7 @@ services:
|
|||||||
- "--providers.file.filename=/cloud.yaml"
|
- "--providers.file.filename=/cloud.yaml"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
- ./cloudflare-exemple.yaml:/cloud.yaml:ro
|
- ./cloudflare-example.yaml:/cloud.yaml:ro
|
||||||
- logs-cloudflare:/var/log/traefik
|
- logs-cloudflare:/var/log/traefik
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Exemple
|
# Example
|
||||||
|
|
||||||
### Install vagrant
|
### Install vagrant
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
### Kubernetes Exemple
|
### Kubernetes Example
|
||||||
|
|
||||||
#### Official docs
|
#### Official docs
|
||||||
|
|
||||||
@@ -88,4 +88,4 @@ kubectl -n crowdsec exec -it $(kubectl get pods -n crowdsec --selector "k8s-app=
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl -n traefik exec -it $(kubectl get pods -n traefik --selector "app.kubernetes.io/name=traefik" --output=name) sh
|
kubectl -n traefik exec -it $(kubectl get pods -n traefik --selector "app.kubernetes.io/name=traefik" --output=name) sh
|
||||||
```
|
```
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Exemple
|
# Example
|
||||||
## With Redis as an external shared cache
|
## With Redis as an external shared cache
|
||||||
|
|
||||||
The plugin must be configured to connect to a redis instance
|
The plugin must be configured to connect to a redis instance
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Exemple
|
# Example
|
||||||
## Using https communication and tls authentication with Crowdsec
|
## Using https communication and tls authentication with Crowdsec
|
||||||
|
|
||||||
##### Summary
|
##### Summary
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Exemple
|
# Example
|
||||||
## Using Trusted IP (ex: LAN OR VPN) that won't get filtered by crowdsec
|
## Using Trusted IP (ex: LAN OR VPN) that won't get filtered by crowdsec
|
||||||
|
|
||||||
You need to configure your Traefik to trust Forwarded headers by your front proxy
|
You need to configure your Traefik to trust Forwarded headers by your front proxy
|
||||||
@@ -36,4 +36,4 @@ You should get a 200 on http://localhost/foo even if you are on the ban cache
|
|||||||
To play the demo environment run:
|
To play the demo environment run:
|
||||||
```bash
|
```bash
|
||||||
make run_trustedips
|
make run_trustedips
|
||||||
```
|
```
|
||||||
+1
-1
@@ -28,4 +28,4 @@ if err != nil {
|
|||||||
|
|
||||||
## Author
|
## Author
|
||||||
Max Lerebourg @ [Primadviz.com](https://primadviz.com)
|
Max Lerebourg @ [Primadviz.com](https://primadviz.com)
|
||||||
Mathieu Hanotaux
|
Mathieu Hanotaux
|
||||||
|
|||||||
Reference in New Issue
Block a user