controls

package
v0.0.0-...-a87dae0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotEnoughRoomError = errors.New("Not enough room")
)

Functions

func GetBinArgs

func GetBinArgs(T interface{}) map[string]string

func ResourceTypeToNeo4j

func ResourceTypeToNeo4j(t ScanResource) string

func ResourceTypeToString

func ResourceTypeToString(t ScanResource) string

Types

type Action

type Action struct {
	ID             ActionID `json:"id" required:"true"`
	RequestPayload string   `json:"request_payload" required:"true"`
}

type ActionID

type ActionID int
const (
	StartVulnerabilityScan ActionID = iota
	StartSecretScan
	StartComplianceScan
	StartMalwareScan
	StartAgentUpgrade
	SendAgentDiagnosticLogs
	StartAgentPlugin
	StopAgentPlugin
	UpgradeAgentPlugin
	StopSecretScan
	StopMalwareScan
	StopVulnerabilityScan
	StopComplianceScan
)

type AgentBeat

type AgentBeat struct {
	BeatRateSec int32 `json:"beatrate" required:"true"`
}

type AgentControls

type AgentControls struct {
	BeatRateSec int32    `json:"beatrate" required:"true"`
	Commands    []Action `json:"commands" required:"true"`
}

func (AgentControls) ToBytes

func (ac AgentControls) ToBytes() ([]byte, error)

type DisableAgentPluginRequest

type DisableAgentPluginRequest struct {
	PluginName string `json:"plugin_name" required:"true"`
}

type EnableAgentPluginRequest

type EnableAgentPluginRequest struct {
	PluginName string `json:"plugin_name" required:"true"`
	Version    string `json:"version" required:"true"`
	BinUrl     string `json:"bin_url" required:"true"`
}

type ScanResource

type ScanResource int
const (
	Container ScanResource = iota
	Image
	Host
	CloudAccount
	KubernetesCluster
	RegistryAccount
	Pod
)

func StringToResourceType

func StringToResourceType(s string) ScanResource

type SendAgentDiagnosticLogsRequest

type SendAgentDiagnosticLogsRequest struct {
	NodeId    string       `json:"node_id" required:"true"`
	NodeType  ScanResource `json:"node_type" required:"true"`
	UploadURL string       `json:"upload_url" required:"true"`
	FileName  string       `json:"file_name" required:"true"`
	Tail      string       `json:"tail" required:"true"`
}

type StartAgentUpgradeRequest

type StartAgentUpgradeRequest struct {
	HomeDirectoryUrl string `json:"home_directory_url" required:"true"`
	Version          string `json:"version" required:"true"`
}

type StartComplianceScanRequest

type StartComplianceScanRequest struct {
	NodeId   string            `json:"node_id" required:"true"`
	NodeType ScanResource      `json:"node_type" required:"true"`
	BinArgs  map[string]string `json:"bin_args" required:"true"`
}

type StartMalwareScanRequest

type StartMalwareScanRequest struct {
	NodeId   string            `json:"node_id" required:"true"`
	NodeType ScanResource      `json:"node_type" required:"true"`
	BinArgs  map[string]string `json:"bin_args" required:"true"`
}

type StartSecretScanRequest

type StartSecretScanRequest struct {
	NodeId   string            `json:"node_id" required:"true"`
	NodeType ScanResource      `json:"node_type" required:"true"`
	BinArgs  map[string]string `json:"bin_args" required:"true"`
}

type StartVulnerabilityScanRequest

type StartVulnerabilityScanRequest struct {
	NodeId   string            `json:"node_id" required:"true"`
	NodeType ScanResource      `json:"node_type" required:"true"`
	BinArgs  map[string]string `json:"bin_args" required:"true"`
}

type StopComplianceScanRequest

type StopComplianceScanRequest StartSecretScanRequest

type StopMalwareScanRequest

type StopMalwareScanRequest StartSecretScanRequest

type StopSecretScanRequest

type StopSecretScanRequest StartSecretScanRequest

type StopVulnerabilityScanRequest

type StopVulnerabilityScanRequest StartSecretScanRequest

type WorkloadAllocator

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

func NewWorkloadAllocator

func NewWorkloadAllocator(maxWorkload int32) *WorkloadAllocator

func (*WorkloadAllocator) Free

func (wa *WorkloadAllocator) Free()

func (*WorkloadAllocator) MaxAllocable

func (wa *WorkloadAllocator) MaxAllocable() int32

func (*WorkloadAllocator) Reserve

func (wa *WorkloadAllocator) Reserve(delta int32)

Jump to

Keyboard shortcuts

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