Skip to content

Commit

Permalink
fix pkg/security usage of gopsutil
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux committed Dec 10, 2024
1 parent 1404dff commit 524830b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions pkg/security/resolvers/process/resolver_ebpf.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,14 @@ func (p *EBPFResolver) enrichEventFromProc(entry *model.ProcessCacheEntry, proc
entry.ProcessContext.Pid = pid
entry.ProcessContext.Tid = pid
if len(filledProc.Uids) >= 4 {
entry.Credentials.UID = uint32(filledProc.Uids[0])
entry.Credentials.EUID = uint32(filledProc.Uids[1])
entry.Credentials.FSUID = uint32(filledProc.Uids[3])
entry.Credentials.UID = filledProc.Uids[0]
entry.Credentials.EUID = filledProc.Uids[1]
entry.Credentials.FSUID = filledProc.Uids[3]
}
if len(filledProc.Gids) >= 4 {
entry.Credentials.GID = uint32(filledProc.Gids[0])
entry.Credentials.EGID = uint32(filledProc.Gids[1])
entry.Credentials.FSGID = uint32(filledProc.Gids[3])
entry.Credentials.GID = filledProc.Gids[0]
entry.Credentials.EGID = filledProc.Gids[1]
entry.Credentials.FSGID = filledProc.Gids[3]
}
// fetch login_uid
entry.Credentials.AUID, err = utils.GetLoginUID(uint32(proc.Pid))
Expand Down
4 changes: 2 additions & 2 deletions pkg/security/utils/proc_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ type FilledProcess struct {
Ppid int32
CreateTime int64
Name string
Uids []int32
Gids []int32
Uids []uint32
Gids []uint32
MemInfo *process.MemoryInfoStat
Cmdline []string
}
Expand Down

0 comments on commit 524830b

Please sign in to comment.