services

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	// Name will define a name for the matching service. If unset, it will take the name of the executable process
	Name string `yaml:"name"`
	// Namespace will define a namespace for the matching service. If unset, it will be left empty.
	Namespace string `yaml:"namespace"`
	// OpenPorts allows defining a group of ports that this service could open. It accepts a comma-separated
	// list of port numbers (e.g. 80) and port ranges (e.g. 8080-8089)
	OpenPorts PortEnum `yaml:"open_ports"`
	// Path allows defining the regular expression matching the full executable path.
	Path PathRegexp `yaml:"exe_path_regexp"`
}

Attributes that specify a given instrumented service. Each instance has to define either the OpenPorts or Path property, or both. These are used to match a given executable. If both OpenPorts and Path are defined, the inspected executable must fulfill both properties.

type DefinitionCriteria

type DefinitionCriteria []Attributes

DefinitionCriteria allows defining a group of services to be instrumented according to a set of attributes. If a given executable/service matches multiple of the attributes, the earliest defined service will take precedence.

func (DefinitionCriteria) PortOfInterest added in v0.4.2

func (dc DefinitionCriteria) PortOfInterest(port int) bool

func (DefinitionCriteria) Validate

func (dc DefinitionCriteria) Validate() error

type DiscoveryConfig

type DiscoveryConfig struct {
	// Services selection. If the user defined the BEYLA_EXECUTABLE_NAME or BEYLA_OPEN_PORT variables, they will be automatically
	// added to the services definition criteria, with the lowest preference.
	Services DefinitionCriteria `yaml:"services"`

	// PollInterval specifies, for the poll service watcher, the interval time between
	// process inspections
	PollInterval time.Duration `yaml:"poll_interval" env:"BEYLA_DISCOVERY_POLL_INTERVAL"`

	// SystemWide allows instrumentation of all HTTP (no gRPC) calls, incoming and outgoing at a system wide scale.
	// No filtering per application will be done. Using this option may result in reduced quality of information
	// gathered for certain languages, such as Golang.
	SystemWide bool `yaml:"system_wide" env:"BEYLA_SYSTEM_WIDE"`

	// This can be enabled to use generic HTTP tracers only, no Go-specifics will be used:
	SkipGoSpecificTracers bool `yaml:"skip_go_specific_tracers" env:"BEYLA_SKIP_GO_SPECIFIC_TRACERS"`

	// Debugging only option. Make sure the kernel side doesn't filter any PIDs, force user space filtering.
	BPFPidFilterOff bool `yaml:"bpf_pid_filter_off" env:"BEYLA_BPF_PID_FILTER_OFF"`
}

DiscoveryConfig for the discover.ProcessFinder pipeline

type PathRegexp

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

PathRegexp stores a regular expression representing an executable file path.

func NewPathRegexp

func NewPathRegexp(re *regexp.Regexp) PathRegexp

func (*PathRegexp) IsSet

func (p *PathRegexp) IsSet() bool

func (*PathRegexp) MatchString

func (p *PathRegexp) MatchString(input string) bool

func (*PathRegexp) UnmarshalText

func (p *PathRegexp) UnmarshalText(text []byte) error

func (*PathRegexp) UnmarshalYAML

func (p *PathRegexp) UnmarshalYAML(value *yaml.Node) error

type PortEnum

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

PortEnum defines an enumeration of ports. It allows defining a set of single ports as well a set of port ranges. When unmarshalled from text, it accepts a comma-separated list of port numbers (e.g. 80) and port ranges (e.g. 8080-8089). For example, this would be a valid port range: 80,443,8000-8999

func (*PortEnum) Len

func (p *PortEnum) Len() int

func (*PortEnum) Matches

func (p *PortEnum) Matches(port int) bool

func (*PortEnum) UnmarshalText

func (p *PortEnum) UnmarshalText(text []byte) error

func (*PortEnum) UnmarshalYAML

func (p *PortEnum) UnmarshalYAML(value *yaml.Node) error

type ProcessInfo

type ProcessInfo struct {
	Pid       int32
	PPid      int32
	ExePath   string
	OpenPorts []uint32
}

ProcessInfo stores some relevant information about a running process

Jump to

Keyboard shortcuts

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