Documentation ¶
Index ¶
- Constants
- func Glob(pattern string) ([]string, error)
- type EvalFSResource
- type EvalProcResource
- type FSResource
- type FileCommonData
- type FileSystemFetcher
- type Globs
- type K8sResource
- type KubeApiFetcherConfig
- type KubeFetcher
- type ProcCommonData
- type ProcResource
- type ProcessInputConfiguration
- type ProcessesConfigMap
- type ProcessesFetcher
Constants ¶
View Source
const ( FSResourceType = "file" FileSubType = "file" DirSubType = "directory" UserFile = "/hostfs/etc/passwd" GroupFile = "/hostfs/etc/group" )
View Source
const ( // CMDArgumentMatcher is a regex pattern that should match a process argument and its value // Expects format as the following: --<key><delimiter><value>. // For example: --config=a.json // The regex supports two delimiters "=" and "" CMDArgumentMatcher = "\\b%s[\\s=]\\/?(\\S+)" ProcessResourceType = "process" ProcessSubType = "process" )
View Source
const (
K8sObjType = "k8s_object"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EvalFSResource ¶
type EvalProcResource ¶
type FSResource ¶
type FSResource struct { EvalResource EvalFSResource ElasticCommon FileCommonData }
func (FSResource) GetData ¶
func (r FSResource) GetData() any
func (FSResource) GetElasticCommonData ¶
func (r FSResource) GetElasticCommonData() (map[string]any, error)
func (FSResource) GetIds ¶
func (r FSResource) GetIds() []string
func (FSResource) GetMetadata ¶
func (r FSResource) GetMetadata() (fetching.ResourceMetadata, error)
type FileCommonData ¶
type FileCommonData struct { Name string `mapstructure:"file.name,omitempty"` Mode string `mapstructure:"file.mode,omitempty"` Gid string `mapstructure:"file.gid,omitempty"` Uid string `mapstructure:"file.uid,omitempty"` Owner string `mapstructure:"file.owner,omitempty"` Group string `mapstructure:"file.group,omitempty"` Path string `mapstructure:"file.path,omitempty"` Inode string `mapstructure:"file.inode,omitempty"` Extension string `mapstructure:"file.extension,omitempty"` Size int64 `mapstructure:"file.size"` Type string `mapstructure:"file.type,omitempty"` Directory string `mapstructure:"file.directory,omitempty"` Accessed time.Time `mapstructure:"file.accessed"` Mtime time.Time `mapstructure:"file.mtime"` Ctime time.Time `mapstructure:"file.ctime"` }
FileCommonData According to https://www.elastic.co/guide/en/ecs/current/ecs-file.html
type FileSystemFetcher ¶
type FileSystemFetcher struct {
// contains filtered or unexported fields
}
FileSystemFetcher implement the Fetcher interface The FileSystemFetcher meant to fetch file/directories from the file system and ship it to the Cloudbeat
func NewFsFetcher ¶
func NewFsFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, patterns []string) *FileSystemFetcher
func (*FileSystemFetcher) Stop ¶
func (f *FileSystemFetcher) Stop()
type Globs ¶
type Globs []string
Globs represents one filepath glob, with its elements joined by "**". Based on https://github.com/yargevad/filepathx/blob/master/filepathx.go
type K8sResource ¶
type K8sResource struct { Data any // contains filtered or unexported fields }
func (K8sResource) GetData ¶
func (r K8sResource) GetData() any
func (K8sResource) GetElasticCommonData ¶
func (r K8sResource) GetElasticCommonData() (map[string]any, error)
func (K8sResource) GetIds ¶
func (r K8sResource) GetIds() []string
func (K8sResource) GetMetadata ¶
func (r K8sResource) GetMetadata() (fetching.ResourceMetadata, error)
type KubeApiFetcherConfig ¶
type KubeApiFetcherConfig struct { fetching.BaseFetcherConfig Interval time.Duration `config:"interval"` KubeConfig string `config:"kubeconfig"` }
type KubeFetcher ¶
type KubeFetcher struct {
// contains filtered or unexported fields
}
func NewKubeFetcher ¶
func NewKubeFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, provider k8s.Interface) *KubeFetcher
func (*KubeFetcher) Stop ¶
func (f *KubeFetcher) Stop()
type ProcCommonData ¶
type ProcCommonData struct { // Parent process. Parent *ProcCommonData `json:"parent,omitempty"` // Process id. PID int64 `json:"pid,omitempty"` // Process name. // Sometimes called program name or similar. Name string `json:"name,omitempty"` // Identifier of the group of processes the process belongs to. PGID int64 `json:"pgid,omitempty"` // Full command line that started the process, including the absolute path // to the executable, and all arguments. // Some arguments may be filtered to protect sensitive information. CommandLine string `json:"command_line,omitempty"` // Array of process arguments, starting with the absolute path to the // executable. // May be filtered to protect sensitive information. Args []string `json:"args,omitempty"` // Length of the process.args array. // This field can be useful for querying or performing bucket analysis on // how many arguments were provided to start a process. More arguments may // be an indication of suspicious activity. ArgsCount int64 `json:"args_count,omitempty"` // Process title. // The proctitle, sometimes the same as process name. Can also be // different: for example a browser setting its title to the web page // currently opened. Title string `json:"title,omitempty"` // The time the process started. Start time.Time `json:"start"` // Seconds the process has been up. Uptime int64 `json:"uptime,omitempty"` }
ProcCommonData According to https://www.elastic.co/guide/en/ecs/current/ecs-process.html
type ProcResource ¶
type ProcResource struct { EvalResource EvalProcResource ElasticCommon ProcCommonData }
func (ProcResource) GetData ¶
func (res ProcResource) GetData() any
func (ProcResource) GetElasticCommonData ¶
func (res ProcResource) GetElasticCommonData() (map[string]any, error)
func (ProcResource) GetIds ¶
func (res ProcResource) GetIds() []string
func (ProcResource) GetMetadata ¶
func (res ProcResource) GetMetadata() (fetching.ResourceMetadata, error)
type ProcessInputConfiguration ¶
type ProcessInputConfiguration struct {
ConfigFileArguments []string `config:"config-file-arguments"`
}
type ProcessesConfigMap ¶
type ProcessesConfigMap map[string]ProcessInputConfiguration
type ProcessesFetcher ¶
func NewProcessFetcher ¶
func NewProcessFetcher(log *logp.Logger, ch chan fetching.ResourceInfo, processes ProcessesConfigMap) *ProcessesFetcher
func (*ProcessesFetcher) Stop ¶
func (f *ProcessesFetcher) Stop()
Click to show internal directories.
Click to hide internal directories.