Skip to content

Commit

Permalink
pulsar-core: Include the whole ContainerInfo in Header, not just ID
Browse files Browse the repository at this point in the history
  • Loading branch information
vadorovsky committed Nov 13, 2023
1 parent e732a72 commit 97fba8a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/pulsar-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub struct Header {
pub pid: i32,
pub parent_pid: i32,
#[validatron(skip)]
pub container_id: Option<String>,
pub container: Option<ContainerInfo>,
#[validatron(skip)]
pub threat: Option<Threat>,
pub source: ModuleName,
Expand Down
6 changes: 2 additions & 4 deletions crates/pulsar-core/src/pdk/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ impl ModuleSender {
image: String::new(),
parent_pid: 0,
fork_time: UNIX_EPOCH,
container_id: None,
container: None,
};
match process_tracker.get(process, timestamp).await {
Ok(ProcessInfo {
Expand All @@ -259,9 +259,7 @@ impl ModuleSender {
header.image = image;
header.parent_pid = ppid.as_raw();
header.fork_time = fork_time.into();
if let Some(container) = container {
header.container_id = Some(container.id);
}
header.container = container;
}
Err(e) => {
// warning: check if this actually happens or not
Expand Down

0 comments on commit 97fba8a

Please sign in to comment.