@@ -33,7 +33,17 @@ import RemediationSupportBadges from "@site/src/components/remediation-support-b
3333
3434<RemediationSupportBadges Prometheus MTLS />
3535
36- # CrowdSec Remediation QuickStart for Traefik
36+ :::tip AppSec Support
37+ This bouncer supports the [ AppSec Component] ( /docs/next/appsec/intro ) for
38+ real-time WAF protection. Enable ` crowdsecAppsecEnabled: true ` in your
39+ middleware configuration to get virtual patching and defense against known
40+ CVEs, SQL injection, XSS, and other application-layer attacks.
41+
42+ For a full walkthrough, see the
43+ [ AppSec Quickstart for Traefik] ( /docs/next/appsec/quickstart/traefik ) .
44+ :::
45+
46+ # Traefik on kubernetes
3747
3848## Objectives
3949
@@ -49,25 +59,16 @@ At the end, you will have:
4959- The bouncer key mounted into the Traefik pod as a file
5060- An operational pattern that avoids committing the LAPI key in plaintext
5161
52- :::tip AppSec Support
53- This bouncer supports the [ AppSec Component] ( /docs/next/appsec/intro ) for
54- real-time WAF protection. Enable ` crowdsecAppsecEnabled: true ` in your
55- middleware configuration to get virtual patching and defense against known
56- CVEs, SQL injection, XSS, and other application-layer attacks.
57-
58- For a full walkthrough, see the
59- [ AppSec Quickstart for Traefik] ( /docs/next/appsec/quickstart/traefik ) .
60- :::
61-
6262## Prerequisites
6363
64- 1 . It is assumed that you already have:
65- - A working CrowdSec [ Security Engine] ( /intro.mdx ) installation. For a
66- Kubernetes install quickstart, refer to
67- [ /u/getting_started/installation/kubernetes] ( /u/getting_started/installation/kubernetes ) .
68- - A working Traefik installation in Kubernetes.
69- - Existing ` IngressRoute ` , ` Ingress ` , or other Traefik-managed routes
70- exposing your applications.
64+ It is assumed that you already have:
65+
66+ - A working CrowdSec [ Security Engine] ( /intro.mdx ) installation. For a
67+ Kubernetes install quickstart, refer to
68+ [ /u/getting_started/installation/kubernetes] ( /u/getting_started/installation/kubernetes ) .
69+ - A working Traefik installation in Kubernetes.
70+ - Existing ` IngressRoute ` , ` Ingress ` , or other Traefik-managed routes
71+ exposing your applications.
7172
7273:::warning
7374This integration currently relies on a community Traefik plugin, not on a
@@ -76,9 +77,11 @@ first-party CrowdSec remediation component.
7677The upstream project used in this guide is:
7778
7879- ` maxlerebourg/crowdsec-bouncer-traefik-plugin `
79- :::
80+ :::
81+
82+ ## Required traefik configuration items
8083
81- ### Source IPs
84+ ### Traefik configuration's on source IPs
8285
8386To ensure remediation works correctly, Traefik must receive the real client IP
8487for each request. When Traefik is deployed behind a load balancer, CDN, or
@@ -127,6 +130,7 @@ consequence, the Service's `externalTrafficPolicy` must be set to `Local`, and
127130the workload must run either as a `DaemonSet` or as a `Deployment` ensuring one
128131pod per node. This guarantees that no traffic, and therefore no security
129132events, is missed.
133+
130134</details>
131135
132136# ## Traefik Custom Resource Definitions
@@ -197,8 +201,8 @@ helm upgrade --install traefik traefik/traefik \
197201
198202# # Store the Traefik bouncer key in a Kubernetes secret
199203
200- As with the Envoy guide, the practical approach is to choose a fixed key, store
201- it in a Kubernetes secret, and force `BOUNCER_KEY_traefik` from `lapi.env` with
204+ The practical approach is to choose a fixed key, store it in a Kubernetes
205+ secret, and force `BOUNCER_KEY_traefik` from `lapi.env` with
202206` valueFrom.secretKeyRef` .
203207
204208Create or update the secrets used by CrowdSec LAPI and Traefik :
@@ -251,6 +255,9 @@ helm upgrade --install crowdsec crowdsec/crowdsec \
251255 -f crowdsec-values.yaml
252256` ` `
253257
258+ The second secret of the `crowdsec-keys.yaml` is meant for further use in the
259+ traefik configuration. It will be described later on.
260+
254261# # Verify CrowdSec LAPI access
255262
256263The Traefik middleware only needs access to CrowdSec LAPI. Make sure the
@@ -276,13 +283,9 @@ To achieve remediation in a Traefik environment, create a `Middleware`
276283resource.
277284
278285:::important
279- Unlike the Envoy bouncer deployment, the Traefik `Middleware` CRD does not have
280- a native `secretKeyRef` field for the plugin configuration. In Kubernetes, the
281- recommended pattern is to mount the key from a `Secret` into the Traefik pod and
282- reference it with `crowdsecLapiKeyFile`.
283-
284- Avoid committing a middleware manifest with `crowdsecLapiKey :
285- <real-secret-value>` in Git.
286+ The Traefik `Middleware` CRD does not have a native `secretKeyRef` field for the
287+ plugin configuration. In Kubernetes, the key can be mounted from a `Secret` into
288+ the Traefik pod and reference it with `crowdsecLapiKeyFile`.
286289:: :
287290
288291Mount the Traefik-side secret into the pod and let the middleware read it from a
@@ -343,8 +346,7 @@ literal key in the middleware manifest.
343346<details>
344347<summary>Show direct <code>crowdsecLapiKey</code> example</summary>
345348
346- If you only need a quick functional test, you can still apply a middleware
347- manifest with the key inline :
349+ You can apply a middleware manifest with an inline key as well :
348350
349351` ` ` yaml title="bouncer-middleware.yaml"
350352apiVersion: traefik.io/v1alpha1
@@ -370,7 +372,7 @@ kubectl apply -f bouncer-middleware.yaml
370372` ` `
371373
372374This is useful for quick validation, but `crowdsecLapiKeyFile` with a mounted
373- Kubernetes secret is the recommended approach for production .
375+ Kubernetes secret seems to be a more secure approach .
374376
375377</details>
376378
0 commit comments