Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright Authors of Tetragon
Index ¶
- Constants
- Variables
- func CheckCloneEvents(t *testing.T, events []*tetragon.GetEventsResponse, currentPid uint32, ...)
- func CheckExecEvents(t *testing.T, events []*tetragon.GetEventsResponse, parentPid uint32, ...)
- func CheckPodEvents(t *testing.T, events []*tetragon.GetEventsResponse)
- func CheckProcessEqual(t *testing.T, p1, p2 *tetragon.Process)
- func CreateCloneEvents[CLONE notify.Message, EXIT notify.Message](Pid uint32, Ktime uint64, ParentPid uint32, ParentKtime uint64) (*CLONE, *EXIT)
- func CreateEvents[EXEC notify.Message, EXIT notify.Message](Pid uint32, Ktime uint64, ParentPid uint32, ParentKtime uint64, Docker string) (*EXEC, *EXEC, *EXEC, *EXIT)
- func GetEvents(t *testing.T, events []*tetragon.GetEventsResponse) (*tetragon.ProcessExec, *tetragon.ProcessExit)
- func GetProcessExec(event *MsgExecveEventUnix, useCache bool) *tetragon.ProcessExec
- func GetProcessExit(event *MsgExitEventUnix) *tetragon.ProcessExit
- func GetProcessRefcntFromCache(t *testing.T, Pid uint32, Ktime uint64) uint32
- func GrpcDelayedExecK8sOutOfOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecCloneInOrder[EXEC notify.Message, CLONE notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecCloneOutOfOrder[EXEC notify.Message, CLONE notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecInOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecMisingParent[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecOutOfOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecParentOutOfOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecPodInfoDelayedInOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecPodInfoDelayedOutOfOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecPodInfoInOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecPodInfoInOrderAfter[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecPodInfoOutOfOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcExecPodInfoOutOfOrderAfter[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcMissingExec[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func GrpcParentInOrder[EXEC notify.Message, EXIT notify.Message](t *testing.T)
- func InitEnv[EXEC notify.Message, EXIT notify.Message](t *testing.T, cancelWg *sync.WaitGroup, watcher watcher.K8sResourceWatcher) context.CancelFunc
- type DummyNotifier
- type MsgCgroupEventUnix
- func (msg *MsgCgroupEventUnix) Cast(o interface{}) notify.Message
- func (msg *MsgCgroupEventUnix) HandleMessage() *tetragon.GetEventsResponse
- func (msg *MsgCgroupEventUnix) Notify() bool
- func (msg *MsgCgroupEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
- func (msg *MsgCgroupEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
- type MsgCloneEventUnix
- func (msg *MsgCloneEventUnix) Cast(o interface{}) notify.Message
- func (msg *MsgCloneEventUnix) HandleMessage() *tetragon.GetEventsResponse
- func (msg *MsgCloneEventUnix) Notify() bool
- func (msg *MsgCloneEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
- func (msg *MsgCloneEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
- type MsgExecveEventUnix
- func (msg *MsgExecveEventUnix) Cast(o interface{}) notify.Message
- func (msg *MsgExecveEventUnix) HandleMessage() *tetragon.GetEventsResponse
- func (msg *MsgExecveEventUnix) Notify() bool
- func (msg *MsgExecveEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
- func (msg *MsgExecveEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
- type MsgExitEventUnix
- func (msg *MsgExitEventUnix) Cast(o interface{}) notify.Message
- func (msg *MsgExitEventUnix) HandleMessage() *tetragon.GetEventsResponse
- func (msg *MsgExitEventUnix) Notify() bool
- func (msg *MsgExitEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
- func (msg *MsgExitEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
- type MsgProcessCleanupEventUnix
- func (msg *MsgProcessCleanupEventUnix) Cast(o interface{}) notify.Message
- func (msg *MsgProcessCleanupEventUnix) HandleMessage() *tetragon.GetEventsResponse
- func (msg *MsgProcessCleanupEventUnix) Notify() bool
- func (msg *MsgProcessCleanupEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
- func (msg *MsgProcessCleanupEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
Constants ¶
const ( ParentRefCnt = 0 ProcessRefCnt = 1 )
const (
CacheTimerMs = 100
)
Variables ¶
var ( AllEvents []*tetragon.GetEventsResponse BasePid uint32 = 46987 )
Functions ¶
func CheckCloneEvents ¶
func CheckExecEvents ¶
func CheckPodEvents ¶
func CheckPodEvents(t *testing.T, events []*tetragon.GetEventsResponse)
func CreateCloneEvents ¶
func CreateEvents ¶
func GetEvents ¶
func GetEvents(t *testing.T, events []*tetragon.GetEventsResponse) (*tetragon.ProcessExec, *tetragon.ProcessExit)
func GetProcessExec ¶
func GetProcessExec(event *MsgExecveEventUnix, useCache bool) *tetragon.ProcessExec
GetProcessExec returns Exec protobuf message for a given process, including the ancestor list.
func GetProcessExit ¶
func GetProcessExit(event *MsgExitEventUnix) *tetragon.ProcessExit
GetProcessExit returns Exit protobuf message for a given process.
func GrpcDelayedExecK8sOutOfOrder ¶
In this case, we get an exit and an exex event (out-of-order). We get the appopriate pod info after the exit event.
func GrpcExecCloneInOrder ¶
func GrpcExecCloneOutOfOrder ¶
func GrpcExecMisingParent ¶
func GrpcExecOutOfOrder ¶
func GrpcExecPodInfoDelayedInOrder ¶
In this case, we get an exec and an exit event (in-order). During both events we also miss pod info. We get pod info after at least one cache GC round.
func GrpcExecPodInfoDelayedOutOfOrder ¶
In this case, we get an exit and an exec event (out-of-order). During the exit event we also miss pod info. We get pod info after at least one cache GC round. In this case exit event should go through the eventcache (missed pod and process info). Once we get the exec info we still have to keep the exit event in the eventcache.
func GrpcExecPodInfoInOrder ¶
In this case, we get an exec and an exit event (in-order) but we miss Pod info. Both of these go through the eventcache to get the pod info. At the end both should have correct pod info and the exit event should also have full process info.
func GrpcExecPodInfoInOrderAfter ¶
In this case, we get an exec and an exit event (in-order). During the exec event we miss pod info. We get pod info before getting the exit event. In this case exec event should go through the eventcache (missed pod info) and exit event should also go through the cache as the procCache has not been updated yet. At the end both should have correct pod info and the exit event should also have full process info.
func GrpcExecPodInfoOutOfOrder ¶
In this case, we get an exit and an exec event (out-of-order) and we also miss Pod info. Both of these go through the eventcache to get the pod info and process info. At the end both should have correct pod info and the exit event should also have full process info.
func GrpcExecPodInfoOutOfOrderAfter ¶
In this case, we get an exit and an exec event (out-of-order). During the exit event we also miss pod info. We get pod info before getting the exec event. In this case exit event should go through the eventcache (missed pod and process info) and exec event should not go through the cache as we have everything. At the end both should have correct pod info and the exit event should also have full process info.
func GrpcParentInOrder ¶
Types ¶
type DummyNotifier ¶
type DummyNotifier[EXEC notify.Message, EXIT notify.Message] struct { // contains filtered or unexported fields }
func (DummyNotifier[EXEC, EXIT]) AddListener ¶
func (n DummyNotifier[EXEC, EXIT]) AddListener(listener server.Listener)
func (DummyNotifier[EXEC, EXIT]) NotifyListener ¶
func (n DummyNotifier[EXEC, EXIT]) NotifyListener(original interface{}, processed *tetragon.GetEventsResponse)
func (DummyNotifier[EXEC, EXIT]) RemoveListener ¶
func (n DummyNotifier[EXEC, EXIT]) RemoveListener(listener server.Listener)
type MsgCgroupEventUnix ¶
type MsgCgroupEventUnix struct {
processapi.MsgCgroupEvent
}
func (*MsgCgroupEventUnix) Cast ¶
func (msg *MsgCgroupEventUnix) Cast(o interface{}) notify.Message
func (*MsgCgroupEventUnix) HandleMessage ¶
func (msg *MsgCgroupEventUnix) HandleMessage() *tetragon.GetEventsResponse
func (*MsgCgroupEventUnix) Notify ¶
func (msg *MsgCgroupEventUnix) Notify() bool
func (*MsgCgroupEventUnix) Retry ¶
func (msg *MsgCgroupEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
func (*MsgCgroupEventUnix) RetryInternal ¶
func (msg *MsgCgroupEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
type MsgCloneEventUnix ¶
type MsgCloneEventUnix struct {
processapi.MsgCloneEvent
}
func (*MsgCloneEventUnix) Cast ¶
func (msg *MsgCloneEventUnix) Cast(o interface{}) notify.Message
func (*MsgCloneEventUnix) HandleMessage ¶
func (msg *MsgCloneEventUnix) HandleMessage() *tetragon.GetEventsResponse
func (*MsgCloneEventUnix) Notify ¶
func (msg *MsgCloneEventUnix) Notify() bool
func (*MsgCloneEventUnix) Retry ¶
func (msg *MsgCloneEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
func (*MsgCloneEventUnix) RetryInternal ¶
func (msg *MsgCloneEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
type MsgExecveEventUnix ¶
type MsgExecveEventUnix struct {
processapi.MsgExecveEventUnix
}
func (*MsgExecveEventUnix) Cast ¶
func (msg *MsgExecveEventUnix) Cast(o interface{}) notify.Message
func (*MsgExecveEventUnix) HandleMessage ¶
func (msg *MsgExecveEventUnix) HandleMessage() *tetragon.GetEventsResponse
func (*MsgExecveEventUnix) Notify ¶
func (msg *MsgExecveEventUnix) Notify() bool
func (*MsgExecveEventUnix) Retry ¶
func (msg *MsgExecveEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
func (*MsgExecveEventUnix) RetryInternal ¶
func (msg *MsgExecveEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
type MsgExitEventUnix ¶
type MsgExitEventUnix struct { tetragonAPI.MsgExitEvent RefCntDone [2]bool }
func (*MsgExitEventUnix) Cast ¶
func (msg *MsgExitEventUnix) Cast(o interface{}) notify.Message
func (*MsgExitEventUnix) HandleMessage ¶
func (msg *MsgExitEventUnix) HandleMessage() *tetragon.GetEventsResponse
func (*MsgExitEventUnix) Notify ¶
func (msg *MsgExitEventUnix) Notify() bool
func (*MsgExitEventUnix) Retry ¶
func (msg *MsgExitEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
func (*MsgExitEventUnix) RetryInternal ¶
func (msg *MsgExitEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)
type MsgProcessCleanupEventUnix ¶
func (*MsgProcessCleanupEventUnix) Cast ¶
func (msg *MsgProcessCleanupEventUnix) Cast(o interface{}) notify.Message
func (*MsgProcessCleanupEventUnix) HandleMessage ¶
func (msg *MsgProcessCleanupEventUnix) HandleMessage() *tetragon.GetEventsResponse
func (*MsgProcessCleanupEventUnix) Notify ¶
func (msg *MsgProcessCleanupEventUnix) Notify() bool
func (*MsgProcessCleanupEventUnix) Retry ¶
func (msg *MsgProcessCleanupEventUnix) Retry(internal *process.ProcessInternal, ev notify.Event) error
func (*MsgProcessCleanupEventUnix) RetryInternal ¶
func (msg *MsgProcessCleanupEventUnix) RetryInternal(ev notify.Event, timestamp uint64) (*process.ProcessInternal, error)