controls

package
v0.0.0-...-dd46dfa Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 13

Documentation

Index

Constants

View Source
const (
	CLOUD_AGENT = "cloud_agent"
	K8S         = "k8s"
	HOST        = "host"
)
View Source
const ContextAllocatorKey = "scan-workload-allocator"

Variables

View Source
var ErrCtxAllocatorNotFound = errors.New("error allocator context key not found")
View Source
var ErrNotEnoughRoom = 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

	UpdateAgentThreatIntel
	RefreshResources
	StartCloudComplianceScan
	StopCloudComplianceScan
	CloudScannerJobCount
	CloudScannerResourceRefreshCount
)

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 CloudComplianceScanBenchmark

type CloudComplianceScanBenchmark struct {
	Id             string   `json:"id" required:"true"`
	ComplianceType string   `json:"compliance_type" required:"true"`
	Controls       []string `json:"controls" required:"true"`
}

type CloudComplianceScanDetails

type CloudComplianceScanDetails struct {
	ScanId     string                         `json:"scan_id" required:"true"`
	AccountId  string                         `json:"account_id" required:"true"`
	ScanTypes  []string                       `json:"scan_types" required:"true"`
	Benchmarks []CloudComplianceScanBenchmark `json:"benchmarks" required:"true"`
}

type CloudScanNodeDetails

type CloudScanNodeDetails struct {
	AgentNodeId   string `json:"agent_node_id"`
	NodeName      string `json:"node_name"`
	CloudProvider string `json:"cloud_provider"`
}

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 RefreshResourcesRequest

type RefreshResourcesRequest struct {
	NodeId    string       `json:"node_id" required:"true"`
	AccountID string       `json:"account_id" required:"true"`
	NodeType  ScanResource `json:"node_type" 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 StartCloudComplianceScanRequest

type StartCloudComplianceScanRequest struct {
	NodeID      string                     `json:"node_id" required:"true"`
	NodeType    ScanResource               `json:"node_type" required:"true"`
	BinArgs     map[string]string          `json:"bin_args" required:"true"`
	ScanDetails CloudComplianceScanDetails `json:"scan_details" 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 StopCloudComplianceScanRequest

type StopCloudComplianceScanRequest StartSecretScanRequest

type StopComplianceScanRequest

type StopComplianceScanRequest StartSecretScanRequest

type StopMalwareScanRequest

type StopMalwareScanRequest StartSecretScanRequest

type StopSecretScanRequest

type StopSecretScanRequest StartSecretScanRequest

type StopVulnerabilityScanRequest

type StopVulnerabilityScanRequest StartSecretScanRequest

type ThreatIntelInfo

type ThreatIntelInfo struct {
	SecretsRulesURL          string `json:"secret_scanner_rules_url" required:"true"`
	SecretsRulesHash         string `json:"secret_scanner_rules_hash" required:"true"`
	MalwareRulesURL          string `json:"malware_scanner_rules_url" required:"true"`
	MalwareRulesHash         string `json:"malware_scanner_rules_hash" required:"true"`
	CloudPostureControlsURL  string `json:"cloud_posture_controls_url" required:"true"`
	CloudPostureControlsHash string `json:"cloud_posture_controls_hash" required:"true"`
	UpdatedAt                int64  `json:"updated_at" required:"true"`
}

func (ThreatIntelInfo) GetAction

func (ThreatIntelInfo) GetAction() ActionID

func (ThreatIntelInfo) GetLabel

func (ThreatIntelInfo) GetLabel() string

func (ThreatIntelInfo) GetNodeID

func (e ThreatIntelInfo) GetNodeID() string

func (ThreatIntelInfo) HasPolicies

func (e ThreatIntelInfo) HasPolicies() bool

func (ThreatIntelInfo) SetEmptyUpdatedAts

func (e ThreatIntelInfo) SetEmptyUpdatedAts(now time.Time) ThreatIntelInfo

func (ThreatIntelInfo) SetNodeID

func (e ThreatIntelInfo) SetNodeID(nodeID string) ThreatIntelInfo

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