Replies: 1 comment 1 reply
-
|
You can't really "delete" a gateway-level SecurityPolicy from an HTTPRoute — the inheritance model in Envoy Gateway means route-level policies override gateway-level ones, they don't remove them. What you'd want is to attach a SecurityPolicy to your specific HTTPRoute that effectively disables OIDC. Something like: apiVersion: gateway.envoyproxy.io/v1alpha1
kind: SecurityPolicy
metadata:
name: no-auth
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: my-public-routeIf an empty SecurityPolicy doesn't work (it might not override cleanly), you could try attaching one with a different auth method that's basically a no-op, or use ExtAuth pointing to a service that always returns 200. The cleanest approach is probably to restructure so that the gateway doesn't have OIDC attached globally, and instead attach it to individual HTTPRoutes that need it. That way public routes just don't get a SecurityPolicy. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a security policy attached to my gateway with oidc auth enabled and want to attach a separate security policy to httproutes to opt out of this.
I know I can replace the gateway policy like this
but then I lose my
authorization:block which I'd like to keep.I've tried variations of
but it all fails validation. Giving an invalid config results in
500.Is there a way to do this or do I need to change my architecture to be opt in?
Beta Was this translation helpful? Give feedback.
All reactions