Fix(gatewayapi): allow mixed IP and UDS endpoints in backend route references#8530
Fix(gatewayapi): allow mixed IP and UDS endpoints in backend route references#8530stekole wants to merge 5 commits intoenvoyproxy:mainfrom
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
66020cd to
e279442
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8530 +/- ##
==========================================
+ Coverage 74.35% 74.37% +0.01%
==========================================
Files 242 242
Lines 37811 37808 -3
==========================================
+ Hits 28113 28118 +5
+ Misses 7748 7743 -5
+ Partials 1950 1947 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5d23c9f to
32d38cb
Compare
internal/gatewayapi/validate.go
Outdated
| } | ||
| case egv1a1.KindBackend: | ||
| if err := t.validateBackendRefBackend(backendRef.BackendObjectReference, resources, backendNamespace, false); err != nil { | ||
| if err := t.validateBackendRefBackend(backendRef.BackendObjectReference, resources, backendNamespace, true); err != nil { |
There was a problem hiding this comment.
IIRC, we're find to remove the last one parameter from function validateBackendRefBackend.
There was a problem hiding this comment.
Makes sense - Thanks - Addressed.
6f00c6d to
9d4545d
Compare
|
is it possible to add an e2e test to ensure that a mixed backend worked as expected? |
|
Yes - I can write something to validate the route is accepted (not rejected as "MIXED") and traffic flows through. If we want a full HTTP on UDS and serve traffic that may require additional containers and complexity. I think ensuring the route is created is a good first step. Let me know if you'd like to see something else. We can discuss further or happy to address it in a follow-up. |
Fixes envoyproxy#8229 Signed-off-by: stekole <stefan@sandnetworks.com>
Fixes envoyproxy#8229 Signed-off-by: stekole <stefan@sandnetworks.com>
b76668c to
d648970
Compare
|
/retest |
Signed-off-by: stekole <30674956+stekole@users.noreply.github.com>
| * For security reasons, Envoy Gateway MUST reject references to a `Backend` in xRoute resources. For example, UDS and | ||
| localhost references will not be supported for xRoutes. | ||
| * For security reasons, Envoy Gateway MUST reject localhost references to a `Backend` in xRoute resources. | ||
| Unix domain socket references are supported in xRoutes, but admins must ensure proper access controls. |
There was a problem hiding this comment.
how would admins ensure proper access control if app developers can route back into the proxy ?
There was a problem hiding this comment.
Good question. I may not have all the answers but I will references a few things I know.
rbac on Backend resources - the docs already reference restricting who can create Backend CRs, consistent with guidance on CVE-2021-25740. An app developer without RBAC to create Backend resources can't reference UDS: https://github.com/envoyproxy/gateway/blob/main/site/content/en/latest/tasks/traffic/backend.md#L14-L21
UDS also requires a mounted socket in the proxy pod - UDS path in a Backend spec is a no-op unless the socketfile is actually present in the proxy pods filesystem. Mounting it requires an envoyproxy infrastructure patch, which is an admin resource that app developers shouldnt control.
ref: https://github.com/envoyproxy/gateway/blob/main/site/content/en/contributions/design/backend.md#L129-L131
Task doc: https://github.com/envoyproxy/gateway/blob/main/site/content/en/latest/tasks/traffic/backend.md#L37
There was a problem hiding this comment.
loopback routing also looks to be disabled - https://github.com/envoyproxy/gateway/blob/main/internal/gatewayapi/backend.go#L198
Signed-off-by: stekole <30674956+stekole@users.noreply.github.com>
What type of PR is this?
/kind bug
What this PR does / why we need it:
Backend resources with mixed IP and Unix Domain Socket (UDS) endpoints were incorrectly rejected as unsupported mixed address types. Additionally, UDS endpoints were blocked entirely in route backend references.
Which issue(s) this PR fixes:
Fixes #8229
Release Notes: Yes