-
Notifications
You must be signed in to change notification settings - Fork 336
Use RestRequestFilter.getFilteredRequest to declare sensitive API params #5710
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5710 +/- ##
==========================================
- Coverage 72.93% 72.91% -0.03%
==========================================
Files 420 420
Lines 26269 26277 +8
Branches 3974 3976 +2
==========================================
Hits 19159 19159
- Misses 5192 5200 +8
Partials 1918 1918
🚀 New features to boost your workflow:
|
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.
left 1 comment. LGTM otherwise
|
||
RestRequest filteredRequest = getFilteredRequest(request); | ||
|
||
RestRequest auditLogRequest = (request.method() != Method.PATCH) ? filteredRequest : request; |
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.
Would you mind adding a brief comment on why PATCH is skipped?
Description
This PR enhances the audit log redaction functionality to use an existing extension point in core that is not utilized. Core has an extension point called RestRequestFilter that can be used to filter sensitive values from a request payload (for example password in some reindex REST Apis). I am raising this PR to wire up this extension point.
See opensearch-project/OpenSearch@9005e9f#diff-b30aa63ce9a55b210cf60a1c2a0d0070156e13379ae6ffef45707686e31ae0c6
The benefit of this extension point is that other plugins can leverage it to declare api params as sensitive and filtered in cases where the request body may be used.
Bug fix
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.