-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Session view processor procfs #38799
Merged
Merged
Conversation
This file contains 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
This processor will enrich process events with additional infomation needed to enable session view in Kibana. This processor can be run on Linux systems, and will use eBPF to enrich auditd events for process exec and exit events. The additional fields that will be added are information on process parent, session leader and process group leader.
Calculate and append entry leader information to enriched processes.
Co-authored-by: Dan Kortschak <[email protected]>
Remove the DB interface, as there will only be one implementation for it
Add a procfs provider to the add_session_view processor, which can be used to gather session metadata on systems where the ebpf implementation is not supported.
* Changed to use time.Duration in timeutils for process start NS * Used go-cmp library to compare ECS docs in tests
Fix linter warnings and upgrade go-libaudit to v2.5.0
ebpfevents library has been updated to use a single channel. Updated to use latest ebpfevents library and the single channel.
Use watcher, which provides singleton access for ebpfevents
Co-authored-by: Mattia Meleleo <[email protected]>
… into session_view_processor_ebpf
Remove possibe panics in program initialization, and handle unexpected events more gracefully.
…o session_view_processor_procfs
If any process ancestry is incomplete, retry scraping the info from proc. As procfs scraping can miss events, or not be updated when process re-parenting happens, if any inconsistancy in the DB is found, rescrape to update the data.
mjwolf
added
enhancement
backport-skip
Skip notification from the automated backport with mergify
labels
Apr 10, 2024
botelastic
bot
added
the
needs_team
Indicates that the issue/PR needs a Team:* label
label
Apr 10, 2024
andrewkroh
approved these changes
Apr 12, 2024
x-pack/auditbeat/processors/sessionmd/provider/procfs_provider/procfs_provider_test.go
Outdated
Show resolved
Hide resolved
x-pack/auditbeat/processors/sessionmd/provider/procfs_provider/procfs_provider_test.go
Outdated
Show resolved
Hide resolved
andrewkroh
added
Team:Security-Linux Platform
Linux Platform Team in Security Solution
Team:Security-Deployment and Devices
Deployment and Devices Team in Security Solution
labels
Apr 12, 2024
Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices) |
Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform) |
botelastic
bot
removed
the
needs_team
Indicates that the issue/PR needs a Team:* label
label
Apr 12, 2024
andrewkroh
added
Auditbeat
needs_team
Indicates that the issue/PR needs a Team:* label
labels
Apr 12, 2024
botelastic
bot
removed
the
needs_team
Indicates that the issue/PR needs a Team:* label
label
Apr 12, 2024
This pull request is now in conflicts. Could you fix it? 🙏
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Auditbeat
backport-skip
Skip notification from the automated backport with mergify
enhancement
Team:Security-Deployment and Devices
Deployment and Devices Team in Security Solution
Team:Security-Linux Platform
Linux Platform Team in Security Solution
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.
Proposed commit message
Add a procfs backend to the auditbeat add_session_metadata processor. For systems that don't support ebpf, this procfs backend can be used instead to enrich auditbeat events with the data needed for session view.
However the backend is expected to be less reliable than the ebpf backend; if processes exit before their info is read from procfs, the info will not be available, and some processes will be not be enriched (particularly very short-lived processes).
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
In the auditbeat config file, add below lines to enable the
add_session_metadata
processor, with forced procfs backend.When running and sending data to a supported Kibana version, the session viewer should show events from auditbeat, powered by procfs.
Related issues
Use cases
Screenshots
Logs