resourcehandler

package
v2.0.347 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImagevulnerabilitiesObjectGroup   = "armo.vuln.images"
	ImagevulnerabilitiesObjectVersion = "v1"
	ImagevulnerabilitiesObjectKind    = "ImageVulnerabilities"
)

Variables

View Source
var (
	ClusterDescribe              = "ClusterDescribe"
	KubeletConfiguration         = "KubeletConfiguration"
	OsReleaseFile                = "OsReleaseFile"
	KernelVersion                = "KernelVersion"
	LinuxSecurityHardeningStatus = "LinuxSecurityHardeningStatus"
	OpenPortsList                = "OpenPortsList"
	LinuxKernelVariables         = "LinuxKernelVariables"
	KubeletCommandLine           = "KubeletCommandLine"
	ImageVulnerabilities         = "ImageVulnerabilities"
	KubeletInfo                  = "KubeletInfo"
	KubeProxyInfo                = "KubeProxyInfo"

	MapResourceToApiGroup = 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",
	}
	MapResourceToApiGroupVuln = map[string][]string{
		ImageVulnerabilities: {"armo.vuln.images/v1", "image.vulnscan.com/v1"}}
	MapResourceToApiGroupCloud = map[string][]string{
		ClusterDescribe: {"container.googleapis.com/v1", "eks.amazonaws.com/v1", "management.azure.com/v1"}}
)

Functions

func ConvertMapListToMeta

func ConvertMapListToMeta(resourceMap []map[string]interface{}) []workloadinterface.IMetadata

func ScanRepository

func ScanRepository(command string, branchOptional string) ([]string, error)

Types

type EmptySelector

type EmptySelector struct {
}

func (*EmptySelector) GetNamespacesSelectors

func (es *EmptySelector) GetNamespacesSelectors(resource *schema.GroupVersionResource) []string

type ExcludeSelector

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

func NewExcludeSelector

func NewExcludeSelector(ns string) *ExcludeSelector

func (*ExcludeSelector) GetNamespacesSelectors

func (es *ExcludeSelector) GetNamespacesSelectors(resource *schema.GroupVersionResource) []string

type FileResourceHandler

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

FileResourceHandler handle resources from files and URLs

func NewFileResourceHandler

func NewFileResourceHandler(inputPatterns []string, registryAdaptors *RegistryAdaptors) *FileResourceHandler

func (*FileResourceHandler) GetClusterAPIServerInfo

func (fileHandler *FileResourceHandler) GetClusterAPIServerInfo() *version.Info

func (*FileResourceHandler) GetResources

type GitHubRepository

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

func NewGitHubRepository

func NewGitHubRepository() *GitHubRepository

type IFieldSelector

type IFieldSelector interface {
	GetNamespacesSelectors(*schema.GroupVersionResource) []string
}

type IRepository

type IRepository interface {
	// contains filtered or unexported methods
}

type IResourceHandler

type IResourceHandler interface {
	GetResources(*cautils.OPASessionObj, *armotypes.PortalDesignator) (*cautils.K8SResources, map[string]workloadinterface.IMetadata, *cautils.KSResources, error)
	GetClusterAPIServerInfo() *version.Info
}

type IncludeSelector

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

func NewIncludeSelector

func NewIncludeSelector(ns string) *IncludeSelector

func (*IncludeSelector) GetNamespacesSelectors

func (is *IncludeSelector) GetNamespacesSelectors(resource *schema.GroupVersionResource) []string

type K8sResourceHandler

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

func NewK8sResourceHandler

func NewK8sResourceHandler(k8s *k8sinterface.KubernetesApi, fieldSelector IFieldSelector, hostSensorHandler hostsensorutils.IHostSensor, rbacObjects *cautils.RBACObjects, registryAdaptors *RegistryAdaptors) *K8sResourceHandler

func (*K8sResourceHandler) GetClusterAPIServerInfo

func (k8sHandler *K8sResourceHandler) GetClusterAPIServerInfo() *version.Info

func (*K8sResourceHandler) GetResources

type RegistryAdaptors

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

func NewRegistryAdaptors

func NewRegistryAdaptors() (*RegistryAdaptors, error)

Jump to

Keyboard shortcuts

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