-
Notifications
You must be signed in to change notification settings - Fork 307
Fix issue computing diffs in compliance audit log when writing to security index #5279
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
Merged
cwperks
merged 5 commits into
opensearch-project:main
from
cwperks:fix-compliance-audit-log
May 7, 2025
Merged
Fix issue computing diffs in compliance audit log when writing to security index #5279
cwperks
merged 5 commits into
opensearch-project:main
from
cwperks:fix-compliance-audit-log
May 7, 2025
Conversation
This file contains hidden or 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
Signed-off-by: Craig Perkins <[email protected]>
…urity index Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5279 +/- ##
==========================================
- Coverage 72.04% 71.99% -0.05%
==========================================
Files 336 336
Lines 22648 22651 +3
Branches 3560 3561 +1
==========================================
- Hits 16317 16308 -9
- Misses 4556 4569 +13
+ Partials 1775 1774 -1
🚀 New features to boost your workflow:
|
DarshitChanpura
previously approved these changes
Apr 18, 2025
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.
Great find and fix on this long present bug @cwperks !!
src/main/java/org/opensearch/security/configuration/DlsFlsFilterLeafReader.java
Outdated
Show resolved
Hide resolved
nibix
reviewed
Apr 18, 2025
src/main/java/org/opensearch/security/configuration/DlsFlsFilterLeafReader.java
Outdated
Show resolved
Hide resolved
nibix
reviewed
Apr 19, 2025
src/main/java/org/opensearch/security/compliance/ComplianceIndexingOperationListenerImpl.java
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <[email protected]>
DarshitChanpura
approved these changes
Apr 24, 2025
nibix
reviewed
May 7, 2025
src/main/java/org/opensearch/security/configuration/DlsFlsFilterLeafReader.java
Show resolved
Hide resolved
nibix
approved these changes
May 7, 2025
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
I encountered this issue when attempting to build alerts for changes in the security index.
The compliance audit log can be configured to audit log diffs to selected indices and by default includes the security index. Make sure that
config.compliance.enabled
andconfig.compliance.write_log_diffs
are set totrue
and thatconfig.compliance.write_metadata_only
is set tofalse
.Sample audit log config
Currently, when there are writes to the security index, the ComplianceIndexingOperationListenerImpl errantly thinks that the index is empty in the previous state and the diffs will always include the entirety of the document (ctype) being updated. The reason for that is that the call to
getForUpdate
is silently failing and returning an empty document. The changes in this PR ensure that we can reliably get the existing state of the document (ctype) being updated.Bug fix
Issues Resolved
Resolves #5280
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.