Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions internal/pkg/daemon/enricher/jsonenricher.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,20 @@
"unable to get uid and gid", "line", line)
}

logBucket.ProcessInfo = e.fetchProcessInfo(auditLine.ProcessID,
pi := e.fetchProcessInfo(auditLine.ProcessID,
auditLine.Executable, uid, gid)
logBucket.Mu.Lock()

Check failure on line 325 in internal/pkg/daemon/enricher/jsonenricher.go

View workflow job for this annotation

GitHub Actions / macos

missing whitespace above this line (no shared variables above expr) (wsl_v5)
logBucket.ProcessInfo = pi
logBucket.Mu.Unlock()
}

e.processEbpf(logBucket, auditLine)

if logBucket.ContainerInfo == nil {
logBucket.ContainerInfo = e.fetchContainerInfo(ctx, auditLine.ProcessID, nodeName)
ci := e.fetchContainerInfo(ctx, auditLine.ProcessID, nodeName)
logBucket.Mu.Lock()

Check failure on line 334 in internal/pkg/daemon/enricher/jsonenricher.go

View workflow job for this annotation

GitHub Actions / macos

missing whitespace above this line (no shared variables above expr) (wsl_v5)
logBucket.ContainerInfo = ci
logBucket.Mu.Unlock()
}

logBucket.SyscallIds.LoadOrStore(auditLine.SystemCallID, struct{}{})
Expand All @@ -341,6 +347,9 @@
}

func (e *JsonEnricher) processEbpf(logBucket *types.LogBucket, auditLine *types.AuditLine) {
logBucket.Mu.Lock()
defer logBucket.Mu.Unlock()

if e.bpfProcessCache != nil && logBucket.ProcessInfo != nil && logBucket.ProcessInfo.CmdLine == "" {
cmdLine, errCmdLine := e.bpfProcessCache.GetCmdLine(auditLine.ProcessID)
if errCmdLine == nil {
Expand Down Expand Up @@ -435,6 +444,9 @@
return true
})

logBucket.Mu.RLock()
defer logBucket.Mu.RUnlock()

var resource map[string]string

if logBucket.ProcessInfo == nil {
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/daemon/enricher/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type ProcessInfo struct {
ExecRequestId *string
}
type LogBucket struct {
Mu sync.RWMutex
SyscallIds sync.Map
ContainerInfo *ContainerInfo
ProcessInfo *ProcessInfo
Expand Down
Loading