Hi All,
I'm trying to block incoming requests through a k8 ingress if a header is present?
I'm looking here: Headers - Traefik but don't see anything obvious.
Following code fails to block and i'm not sure why:
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: test-header
spec:
headers:
customRequestHeaders:
X-Script-Name: "http_x_hasura_admin_secret"
frameDeny: true
Thanks
James
Hello @jamesdhope,
maybe you could block the incoming request by modifing the IngressRoute?
Something like this:
[...]
spec:
entryPoints:
- foobar
routes:
- match: Host(`subdomain.example.invalid`) && (! HeadersRegexp(`key`, `.*`)))
kind: Rule
services:
[...]
(disclaimer: I didn't try this out)
Best regards,
Wolfgang
I tried something similar to this yesterday and it didn't work w/ Traefik as an ingress controller on k8s. Did you ever get this working?