@@ -13,6 +13,7 @@ import (
13
13
"github.com/aquasecurity/tracee/pkg/errfmt"
14
14
"github.com/aquasecurity/tracee/pkg/events"
15
15
"github.com/aquasecurity/tracee/pkg/logger"
16
+ "github.com/aquasecurity/tracee/pkg/time"
16
17
"github.com/aquasecurity/tracee/pkg/utils"
17
18
"github.com/aquasecurity/tracee/types/trace"
18
19
)
@@ -227,8 +228,14 @@ func (t *Tracee) decodeEvents(ctx context.Context, sourceChan chan []byte) (<-ch
227
228
228
229
// populate all the fields of the event used in this stage, and reset the rest
229
230
230
- evt .Timestamp = int (eCtx .Ts )
231
- evt .ThreadStartTime = int (eCtx .StartTime )
231
+ // normalize timestamp context fields for later use
232
+ normalizedTs := time .BootToEpochNS (eCtx .Ts )
233
+ normalizedThreadStartTime := time .BootToEpochNS (eCtx .StartTime )
234
+ normalizedLeaderStartTime := time .BootToEpochNS (eCtx .LeaderStartTime )
235
+ normalizedParentStartTime := time .BootToEpochNS (eCtx .ParentStartTime )
236
+
237
+ evt .Timestamp = int (normalizedTs )
238
+ evt .ThreadStartTime = int (normalizedThreadStartTime )
232
239
evt .ProcessorID = int (eCtx .ProcessorId )
233
240
evt .ProcessID = int (eCtx .Pid )
234
241
evt .ThreadID = int (eCtx .Tid )
@@ -239,8 +246,8 @@ func (t *Tracee) decodeEvents(ctx context.Context, sourceChan chan []byte) (<-ch
239
246
evt .UserID = int (eCtx .Uid )
240
247
evt .MountNS = int (eCtx .MntID )
241
248
evt .PIDNS = int (eCtx .PidID )
242
- evt .ProcessName = string (bytes .TrimRight (eCtx .Comm [:], "\x00 " ))
243
- evt .HostName = string (bytes .TrimRight (eCtx .UtsName [:], "\x00 " ))
249
+ evt .ProcessName = string (bytes .TrimRight (eCtx .Comm [:], "\x00 " )) // set and clean potential trailing null
250
+ evt .HostName = string (bytes .TrimRight (eCtx .UtsName [:], "\x00 " )) // set and clean potential trailing null
244
251
evt .CgroupID = uint (eCtx .CgroupID )
245
252
evt .ContainerID = containerData .ID
246
253
evt .Container = containerData
@@ -258,9 +265,9 @@ func (t *Tracee) decodeEvents(ctx context.Context, sourceChan chan []byte) (<-ch
258
265
evt .ContextFlags = flags
259
266
evt .Syscall = syscall
260
267
evt .Metadata = nil
261
- evt .ThreadEntityId = utils .HashTaskID (eCtx .HostTid , eCtx . StartTime )
262
- evt .ProcessEntityId = utils .HashTaskID (eCtx .HostPid , eCtx . LeaderStartTime )
263
- evt .ParentEntityId = utils .HashTaskID (eCtx .HostPpid , eCtx . ParentStartTime )
268
+ evt .ThreadEntityId = utils .HashTaskID (eCtx .HostTid , normalizedThreadStartTime )
269
+ evt .ProcessEntityId = utils .HashTaskID (eCtx .HostPid , normalizedLeaderStartTime )
270
+ evt .ParentEntityId = utils .HashTaskID (eCtx .HostPpid , normalizedParentStartTime )
264
271
265
272
// If there aren't any policies that need filtering in userland, tracee **may** skip
266
273
// this event, as long as there aren't any derivatives or signatures that depend on it.
@@ -727,7 +734,7 @@ func (t *Tracee) parseArguments(e *trace.Event) error {
727
734
}
728
735
729
736
if t .config .Output .ParseArgumentsFDs {
730
- return events .ParseArgsFDs (e , uint64 (t . timeNormalizer . GetOriginalTime ( e .Timestamp ) ), t .FDArgPathMap )
737
+ return events .ParseArgsFDs (e , uint64 (e .Timestamp ), t .FDArgPathMap )
731
738
}
732
739
}
733
740
0 commit comments