scanner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentFinder

type AgentFinder struct {
	ProcessStatusRefreshPeriod string `mapstructure:"process_status_refresh_period"` // match recent keep alive time

	ProcessStatusRefreshPeriodDuration time.Duration
}

type AgentMetadata

type AgentMetadata struct {
	Layer        string `mapstructure:"layer"`
	ServiceName  string `mapstructure:"service_name"`
	InstanceName string `mapstructure:"instance_name"`
	ProcessName  string `mapstructure:"process_name"`
	Properties   string `mapstructure:"properties"`
	Labels       string `mapstructure:"labels"`
	Language     string `mapstructure:"language"`
}

type Config

type Config struct {
	base.FinderBaseConfig

	// Scan Period
	Period string `mapstructure:"period"`

	ScanMode Mode `mapstructure:"mode"`

	// Agent process finder
	Agent *AgentFinder `mapstructure:"agent"`

	// Regex process finders
	RegexFinders []*RegexFinder `mapstructure:"regex"`
}

func (*Config) ActiveFinder

func (c *Config) ActiveFinder() bool

type Mode

type Mode string
var (
	Agent Mode = "AGENT_SENSOR"
	Regex Mode = "REGEX"
)

type Process

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

func NewProcessByAgent

func NewProcessByAgent(p *process.Process, cmdline string, agent *AgentMetadata) (*Process, error)

func NewProcessByRegex

func NewProcessByRegex(p *process.Process, cmdline string, config *RegexFinder) *Process

func (*Process) BuildIdentity

func (p *Process) BuildIdentity() string

BuildIdentity without pid

func (*Process) DetectType

func (p *Process) DetectType() api.ProcessDetectType

func (*Process) Entity

func (p *Process) Entity() *api.ProcessEntity

func (*Process) OriginalProcess

func (p *Process) OriginalProcess() *process.Process

func (*Process) Pid

func (p *Process) Pid() int32

func (*Process) ProfilingStat

func (p *Process) ProfilingStat() *profiling.Info

type ProcessFinder

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

func (*ProcessFinder) BuildEBPFProcess

func (*ProcessFinder) BuildNecessaryProperties

func (p *ProcessFinder) BuildNecessaryProperties(ps base.DetectedProcess) []*commonv3.KeyStringValuePair

func (*ProcessFinder) DetectType

func (p *ProcessFinder) DetectType() api.ProcessDetectType

func (*ProcessFinder) Init

func (*ProcessFinder) ParseProcessID

func (p *ProcessFinder) ParseProcessID(ps base.DetectedProcess, downstream *v3.EBPFProcessDownstream) string

func (*ProcessFinder) Start

func (p *ProcessFinder) Start()

func (*ProcessFinder) Stop

func (p *ProcessFinder) Stop() error

func (*ProcessFinder) ValidateProcessIsSame

func (p *ProcessFinder) ValidateProcessIsSame(p1, p2 base.DetectedProcess) bool

type RegexFinder

type RegexFinder struct {
	// Use command line to match the processes
	MatchCommandRegex string `mapstructure:"match_cmd"`

	// entity
	Layer        string `mapstructure:"layer"`         // process layer
	ServiceName  string `mapstructure:"service_name"`  // process entity service name
	InstanceName string `mapstructure:"instance_name"` // process entity service instance name
	ProcessName  string `mapstructure:"process_name"`  // process entity process name
	LabelsStr    string `mapstructure:"labels"`        // process labels for aggregate similar processes

	ParsedLabels []string
	// contains filtered or unexported fields
}

type TemplateContext

type TemplateContext struct {
	Rover   *base.TemplateRover
	Process *base.TemplateProcess
	Finder  *TemplateFinder
}

type TemplateFinder

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

func (*TemplateFinder) Layer

func (t *TemplateFinder) Layer() string

func (*TemplateFinder) RegexMatchGroup

func (t *TemplateFinder) RegexMatchGroup(inx int) (string, error)

Jump to

Keyboard shortcuts

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