tracing

package
v0.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2023 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Index

Constants

View Source
const (
	ContainerActivityEventStart    = "start"
	ContainerActivityEventAttached = "attached"
	ContainerActivityEventStop     = "stop"
)

Variables

This section is empty.

Functions

func DetectContainerRuntime added in v0.0.22

func DetectContainerRuntime(hostMount string) (*containerutilsTypes.RuntimeConfig, error)

Types

type AtachableTracer added in v0.0.21

type AtachableTracer interface {
	Attach(pid uint32) error
	Detach(pid uint32) error
	Close()
}

type CapabilitiesEvent

type CapabilitiesEvent struct {
	GeneralEvent

	Syscall        string
	CapabilityName string
}

type ContainerActivityEvent

type ContainerActivityEvent struct {
	ContainerName string
	PodName       string
	Namespace     string
	Activity      string
	// Low level container information
	ContainerID string
	NsMntId     uint64
	Pid         uint32
}

type ContainerActivityEventListener

type ContainerActivityEventListener interface {
	// OnContainerActivityEvent is called when a container activity event is received
	OnContainerActivityEvent(event *ContainerActivityEvent)
}

type DnsEvent

type DnsEvent struct {
	GeneralEvent

	DnsName   string
	Addresses []string
}

type EventSink

type EventSink interface {
	// SendExecveEvent sends an execve event to the sink
	SendExecveEvent(event *ExecveEvent)
	// SendOpenEvent sends a OPEN event to the sink
	SendOpenEvent(event *OpenEvent)
	// SendCapabilitiesEvent sends a Capabilities event to the sink
	SendCapabilitiesEvent(event *CapabilitiesEvent)
	// SendDnsEvent sends a Dns event to the sink
	SendDnsEvent(event *DnsEvent)
	// SendNetworkEvent sends a Network event to the sink
	SendNetworkEvent(event *NetworkEvent)
}

type EventType added in v0.0.14

type EventType int
const (
	ExecveEventType EventType = iota
	OpenEventType
	CapabilitiesEventType
	DnsEventType
	NetworkEventType
	SyscallEventType
	AllEventType
)

type ExecveEvent

type ExecveEvent struct {
	GeneralEvent

	PathName string
	Args     []string
	Env      []string
}

type GadgetTracerCommon added in v0.0.21

type GadgetTracerCommon interface {
	Stop()
}

type GeneralEvent added in v0.0.14

type GeneralEvent struct {
	ProcessDetails
	ContainerName string
	ContainerID   string
	PodName       string
	Namespace     string
	MountNsID     uint64
	Timestamp     int64
	EventType     EventType
}

type ITracer

type ITracer interface {
	Start() error
	Stop() error
	AddContainerActivityListener(listener ContainerActivityEventListener)
	RemoveContainerActivityListener(listener ContainerActivityEventListener)
	PeekSyscallInContainer(nsMountId uint64) ([]string, error)
	AddEventSink(sink EventSink)
	RemoveEventSink(sink EventSink)
	StartTraceContainer(mntns uint64, pid uint32, eventType EventType) error
	StopTraceContainer(mntns uint64, pid uint32, eventType EventType) error
}

type NetworkEvent

type NetworkEvent struct {
	GeneralEvent

	PacketType  string
	Protocol    string
	Port        uint16
	DstEndpoint string
}

type OpenEvent

type OpenEvent struct {
	GeneralEvent

	TaskName string
	TaskId   uint32
	PathName string
	Flags    []string
}

type PeekableTracer added in v0.0.21

type PeekableTracer interface {
	Peek(nsMountId uint64) ([]string, error)
	Close()
}

type ProcessDetails added in v0.0.25

type ProcessDetails struct {
	Pid  uint32
	Ppid uint32
	Comm string
	Cwd  string
	Uid  uint32
	Gid  uint32
}

type SyscallEvent added in v0.0.19

type SyscallEvent struct {
	GeneralEvent

	Syscalls []string
}

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

func NewTracer

func NewTracer(nodeName string, k8sConfig *rest.Config, eventSinks []EventSink, filterByLabel bool) *Tracer

func (*Tracer) AddContainerActivityListener

func (t *Tracer) AddContainerActivityListener(listener ContainerActivityEventListener)

func (*Tracer) AddEventSink added in v0.0.13

func (t *Tracer) AddEventSink(sink EventSink)

func (*Tracer) GenerateContainerEventsOnStart added in v0.0.22

func (t *Tracer) GenerateContainerEventsOnStart()

func (*Tracer) GetListOfRunningContainers added in v0.0.22

func (t *Tracer) GetListOfRunningContainers() (*[]ContainerActivityEvent, error)

func (*Tracer) PeekSyscallInContainer

func (t *Tracer) PeekSyscallInContainer(nsMountId uint64) ([]string, error)

func (*Tracer) RemoveContainerActivityListener

func (t *Tracer) RemoveContainerActivityListener(listener ContainerActivityEventListener)

func (*Tracer) RemoveEventSink added in v0.0.13

func (t *Tracer) RemoveEventSink(sink EventSink)

func (*Tracer) Start

func (t *Tracer) Start() error

func (*Tracer) StartTraceContainer added in v0.0.21

func (t *Tracer) StartTraceContainer(mntns uint64, pid uint32, eventType EventType) error

func (*Tracer) Stop

func (t *Tracer) Stop() error

func (*Tracer) StopTraceContainer added in v0.0.21

func (t *Tracer) StopTraceContainer(mntns uint64, pid uint32, eventType EventType) error

type TracingState added in v0.0.21

type TracingState struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL