-
Notifications
You must be signed in to change notification settings - Fork 475
flag(stores): new flag format #5012
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
df23d14 to
7266606
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5012 +/- ##
==========================================
+ Coverage 29.72% 31.09% +1.36%
==========================================
Files 234 234
Lines 26186 26691 +505
==========================================
+ Hits 7785 8300 +515
+ Misses 17864 17849 -15
- Partials 537 542 +5
🚀 New features to boost your workflow:
|
c173b06 to
326ef06
Compare
326ef06 to
2ccc599
Compare
422800f to
067ff81
Compare
067ff81 to
5d26dba
Compare
5d26dba to
135640a
Compare
geyslan
left a comment
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, some thoughts were put.
pkg/cmd/flags/stores_test.go
Outdated
| Procfs: true, | ||
| }, | ||
| }, | ||
| expectedError: "flags.PrepareStores: invalid stores flag: invalid-flag=value, use 'trace man stores' for more info", |
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.
as mentioned in other prs.
135640a to
67d9bb8
Compare
BREAKING CHANGE: add flag --stores to replace --proctree --dnscache
67d9bb8 to
5750274
Compare
|
|
||
| ```bash | ||
| sudo tracee --output option:sort-events --output json --output option:parse-arguments --proctree source=both --events <event_type> | ||
| sudo tracee --output option:sort-events --output json --output option:parse-arguments --stores process.enabled --stores process.source=both --events <event_type> |
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.
Is it required to set --stores process.enabled if the user selected --stores process.source=both? if not, can we auto enable when process.source is specified and remove the need to specify process.enabled?
| - **process.max-threads**=*size*: Set the maximum number of threads to cache in the process tree. Default is 21856. This is an LRU cache that will evict least recently accessed entries when full. | ||
|
|
||
| - **process.source**=*source*: Set the source for process tree enrichment. Valid values are: | ||
| - **none**: Process tree source is disabled (default). |
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.
Can we remove this "none" option now that we added the enabled config?
I believe we should remove it and make signals the default
| 4. Enable process tree with custom cache sizes: | ||
| ```console | ||
| --stores process.enabled --stores process.max-processes=8192 --stores process.max-threads=16384 | ||
| ``` | ||
|
|
||
| 5. Enable process tree with events source: | ||
| ```console | ||
| --stores process.enabled --stores process.source=events | ||
| ``` | ||
|
|
||
| 6. Enable process tree with both events and signals sources: | ||
| ```console | ||
| --stores process.enabled --stores process.source=both | ||
| ``` | ||
|
|
||
| 7. Enable process tree with procfs support: | ||
| ```console | ||
| --stores process.enabled --stores process.use-procfs | ||
| ``` | ||
|
|
||
| 8. Combine DNS and process stores: | ||
| ```console | ||
| --stores dns.enabled --stores dns.max-entries=5000 --stores process.enabled --stores process.source=both --stores process.max-processes=8192 | ||
| ``` | ||
|
|
||
| 9. Complete configuration example: | ||
| ```console | ||
| --stores dns.enabled --stores dns.max-entries=5000 --stores process.enabled --stores process.max-processes=8192 --stores process.max-threads=16384 --stores process.source=both --stores process.use-procfs | ||
| ``` |
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.
Same suggestion as before about the syntactic sugar of not requiring to specify "enabled" when some other configuration of the datastore is given
| --stores dns.enabled --stores dns.max-entries=5000 --stores process.enabled --stores process.max-processes=8192 --stores process.max-threads=16384 --stores process.source=both --stores process.use-procfs | ||
| ``` | ||
|
|
||
| Please refer to the [DNS data source documentation](../advanced/data-sources/builtin/dns.md) and [Process Tree data source documentation](../advanced/data-sources/builtin/process-tree.md) for more information. |
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.
This should be modified after we will merge the new datastores PR to point to datastores instead of datasources (deprecated)
|
|
||
|
|
||
| __NOTE__: You can view more in the [Process Tree section](../../advanced/data-sources/builtin/process-tree.md). | ||
| __NOTE__: You can view more in the [Process Tree section](../../advanced/data-sources/builtin/process-tree.md) and [DNS Cache section](../../advanced/data-sources/builtin/dns.md). |
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.
This note should refer to the new datastores docs once merged
| cfg.ProcTree = stores.GetProcTreeConfig() | ||
| cfg.DNSCacheConfig = stores.GetDNSCacheConfig() |
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.
FYI this will soon be changed by one of the followup commits of detectors where all datastores are grouped together (see detectors draft PR)
New stores flag: