Skip to content

Conversation

@albertzaharovits
Copy link
Contributor

@albertzaharovits albertzaharovits commented Apr 10, 2023

Hooks "REST" authN, as a "validator", into the new netty channel interceptor for http headers.

@albertzaharovits albertzaharovits force-pushed the security-early-authn-with-header-validator branch from 979b40a to 322f4e9 Compare April 12, 2023 16:57
@albertzaharovits albertzaharovits added the :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) label Apr 12, 2023
@albertzaharovits albertzaharovits merged commit bedaf3c into elastic:main May 4, 2023
@albertzaharovits albertzaharovits deleted the security-early-authn-with-header-validator branch May 4, 2023 14:56
albertzaharovits added a commit that referenced this pull request May 8, 2023
This PR tests that malformed HTTP requests that fail at the decoding stage don't go through validation and are further dispatched as bad requests. Related: #95112
albertzaharovits added a commit that referenced this pull request May 12, 2023
This address HTTP OPTIONS requests following the authentication refactoring in #95112. Relates #95112
albertzaharovits added a commit that referenced this pull request May 18, 2023
Following the changes in #95112, which relocated the calls into the AuthenticationService that authenticate HTTP requests, the authentication duration was no longer comprised in between the Tracer#startTrace and Tracer#stopTrace. Consequently, the span records didn't cover the authentication duration any longer. This PR remedies that by changing the Tracer implementation, i.e. APMTracer, to look for the trace start time instant in the transient thread context and use that when starting traces (overriding the now default). The trace start time is set in the thread context when the request-wise thread context is first populated (with HTTP request headers).
albertzaharovits added a commit that referenced this pull request May 29, 2023
Instead of not authN and letting them through, this PR rejects OPTIONS requests with a body (400). Relates #95112
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 15, 2023
Hooks "REST" authN, as a "validator", into the new netty channel interceptor for http headers.
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 15, 2023
This address HTTP OPTIONS requests following the authentication refactoring in elastic#95112. Relates elastic#95112
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 15, 2023
Instead of not authN and letting them through, this PR rejects OPTIONS requests with a body (400). Relates elastic#95112
albertzaharovits added a commit to albertzaharovits/elasticsearch that referenced this pull request Jun 19, 2023
This PR tests that malformed HTTP requests that fail at the decoding stage don't go through validation and are further dispatched as bad requests. Related: elastic#95112
albertzaharovits added a commit that referenced this pull request Aug 23, 2023
This is a backport of multiple work items related to authentication enhancements for HTTP, which were originally merged in the 8.8 - 8.9 releases. Hence, the HTTP (only the netty4-based implementation (default), not the NIO one) authentication implementation gets a throughput boost (especially for requests failing authn). Relates to: ES-6188 #92220 #95112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Security/Authentication Logging in, Usernames/passwords, Realms (Native/LDAP/AD/SAML/PKI/etc) Team:Security Meta label for security team v8.9.0

4 participants