Skip to content
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

Return http 500 if agent uses invalid API key and is not unenrolled #2854

Closed
juliaElastic opened this issue Aug 1, 2023 · 1 comment
Closed
Labels
Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better.

Comments

@juliaElastic
Copy link
Contributor

In telemetry we are seeing a lot of occurrences of 400/401 errors which are caused by unenrolled agents making requests with invalid API keys.
In order to filter out this noise, we want to have a different error code (500) for those cases where the agent is not unenrolled but still using an invalid API key.

Example:

apikey auth response bp2r2HoBy7L5RrZVC-mf: [401 Unauthorized] {"error":{"root_cause":[{"type":"security_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional_unsuccessful_credentials":"API key: unable to find apikey with id bp2r2HoBy7L5RrZVC-mf","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}}],"type":"security_exception","reason":"unable to authenticate with provided credentials and anonymous access is not allowed for this request","additional_unsuccessful_credentials":"API key: unable to find apikey with id bp2r2HoBy7L5RrZVC-mf","header":{"WWW-Authenticate":["Basic realm=\"security\" charset=\"UTF-8\"","Bearer realm=\"security\"","ApiKey"]}},"status":401}
@juliaElastic juliaElastic added the Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better. label Aug 1, 2023
@juliaElastic
Copy link
Contributor Author

Duplicate of #2861

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Supportability Improve our (devs, SREs, support eng, users) ability to troubleshoot/self-service product better.
Projects
None yet
Development

No branches or pull requests

1 participant