filters

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Filters is the list of default filters

Functions

func BuildFilter

func BuildFilter(ctx context.Context, ff *tetragon.Filter, filterFuncs []OnBuildFilter) (hubbleFilters.FilterFuncs, error)

func BuildFilterList

func BuildFilterList(ctx context.Context, ff []*tetragon.Filter, filterFuncs []OnBuildFilter) (hubbleFilters.FilterFuncs, error)

func FilterByLabelSelectors

func FilterByLabelSelectors(labelSelectors []string) (hubbleFilters.FilterFunc, error)

FilterByLabelSelectors returns a FilterFunc. The FilterFunc returns true if and only if any of the specified selectors select the event. The caller specifies how to extract labels from the event.

func GetParent

func GetParent(event *v1.Event) *tetragon.Process

func GetProcess

func GetProcess(event *v1.Event) *tetragon.Process

func MaybeExecProbe

func MaybeExecProbe(binary string, args string, execProbe []string) bool

func ParseFieldFilterList added in v0.8.4

func ParseFieldFilterList(filters string) ([]*tetragon.FieldFilter, error)

func ParseFilterList

func ParseFilterList(filters string, enablePidSetFilters bool) ([]*tetragon.Filter, error)

ParseFilterList parses a list of process filters in JSON format into protobuf messages.

Types

type ArgumentsRegexFilter

type ArgumentsRegexFilter struct{}

func (*ArgumentsRegexFilter) OnBuildFilter

type BinaryRegexFilter

type BinaryRegexFilter struct{}

func (*BinaryRegexFilter) OnBuildFilter

type ChildCache added in v0.10.0

type ChildCache = map[uint32]struct{}

We could use an LRU here but we really don't want to evict old entries and risk failing a test that uses this filter. Instead, we take the safer approach from the perspective of testing and opt to grow the map indefinitely and log a warning if the size exceeeds a pre-determined threshold. Since we have protections in place to prevent this filter being used in production, this should be acceptable.

type EventTypeFilter

type EventTypeFilter struct{}

func (*EventTypeFilter) OnBuildFilter

type FieldFilter

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

FieldFilter is a helper for filtering fields in events

func FieldFilterFromProto

func FieldFilterFromProto(filter *tetragon.FieldFilter) *FieldFilter

FieldFilterFromProto constructs a new FieldFilter from a Tetragon API field filter.

func FieldFiltersFromGetEventsRequest

func FieldFiltersFromGetEventsRequest(request *tetragon.GetEventsRequest) []*FieldFilter

FieldFiltersFromGetEventsRequest returns a list of EventFieldFilter for a GetEventsRequest.

func NewExcludeFieldFilter

func NewExcludeFieldFilter(eventSet []tetragon.EventType, fields []string, invertEventSet bool) *FieldFilter

NewExcludeFieldFilter constructs a new exclusion FieldFilter from a set of fields.

func NewFieldFilter

func NewFieldFilter(eventSet []tetragon.EventType, fields []string, action tetragon.FieldFilterAction, invertEventSet bool) *FieldFilter

NewFieldFilter constructs a new FieldFilter from a set of fields.

func NewIncludeFieldFilter

func NewIncludeFieldFilter(eventSet []tetragon.EventType, fields []string, invertEventSet bool) *FieldFilter

NewIncludeFieldFilter constructs a new inclusion FieldFilter from a set of fields.

func (*FieldFilter) Filter

func (f *FieldFilter) Filter(event *tetragon.GetEventsResponse) error

Filter filters the fields in the GetEventsResponse, keeping fields specified in the inclusion filter and discarding fields specified in the exclusion filter. Exclusion takes precedence over inclusion and an empty filter set will keep all remaining fields.

type HealthCheckFilter

type HealthCheckFilter struct{}

func (*HealthCheckFilter) OnBuildFilter

type LabelsFilter

type LabelsFilter struct{}

LabelsFilter implements filtering based on pod labels

func (*LabelsFilter) OnBuildFilter

func (l *LabelsFilter) OnBuildFilter(_ context.Context, filter *tetragon.Filter) ([]hubbleFilters.FilterFunc, error)

OnBuildFilter builds a labels filter

type NamespaceFilter

type NamespaceFilter struct{}

func (*NamespaceFilter) OnBuildFilter

type OnBuildFilter

type OnBuildFilter interface {
	OnBuildFilter(context.Context, *tetragon.Filter) ([]hubbleFilters.FilterFunc, error)
}

OnBuildFilter is invoked while building a flow filter

type OnBuildFilterFunc

type OnBuildFilterFunc func(context.Context, *tetragon.Filter) ([]hubbleFilters.FilterFunc, error)

OnBuildFilterFunc implements OnBuildFilter for a single function

func (OnBuildFilterFunc) OnBuildFilter

func (f OnBuildFilterFunc) OnBuildFilter(ctx context.Context, tetragonFilter *tetragon.Filter) ([]hubbleFilters.FilterFunc, error)

OnBuildFilter is invoked while building a flow filter

type PidFilter

type PidFilter struct{}

func (*PidFilter) OnBuildFilter

func (f *PidFilter) OnBuildFilter(_ context.Context, ff *tetragon.Filter) ([]hubbleFilters.FilterFunc, error)

type PidSetFilter

type PidSetFilter struct{}

PidSetFilter is a filter that matches on a process and all of its children by their PID, up to maxChildCacheSize number of children.

func (*PidSetFilter) OnBuildFilter

func (f *PidSetFilter) OnBuildFilter(_ context.Context, ff *tetragon.Filter) ([]hubbleFilters.FilterFunc, error)

type PodRegexFilter

type PodRegexFilter struct{}

func (*PodRegexFilter) OnBuildFilter

Jump to

Keyboard shortcuts

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