-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Changing nginx.ingress.kubernetes.io/whitelist-source-range error code #13105
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/remove-kind bug |
The |
Apparently this is supported on their end, just not in |
@Gacko can you re-open? |
Context
ingress-nginx
supports an annotation,nginx.ingress.kubernetes.io/whitelist-source-range
(docs), which allows the operator to require requests to come from a specific set of IP addresses.ingress-nginx
returns a403
status code (ref).ngx_http_access_module
(ref).Why is this problematic?
403
error code communicates that the client lacks permissions for a "particular resource, or action" (ref). However, clients will continue to operate under the assumption that requests for a different resource or action may succeed.2. Clients may mishandle/misreport these error messages. For example, a multi-tenant service may treat
4xx
errors as being caused by its clients, rather than a misconfiguration of the service itself.3. Operators may have a difficult time investigating such issues, since it is ambiguous whether the error is caused by the proxy layer or the service itself.
What is the proper status code?
I believe the correct behavior is for
nginx
to return a511
code, which is tailored for this case:Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/511
How could this fix be applied?
Changing from
403
->511
is doubtless a breaking change for clients. Thus, I propose allowing this to be user-configurable, defaulting to existing behavior:ngx_http_access_module
to support custom code:ingress-nginx
:The text was updated successfully, but these errors were encountered: