Documentation
¶
Index ¶
- Constants
- Variables
- func EnabledBPFStats(log *logging.Logger) (func(), error)
- type ActualDestinationGetter
- type ArgType
- type CgroupClient
- type Config
- type ContainerClient
- type EventFilter
- type EventFilterGenerator
- func FilterAnd(filtersGenerators ...EventFilterGenerator) EventFilterGenerator
- func GlobalEventFilterGenerator(filter EventFilter) EventFilterGenerator
- func RateLimit(spec RateLimitPolicy) EventFilterGenerator
- func RateLimitPrivateIP(spec RateLimitPolicy) EventFilterGenerator
- func SkipPrivateIP() EventFilterGenerator
- type EventPolicy
- type EventProbe
- type EventsPolicyConfig
- type FileAccessKey
- type FileAccessStats
- type KernelEventFilter
- type LRUPolicy
- type MetricsReportingConfig
- type NetflowGrouping
- type Policy
- type PolicyOutputConfig
- type PreEventFilter
- type PreEventFilterGenerator
- type RateLimitPolicy
- type SyscallID
- type SyscallStats
- type SyscallStatsKeyCgroupID
- type TailCall
- type Tracer
- func (t *Tracer) ApplyPolicy(policy *Policy) error
- func (t *Tracer) Close() error
- func (t *Tracer) CollectFileAccessStats() ([]FileAccessKey, []FileAccessStats, error)
- func (t *Tracer) CollectNetworkSummary() ([]TrafficKey, []TrafficSummary, error)
- func (t *Tracer) Events() <-chan *types.Event
- func (t *Tracer) GetEventName(id events.ID) string
- func (t *Tracer) IsCgroupMuted(cgroup uint64) bool
- func (t *Tracer) Load() error
- func (t *Tracer) MuteEventsFromCgroup(cgroup uint64, reason string) error
- func (t *Tracer) MuteEventsFromCgroups(cgroups []uint64, reason string) error
- func (t *Tracer) ReadSyscallStats() (map[SyscallStatsKeyCgroupID][]SyscallStats, error)
- func (t *Tracer) Run(ctx context.Context) error
- func (t *Tracer) UnmuteEventsFromCgroup(cgroup uint64) error
- func (t *Tracer) UnmuteEventsFromCgroups(cgroups []uint64) error
- type TracerEventContextT
- type TrafficKey
- type TrafficSummary
Constants ¶
const ( TailSchedProcessExecEventSubmit uint32 = iota MaxTail )
const ( ProbeSysEnter handle = iota ProbeSysExit ProbeSyscallEnter__Internal ProbeSyscallExit__Internal ProbeSchedProcessFork ProbeSchedProcessExec ProbeSchedProcessExit ProbeSchedProcessFree ProbeSchedSwitch ProbeVfsWriteMagic ProbeVfsWriteMagicRet ProbeVfsWriteVMagic ProbeVfsWriteVMagicRet ProbeKernelWriteMagic ProbeKernelWriteMagicRet ProbeCgroupMkdir ProbeCgroupRmdir ProbeSecurityBPRMCheck ProbeSecuritySocketConnect ProbeSecurityInodeFollowLink ProbeCgroupSKBIngress ProbeCgroupSKBEgress ProbeFileUpdateTime ProbeFileUpdateTimeRet ProbeFileModified ProbeFileModifiedRet ProbeFdInstall ProbeFilpClose ProbeExecBinprm ProbeOomMarkVictim ProbeTtyOpen ProbeTtyWrite ProbeCgroupSockCreate ProbeCgroupSockOpts ProbeDoFilpOpen )
const (
UnknownMetric eBPFMetric = iota
)
Variables ¶
var ( ErrFilterPass error = nil ErrFilterRateLimit = errors.New("rate limit") ErrErrEmptyDNSResponse = errors.New("empty dns response") ErrErrDNSDuplicateDetected = errors.New("dns duplicate detected") )
var ErrPanic = errors.New("encountered panic")
ErrPanic indicating that the resulting error was caught from a panic
Functions ¶
func EnabledBPFStats ¶ added in v1.21.0
Types ¶
type ActualDestinationGetter ¶
type ActualDestinationGetter interface {
GetDestination(src, dst netip.AddrPort) (netip.AddrPort, bool)
}
ActualDestinationGetter is used to find actual destination ip. Usually this info is obtained from conntrack.
type CgroupClient ¶ added in v1.3.0
type Config ¶
type Config struct {
BTFPath string
SignalEventsRingBufferSize uint32 `validate:"required"`
EventsRingBufferSize uint32 `validate:"required"`
SkbEventsRingBufferSize uint32 `validate:"required"`
EventsOutputChanSize int
DefaultCgroupsVersion string `validate:"required,oneof=V1 V2"`
DebugEnabled bool
AutomountCgroupv2 bool
ContainerClient ContainerClient
CgroupClient CgroupClient
SignatureEngine *signature.SignatureEngine
MountNamespacePIDStore *types.PIDsPerNamespace
// All PIPs reported from ebpf will be normalized to this PID namespace
HomePIDNS proc.NamespaceID
AllowAnyEvent bool
FileAccessEnabled bool
NetflowsEnabled bool
NetflowGrouping NetflowGrouping
TrackSyscallStats bool
ProcessTreeCollector processTreeCollector
MetricsReporting MetricsReportingConfig
PodName string
}
type ContainerClient ¶
type EventFilter ¶
EventFilter allows for filtering of events before they are send to the server
type EventFilterGenerator ¶
type EventFilterGenerator func() EventFilter
EventFilterGenerator Produces an event filter for each call
func FilterAnd ¶
func FilterAnd(filtersGenerators ...EventFilterGenerator) EventFilterGenerator
func GlobalEventFilterGenerator ¶
func GlobalEventFilterGenerator(filter EventFilter) EventFilterGenerator
GlobalEventFilterGenerator always returns the given filter on each generator invocation. This is useful, if you want some global filtering across cgroups.
func RateLimit ¶
func RateLimit(spec RateLimitPolicy) EventFilterGenerator
func RateLimitPrivateIP ¶ added in v1.13.2
func RateLimitPrivateIP(spec RateLimitPolicy) EventFilterGenerator
func SkipPrivateIP ¶ added in v1.29.0
func SkipPrivateIP() EventFilterGenerator
type EventPolicy ¶
type EventPolicy struct {
ID events.ID
PreFilterGenerator PreEventFilterGenerator
FilterGenerator EventFilterGenerator
KernelFilters []KernelEventFilter
}
type EventProbe ¶
type EventProbe struct {
// contains filtered or unexported fields
}
type EventsPolicyConfig ¶ added in v1.17.0
func (*EventsPolicyConfig) Set ¶ added in v1.17.0
func (n *EventsPolicyConfig) Set(s string) error
func (*EventsPolicyConfig) String ¶ added in v1.17.0
func (n *EventsPolicyConfig) String() string
func (*EventsPolicyConfig) Type ¶ added in v1.17.0
func (n *EventsPolicyConfig) Type() string
type FileAccessKey ¶ added in v1.39.7
type FileAccessKey tracerFileAccessKey
type FileAccessStats ¶ added in v1.39.7
type FileAccessStats tracerFileAccessStats
type KernelEventFilter ¶ added in v1.30.0
KernelEventFilter is a placeholder and currently used for documentation purposes only. Each used filter is describer with explanation how it's implemented in the kernel.
type MetricsReportingConfig ¶ added in v1.21.0
func (MetricsReportingConfig) Enabled ¶ added in v1.21.0
func (m MetricsReportingConfig) Enabled() bool
type NetflowGrouping ¶ added in v1.13.1
type NetflowGrouping uint64
const (
NetflowGroupingDropSrcPort NetflowGrouping = (1 << iota)
)
func (*NetflowGrouping) Set ¶ added in v1.13.1
func (n *NetflowGrouping) Set(s string) error
func (*NetflowGrouping) String ¶ added in v1.13.1
func (n *NetflowGrouping) String() string
func (*NetflowGrouping) Type ¶ added in v1.13.1
func (n *NetflowGrouping) Type() string
type Policy ¶
type Policy struct {
SystemEvents []events.ID // List of events required for internal tasks such as cache cleanup
SignatureEvents []events.ID
Events []*EventPolicy
Output PolicyOutputConfig
}
type PolicyOutputConfig ¶
type PreEventFilter ¶
PreEventFilter allows for filtering of events coming from the kernel before they are decoded. Parsed args should be returned if filter passes.
type PreEventFilterGenerator ¶
type PreEventFilterGenerator func() PreEventFilter
EventFilterGenerator Produces an pre event filter for each call
func DeduplicateDNSEventsPreFilter ¶ added in v1.30.0
func DeduplicateDNSEventsPreFilter(log *logging.Logger, size uint32, ttl time.Duration) PreEventFilterGenerator
DeduplicateDNSEventsPreFilter skips sending dns events which are already in the local per cgroup cache.
func GlobalPreEventFilterGenerator ¶
func GlobalPreEventFilterGenerator(filter PreEventFilter) PreEventFilterGenerator
GlobalPreEventFilterGenerator always returns the given filter on each generator invocation. This is useful, if you want some global filtering across cgroups.
type RateLimitPolicy ¶
type RateLimitPolicy struct {
// If interval is set rate limit can be used as interval based sampling. In such case burst is always 1.
Interval time.Duration
// Rate is events per second.
Rate float64
Burst int
}
RateLimitPolicy allows to configure event rate limiting.
type SyscallStats ¶
type SyscallStatsKeyCgroupID ¶
type SyscallStatsKeyCgroupID uint64
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
func (*Tracer) ApplyPolicy ¶
func (*Tracer) CollectFileAccessStats ¶ added in v1.39.7
func (t *Tracer) CollectFileAccessStats() ([]FileAccessKey, []FileAccessStats, error)
func (*Tracer) CollectNetworkSummary ¶ added in v1.21.0
func (t *Tracer) CollectNetworkSummary() ([]TrafficKey, []TrafficSummary, error)
func (*Tracer) IsCgroupMuted ¶
func (*Tracer) MuteEventsFromCgroup ¶
func (*Tracer) MuteEventsFromCgroups ¶
func (*Tracer) ReadSyscallStats ¶
func (t *Tracer) ReadSyscallStats() (map[SyscallStatsKeyCgroupID][]SyscallStats, error)
func (*Tracer) UnmuteEventsFromCgroup ¶
func (*Tracer) UnmuteEventsFromCgroups ¶
type TracerEventContextT ¶ added in v1.21.0
type TracerEventContextT = tracerEventContextT
func (TracerEventContextT) Encode ¶ added in v1.36.1
func (t TracerEventContextT) Encode() ([]byte, error)
type TrafficKey ¶ added in v1.21.0
type TrafficKey tracerIpKey
type TrafficSummary ¶ added in v1.21.0
type TrafficSummary tracerTrafficSummary