-
Notifications
You must be signed in to change notification settings - Fork 361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deny-all SecurityPolicy can return 403 or 404, depending on HTTPRoutes #4678
Comments
just noticed that gateway/api/v1alpha1/shared_types.go Line 680 in 5d3df77
as a workaround until statusCode is implemented in responseOverride, what you can do is add a pathPrefix match of |
Envoy Gateway does support filter ordering https://gateway.envoyproxy.io/docs/tasks/operations/customize-envoyproxy/#customize-filter-order but the router filter must be the terminal/last filter (mandated by envoy proxy) so that won't be helpful here |
keeping this issue open to implement updating statusCode within |
Fixes: envoyproxy#4678 Signed-off-by: Arko Dasgupta <[email protected]>
Fixes: envoyproxy#4678 Signed-off-by: Arko Dasgupta <[email protected]>
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
Description:
Using a
SecurityPolicy
to allow-list source IPs, envoy only returns a 403/forbidden when a HTTP/HTTPS request matches anHTTPRoute
. If a request does not match anHTTPRoute
, envoy returns a 404.Repro steps:
Query a hostname or the envoy proxy directly, from an IP that should be forbidden. Say a Gateway has some IP
EnvoyIP
. And theSecurityPolicy
should deny our client IP always (e.g. make the rules list empty for repro).Good, that above is expected. However, if you make a query that does not match a route, you'll get a 404 instead.
Our expectation was that all traffic from a disallowed IP would receive a 403. Its undesired, because external parties have visibility into what hostnames/domains are served by a particular Gateway.
Basically this is an ordering question: Which comes first the 404 logic or the rbac forbidden?
Environment:
v1.2.1
Logs:
The text was updated successfully, but these errors were encountered: