-
Notifications
You must be signed in to change notification settings - Fork 281
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
[Backport 2.11] Add early rejection from RestHandler for unauthorized requests (#3418) #3495
Merged
peternied
merged 4 commits into
opensearch-project:2.11
from
peternied:backport/backport-3418-to-2.11
Oct 7, 2023
Merged
[Backport 2.11] Add early rejection from RestHandler for unauthorized requests (#3418) #3495
peternied
merged 4 commits into
opensearch-project:2.11
from
peternied:backport/backport-3418-to-2.11
Oct 7, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… requests (opensearch-project#3418) Previously unauthorized requests were fully processed and rejected once they reached the RestHandler. This allocations more memory and resources for these requests that might not be useful if they are already detected as unauthorized. Using the headerVerifer and decompressor customization from [1], perform an early authorization check when only the headers are available, save an 'early response' for transmission and do not perform the decompression on the request to speed up closing out the connection. - Resolves opensearch-project/OpenSearch#10260 Signed-off-by: Peter Nied <petern@amazon.com> Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Craig Perkins <craig5008@gmail.com> Co-authored-by: Peter Nied <petern@amazon.com>
peternied
requested review from
cliu123,
cwperks,
DarshitChanpura,
davidlago,
RyanL1997,
stephen-crawford,
reta and
willyborankin
as code owners
October 6, 2023 23:02
Signed-off-by: Peter Nied <petern@amazon.com>
@peternied Can you fix the failing code hygiene check?
|
bwc build fails with:
|
Signed-off-by: Peter Nied <petern@amazon.com>
cwperks
previously approved these changes
Oct 6, 2023
DarshitChanpura
previously approved these changes
Oct 6, 2023
Codecov Report
@@ Coverage Diff @@
## 2.11 #3495 +/- ##
============================================
+ Coverage 64.69% 64.81% +0.12%
- Complexity 3566 3610 +44
============================================
Files 267 273 +6
Lines 19893 20025 +132
Branches 3329 3346 +17
============================================
+ Hits 12870 12980 +110
- Misses 5383 5399 +16
- Partials 1640 1646 +6
|
Signed-off-by: Peter Nied <petern@amazon.com>
peternied
dismissed stale reviews from DarshitChanpura and cwperks
via
October 6, 2023 23:56
9cc4f73
cwperks
approved these changes
Oct 6, 2023
DarshitChanpura
approved these changes
Oct 7, 2023
opensearch-trigger-bot bot
pushed a commit
that referenced
this pull request
Oct 7, 2023
… requests (#3418) (#3495) ### Description Backport of 6b0b682 from #3418 Previously unauthorized requests were fully processed and rejected once they reached the RestHandler. This allocations more memory and resources for these requests that might not be useful if they are already detected as unauthorized. Using the headerVerifer and decompressor customization from [1], perform an early authorization check when only the headers are available, save an 'early response' for transmission and do not perform the decompression on the request to speed up closing out the connection. - Resolves opensearch-project/OpenSearch#10260 Signed-off-by: Peter Nied <petern@amazon.com> Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Craig Perkins <craig5008@gmail.com> Co-authored-by: Craig Perkins <cwperx@amazon.com> (cherry picked from commit f7c47af)
stephen-crawford
pushed a commit
that referenced
this pull request
Oct 9, 2023
peternied
added a commit
to peternied/security
that referenced
this pull request
Oct 9, 2023
…requests (opensearch-project#3418) (opensearch-project#3496) Backport f7c47af from opensearch-project#3495 --------- Signed-off-by: Peter Nied <petern@amazon.com> Co-authored-by: Peter Nied <petern@amazon.com>
peternied
added a commit
to peternied/security
that referenced
this pull request
Nov 9, 2023
…requests (opensearch-project#3418) (opensearch-project#3495) Backport of 6b0b682 from opensearch-project#3418 Previously unauthorized requests were fully processed and rejected once they reached the RestHandler. This allocations more memory and resources for these requests that might not be useful if they are already detected as unauthorized. Using the headerVerifer and decompressor customization from [1], perform an early authorization check when only the headers are available, save an 'early response' for transmission and do not perform the decompression on the request to speed up closing out the connection. - Resolves opensearch-project/OpenSearch#10260 Signed-off-by: Peter Nied <petern@amazon.com> Signed-off-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Craig Perkins <craig5008@gmail.com> Co-authored-by: Craig Perkins <cwperx@amazon.com> Signed-off-by: Peter Nied <petern@amazon.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Backport of 6b0b682 from #3418
Previously unauthorized requests were fully processed and rejected once they reached the RestHandler. This allocations more memory and resources for these requests that might not be useful if they are already detected as unauthorized. Using the headerVerifer and decompressor customization from [1], perform an early authorization check when only the headers are available, save an 'early response' for transmission and do not perform the decompression on the request to speed up closing out the connection.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.