You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the bug?
On a cluster with anonymous access enabled, when I try to access a resource for which I do not have permissions then I receive a 403 Forbidden response
e.g.
< HTTP/1.1 403 Forbidden
< Content-Type: application/json; charset=UTF-8
< Date: Thu, 05 May 2022 06:09:13 GMT
< Transfer-Encoding: chunked
<
* Connection #0 to host opensearch left intact
{"error":{"root_cause":[{"type":"security_exception","reason":"no permissions for [indices:admin/get] and User [name=opendistro_security_anonymous, backend_roles=[opendistro_security_anonymous_backendrole], requestedTenant=null]"}],"type":"security_exception","reason":"no permissions for [indices:admin/get] and User [name=opendistro_security_anonymous, backend_roles=[opendistro_security_anonymous_backendrole], requestedTenant=null]"},"status":403}
HTTP 403 provides a distinct error case from HTTP 401; while HTTP 401 is returned when the client has not authenticated, and implies that a successful response may be returned following valid authentication, HTTP 403 is returned when the client is not permitted access to the resource despite providing authentication such as insufficient permissions of the authenticated account.
How can one reproduce the bug?
Set up a cluster with anonymous access enabled
As an anonymous user, try to access a resource the unauthenticated user has no permissions for and observe that a 403 Forbidden error is returned.
What is the expected behavior?
A 401 Unauthorized response instead of 403 Forbidden when unauthenticated users try to access resources they do not have permissions for.
The text was updated successfully, but these errors were encountered:
jgough
added
bug
Something isn't working
untriaged
Require the attention of the repository maintainers and may need to be prioritized
labels
May 5, 2022
[Triage] You're right. There is an ambiguity to this area. Thank you for reporting this. As this is a breaking change w.r.t backwards compatibility, we're not going to change the response code in 2.0 release, but we'll keep this proposal in mind if there is an opportunity to update the behavior.
DarshitChanpura
added
breaking
This issue is or proposes a breaking change
and removed
untriaged
Require the attention of the repository maintainers and may need to be prioritized
labels
May 9, 2022
What is the bug?
On a cluster with anonymous access enabled, when I try to access a resource for which I do not have permissions then I receive a
403 Forbidden
responsee.g.
According to RFC 2616 a
403 Forbidden
meansA
401 Unauthorized
would be correct here as authentication is required.This is causing interoperability issues with https://github.com/lmenezes/cerebro which rightly does not request credentials to authenticate after a
403 Forbidden
response.Wikipedia states
How can one reproduce the bug?
Set up a cluster with anonymous access enabled
As an anonymous user, try to access a resource the unauthenticated user has no permissions for and observe that a
403 Forbidden
error is returned.What is the expected behavior?
A
401 Unauthorized
response instead of403 Forbidden
when unauthenticated users try to access resources they do not have permissions for.The text was updated successfully, but these errors were encountered: