Documentation ¶
Index ¶
- Constants
- Variables
- func EnabledBPFStats(log *logging.Logger) (func(), error)
- type ActualDestinationGetter
- type ArgType
- type CgroupClient
- type Config
- type ContainerClient
- type EBPFMetric
- type EventFilter
- type EventFilterGenerator
- func DeduplicateDnsEvents(l *logging.Logger, size uint32, ttl time.Duration) EventFilterGenerator
- func FilterAnd(filtersGenerators ...EventFilterGenerator) EventFilterGenerator
- func FilterEmptyDnsAnswers(l *logging.Logger) EventFilterGenerator
- func GlobalEventFilterGenerator(filter EventFilter) EventFilterGenerator
- func RateLimit(spec RateLimitPolicy) EventFilterGenerator
- func RateLimitPrivateIP(spec RateLimitPolicy) EventFilterGenerator
- type EventPolicy
- type EventProbe
- type EventsPolicyConfig
- 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) CollectNetworkSummary() (map[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) error
- func (t *Tracer) MuteEventsFromCgroups(cgroups []uint64) error
- func (t *Tracer) NetflowEvents() <-chan *types.Event
- 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 ProbeCgroupSKBIngress ProbeCgroupSKBEgress ProbeFileUpdateTime ProbeFileUpdateTimeRet ProbeFileModified ProbeFileModifiedRet ProbeFdInstall ProbeFilpClose ProbeExecBinprm ProbeOomMarkVictim ProbeTtyOpen ProbeTtyWrite ProbeCgroupSockCreate ProbeCgroupSockOpts )
Variables ¶
var ( FilterPass error = nil FilterErrRateLimit = errors.New("rate limit") FilterErrEmptyDNSResponse = errors.New("empty dns response") FilterErrDNSDuplicateDetected = errors.New("dns duplicate detected") )
var ErrPanic = errors.New("encountered panic")
Error 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 EventsPerCPUBuffer int EventsOutputChanSize int DefaultCgroupsVersion string `validate:"required,oneof=V1 V2"` DebugEnabled 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 NetflowOutputChanSize int NetflowSampleSubmitIntervalSeconds uint64 NetflowGrouping NetflowGrouping TrackSyscallStats bool ProcessTreeCollector processTreeCollector MetricsReporting MetricsReportingConfig }
type ContainerClient ¶
type EBPFMetric ¶ added in v1.16.0
type EBPFMetric int
Must be kept in sync with `enum metric` defined in types.h.
const ( UnknownMetric EBPFMetric = iota NoFreeScratchBuffer NoFreeScratchBufferSocketSetState NoFreeScratchBufferNetflows )
func (EBPFMetric) String ¶ added in v1.16.0
func (m EBPFMetric) String() string
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 DeduplicateDnsEvents ¶
DeduplicateDnsEvents creates a filter that will drop any DNS event with questions already seen in `ttl` time
func FilterAnd ¶
func FilterAnd(filtersGenerators ...EventFilterGenerator) EventFilterGenerator
func FilterEmptyDnsAnswers ¶
func FilterEmptyDnsAnswers(l *logging.Logger) EventFilterGenerator
FilterEmptyDnsAnswers will drop any DNS event, that is missing an answer section
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
type EventPolicy ¶
type EventPolicy struct { ID events.ID PreFilterGenerator PreEventFilterGenerator FilterGenerator EventFilterGenerator }
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 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 ¶
type PreEventFilter func(ctx *types.EventContext) error
PreEventFilter allows for filtering of events coming from the kernel before they are decoded
type PreEventFilterGenerator ¶
type PreEventFilterGenerator func() PreEventFilter
EventFilterGenerator Produces an pre event filter for each call
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.
func PreRateLimit ¶
func PreRateLimit(spec RateLimitPolicy) PreEventFilterGenerator
PreRateLimit creates an pre event filter that limits the amount of events that will be processed accoring to the specified limits
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) CollectNetworkSummary ¶ added in v1.21.0
func (t *Tracer) CollectNetworkSummary() (map[TrafficKey]TrafficSummary, error)
func (*Tracer) IsCgroupMuted ¶
func (*Tracer) MuteEventsFromCgroup ¶
func (*Tracer) MuteEventsFromCgroups ¶
func (*Tracer) NetflowEvents ¶ added in v1.7.0
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
type TrafficKey ¶ added in v1.21.0
type TrafficKey tracerIpKey
type TrafficSummary ¶ added in v1.21.0
type TrafficSummary tracerTrafficSummary