hostsensorutils

package
v2.0.398 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const PortName string = "scanner"

Variables

View Source
var (
	KubeletConfiguration         = "KubeletConfiguration"
	OsReleaseFile                = "OsReleaseFile"
	KernelVersion                = "KernelVersion"
	LinuxSecurityHardeningStatus = "LinuxSecurityHardeningStatus"
	OpenPortsList                = "OpenPortsList"
	LinuxKernelVariables         = "LinuxKernelVariables"
	KubeletCommandLine           = "KubeletCommandLine"
	KubeletInfo                  = "KubeletInfo"
	KubeProxyInfo                = "KubeProxyInfo"
	ControlPlaneInfo             = "ControlPlaneInfo"
	CloudProviderInfo            = "CloudProviderInfo"

	MapHostSensorResourceToApiGroup = map[string]string{
		KubeletConfiguration:         "hostdata.kubescape.cloud/v1beta0",
		OsReleaseFile:                "hostdata.kubescape.cloud/v1beta0",
		KubeletCommandLine:           "hostdata.kubescape.cloud/v1beta0",
		KernelVersion:                "hostdata.kubescape.cloud/v1beta0",
		LinuxSecurityHardeningStatus: "hostdata.kubescape.cloud/v1beta0",
		OpenPortsList:                "hostdata.kubescape.cloud/v1beta0",
		LinuxKernelVariables:         "hostdata.kubescape.cloud/v1beta0",
		KubeletInfo:                  "hostdata.kubescape.cloud/v1beta0",
		KubeProxyInfo:                "hostdata.kubescape.cloud/v1beta0",
		ControlPlaneInfo:             "hostdata.kubescape.cloud/v1beta0",
		CloudProviderInfo:            "hostdata.kubescape.cloud/v1beta0",
	}
)

Functions

func NewWorkerPool

func NewWorkerPool() workerPool

Types

type HostSensorHandler

type HostSensorHandler struct {
	HostSensorPort                int32
	HostSensorPodNames            map[string]string //map from pod names to node names
	HostSensorUnscheduledPodNames map[string]string //map from pod names to node names
	IsReady                       <-chan bool       //readonly chan

	DaemonSet *appsv1.DaemonSet
	// contains filtered or unexported fields
}

func NewHostSensorHandler

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

func (*HostSensorHandler) CollectResources

func (*HostSensorHandler) ForwardToPod

func (hsh *HostSensorHandler) ForwardToPod(podName, path string) ([]byte, error)

func (*HostSensorHandler) GetCloudProviderInfo

func (hsh *HostSensorHandler) GetCloudProviderInfo() ([]hostsensor.HostSensorDataEnvelope, error)

return list of KubeProxyInfo

func (*HostSensorHandler) GetControlPlaneInfo

func (hsh *HostSensorHandler) GetControlPlaneInfo() ([]hostsensor.HostSensorDataEnvelope, error)

return list of KubeProxyInfo

func (*HostSensorHandler) GetKernelVariables

func (hsh *HostSensorHandler) GetKernelVariables() ([]hostsensor.HostSensorDataEnvelope, error)

return list of LinuxKernelVariables

func (*HostSensorHandler) GetKernelVersion

func (hsh *HostSensorHandler) GetKernelVersion() ([]hostsensor.HostSensorDataEnvelope, error)

return list of

func (*HostSensorHandler) GetKubeProxyInfo

func (hsh *HostSensorHandler) GetKubeProxyInfo() ([]hostsensor.HostSensorDataEnvelope, error)

return list of KubeProxyInfo

func (*HostSensorHandler) GetKubeletCommandLine

func (hsh *HostSensorHandler) GetKubeletCommandLine() ([]hostsensor.HostSensorDataEnvelope, error)

return list of KubeletCommandLine

func (*HostSensorHandler) GetKubeletConfigurations

func (hsh *HostSensorHandler) GetKubeletConfigurations() ([]hostsensor.HostSensorDataEnvelope, error)

return list of

func (*HostSensorHandler) GetKubeletInfo

func (hsh *HostSensorHandler) GetKubeletInfo() ([]hostsensor.HostSensorDataEnvelope, error)

return list of KubeletInfo

func (*HostSensorHandler) GetLinuxSecurityHardeningStatus

func (hsh *HostSensorHandler) GetLinuxSecurityHardeningStatus() ([]hostsensor.HostSensorDataEnvelope, error)

return list of LinuxSecurityHardeningStatus

func (*HostSensorHandler) GetNamespace

func (hsh *HostSensorHandler) GetNamespace() string

func (*HostSensorHandler) GetOpenPortsList

func (hsh *HostSensorHandler) GetOpenPortsList() ([]hostsensor.HostSensorDataEnvelope, error)

return list of OpenPortsList

func (*HostSensorHandler) GetOsReleaseFile

func (hsh *HostSensorHandler) GetOsReleaseFile() ([]hostsensor.HostSensorDataEnvelope, error)

return list of

func (*HostSensorHandler) GetVersion

func (hsh *HostSensorHandler) GetVersion() (string, error)

return host-scanner version

func (*HostSensorHandler) HTTPGetToPod

func (hsh *HostSensorHandler) HTTPGetToPod(podName, path string) ([]byte, error)

func (*HostSensorHandler) Init

func (hsh *HostSensorHandler) Init() error

func (*HostSensorHandler) TearDown

func (hsh *HostSensorHandler) TearDown() error

type HostSensorHandlerMock

type HostSensorHandlerMock struct {
}

func (*HostSensorHandlerMock) CollectResources

func (*HostSensorHandlerMock) GetNamespace

func (hshm *HostSensorHandlerMock) GetNamespace() string

func (*HostSensorHandlerMock) Init

func (hshm *HostSensorHandlerMock) Init() error

func (*HostSensorHandlerMock) TearDown

func (hshm *HostSensorHandlerMock) TearDown() error

type IHostSensor

type IHostSensor interface {
	Init() error
	TearDown() error
	CollectResources() ([]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