-
Notifications
You must be signed in to change notification settings - Fork 272
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
Handle exceptions for adding request body audit log if rest request is invalid #4232
Handle exceptions for adding request body audit log if rest request is invalid #4232
Conversation
…s invalid. Resolves opensearch-project#1849 Signed-off-by: Aayush Singhal <siaayush@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you @Aayush8394!
Signed-off-by: Aayush Singhal <siaayush@amazon.com>
e0b5bcd
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4232 +/- ##
==========================================
+ Coverage 66.15% 66.20% +0.04%
==========================================
Files 301 301
Lines 21708 21710 +2
Branches 3506 3506
==========================================
+ Hits 14362 14373 +11
+ Misses 5584 5577 -7
+ Partials 1762 1760 -2
|
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.x
# Create a new branch
git switch --create backport/backport-4232-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 0bfe7653b0f50ff6b6757411af4e49d9784a063b
# Push it to GitHub
git push --set-upstream origin backport/backport-4232-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.x Then, create a pull request where the |
@Aayush8394 Can you create a manual backport to 2.x for this? |
… rest request is invalid (opensearch-project#4232) Signed-off-by: Aayush Singhal <siaayush@amazon.com>
…s invalid (opensearch-project#4232) Signed-off-by: Aayush Singhal <siaayush@amazon.com>
Description
This change fixes the bug #1849. This change ensures audit logging logs a failed request if request body fails to match content-type header or required parameters.
This change is required to be consistent with user provided configuration of audit logging request body even for failed requests
Before this change, an invalid request (with invalid content or source type parameters) did not get audit_request_body even if request body audit logging is enabled by user because of improper exception handling. After this change, audit_request_body will be generated
Issues Resolved
#1849
Is this a backport? If so, please add backport PR # and/or commits #
Testing
Unit tested
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.