build parent process hierarchy of already running processes

We build the parent process tree of a process when it's executed
for the first time.
Now we also build the tree when an already running process opens a new
outbound connection by the first time.
This commit is contained in:
Gustavo Iñiguez Goia 2024-04-30 23:26:47 +02:00
parent 0a911ef791
commit be87bc538e
Failed to generate hash of commit

View file

@ -180,6 +180,7 @@ func findConnProcess(value *networkEventT, connKey string) (proc *procmon.Proces
proc = procmon.NewProcess(int(value.Pid), comm) proc = procmon.NewProcess(int(value.Pid), comm)
proc.UID = int(value.UID) proc.UID = int(value.UID)
procmon.EventsCache.Add(proc) procmon.EventsCache.Add(proc)
procmon.EventsCache.Update(proc, nil)
log.Debug("[ebpf conn] not in cache, NOR in execEvents: %s, %d -> %s -> %s", connKey, proc.ID, proc.Path, proc.Args) log.Debug("[ebpf conn] not in cache, NOR in execEvents: %s, %d -> %s -> %s", connKey, proc.ID, proc.Path, proc.Args)
return return