hostsensorutils

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeletConfiguration         scannerResource = "KubeletConfiguration"
	OsReleaseFile                scannerResource = "OsReleaseFile"
	KernelVersion                scannerResource = "KernelVersion"
	LinuxSecurityHardeningStatus scannerResource = "LinuxSecurityHardeningStatus"
	OpenPortsList                scannerResource = "OpenPortsList"
	LinuxKernelVariables         scannerResource = "LinuxKernelVariables"
	KubeletCommandLine           scannerResource = "KubeletCommandLine"
	KubeletInfo                  scannerResource = "KubeletInfo"
	KubeProxyInfo                scannerResource = "KubeProxyInfo"
	ControlPlaneInfo             scannerResource = "ControlPlaneInfo"
	CloudProviderInfo            scannerResource = "CloudProviderInfo"
	CNIInfo                      scannerResource = "CNIInfo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HostSensorHandler

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

HostSensorHandler is a client that interacts with a host-scanner component deployed on nodes.

The API exposed by the host sensor is defined here: https://github.com/kubescape/host-scanner

func NewHostSensorHandler

func NewHostSensorHandler(k8sObj *k8sinterface.KubernetesApi, hostSensorYAMLFile string) (*HostSensorHandler, error)

NewHostSensorHandler builds a new http client to the host-scanner API.

func (*HostSensorHandler) CollectResources

CollectResources collects all required information about all the pods for this host.

func (*HostSensorHandler) GetNamespace

func (hsh *HostSensorHandler) GetNamespace() string

func (*HostSensorHandler) Init

func (hsh *HostSensorHandler) Init(ctx context.Context) error

Init deploys the host-scanner and start watching the pods on the host.

func (*HostSensorHandler) TearDown

func (hsh *HostSensorHandler) TearDown() error

type HostSensorHandlerMock

type HostSensorHandlerMock struct {
}

HostSensorHandlerMock is a noop sensor when the host scanner is disabled.

func NewHostSensorHandlerMock added in v2.2.6

func NewHostSensorHandlerMock() *HostSensorHandlerMock

NewHostSensorHandlerMock yields a dummy host sensor.

func (*HostSensorHandlerMock) CollectResources

func (*HostSensorHandlerMock) GetNamespace

func (hshm *HostSensorHandlerMock) GetNamespace() string

func (*HostSensorHandlerMock) Init

func (*HostSensorHandlerMock) TearDown

func (hshm *HostSensorHandlerMock) TearDown() error

type IHostSensor

type IHostSensor interface {
	Init(ctx context.Context) error
	TearDown() error
	CollectResources(context.Context) ([]hostsensor.HostSensorDataEnvelope, map[string]apis.StatusInfo, error)
	GetNamespace() string
}

Jump to

Keyboard shortcuts

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