Documentation ¶
Index ¶
- Constants
- type HostSensorHandler
- func (hsh *HostSensorHandler) CollectResources(ctx context.Context) ([]hostsensor.HostSensorDataEnvelope, map[string]apis.StatusInfo, error)
- func (hsh *HostSensorHandler) GetNamespace() string
- func (hsh *HostSensorHandler) Init(ctx context.Context) error
- func (hsh *HostSensorHandler) TearDown() error
- type HostSensorHandlerMock
- func (hshm *HostSensorHandlerMock) CollectResources(_ context.Context) ([]hostsensor.HostSensorDataEnvelope, map[string]apis.StatusInfo, error)
- func (hshm *HostSensorHandlerMock) GetNamespace() string
- func (hshm *HostSensorHandlerMock) Init(_ context.Context) error
- func (hshm *HostSensorHandlerMock) TearDown() error
- type IHostSensor
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 ¶
func (hsh *HostSensorHandler) CollectResources(ctx context.Context) ([]hostsensor.HostSensorDataEnvelope, map[string]apis.StatusInfo, error)
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 (hshm *HostSensorHandlerMock) CollectResources(_ context.Context) ([]hostsensor.HostSensorDataEnvelope, map[string]apis.StatusInfo, error)
func (*HostSensorHandlerMock) GetNamespace ¶
func (hshm *HostSensorHandlerMock) GetNamespace() string
func (*HostSensorHandlerMock) Init ¶
func (hshm *HostSensorHandlerMock) Init(_ context.Context) error
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 }
Click to show internal directories.
Click to hide internal directories.