refactor(tracee): encapsulate enrichment config#5211
Open
josedonizetti wants to merge 1 commit intoaquasecurity:mainfrom
Open
refactor(tracee): encapsulate enrichment config#5211josedonizetti wants to merge 1 commit intoaquasecurity:mainfrom
josedonizetti wants to merge 1 commit intoaquasecurity:mainfrom
Conversation
59856e0 to
29d22a0
Compare
29d22a0 to
184ad67
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5211 +/- ##
==========================================
+ Coverage 33.51% 35.74% +2.22%
==========================================
Files 250 239 -11
Lines 28908 31530 +2622
==========================================
+ Hits 9688 11269 +1581
- Misses 18609 19543 +934
- Partials 611 718 +107
🚀 New features to boost your workflow:
|
yanivagman
reviewed
Jan 21, 2026
Comment on lines
+617
to
624
| enrichmentConfig := &config.EnrichmentConfig{} | ||
| output, err := PrepareOutput(testcase.outputSlice, config.ContainerModeDisabled, enrichmentConfig) | ||
| if err != nil { | ||
| require.NotNil(t, testcase.expectedError) | ||
| assert.Contains(t, err.Error(), testcase.expectedError.Error()) | ||
| } else { | ||
| assert.Equal(t, testcase.expectedOutput.CalcHashes, output.CalcHashes) | ||
| assert.Equal(t, testcase.expectedOutput.EventsSorting, output.EventsSorting) | ||
| assert.Equal(t, testcase.expectedOutput.Environment, output.Environment) | ||
| assert.Equal(t, testcase.expectedOutput.DecodedData, output.DecodedData) | ||
| assert.Equal(t, testcase.expectedOutput.FdPaths, output.FdPaths) | ||
| assert.Equal(t, testcase.expectedOutput.UserStack, output.UserStack) | ||
| assert.Equal(t, len(testcase.expectedOutput.Streams), len(output.Streams)) |
Collaborator
There was a problem hiding this comment.
Do you want to assert enrichment for decoded data is set to true in case table mode is selected?
| UserStack bool | ||
| DecodedData bool | ||
| CalcHashes digest.CalcHashesOption | ||
| Sockets runtime.Sockets |
Collaborator
There was a problem hiding this comment.
Shouldn't this be part of ContainerEnrichmentConfig?
If these are the autodetected sockets, then we should set them in Container.Sockets by default, no?
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
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.
Refactor enrichment options from
OutputConfigtoEnrichmentConfigstructure.EnrichmentConfigis now a full struct inpkg/configwithToConfig()in flags packageGetRuntimeSockets()andCalcHashesOptionconversion moved to flags package (runs during parsing)EnrichUserStack(),EnrichContainers(), etc.)Added tests for conversion logic, socket handling, and nil safety. All tests pass.