ingesters

package
v0.0.0-...-a2f2a9e Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisNetworkMapKey   = "network_map"
	RedisIPPortPIDMapKey = "ipportpid_map"
)

Variables

View Source
var (
	PushBack atomic.Int32
)

Functions

func AddBulkScan

func AddBulkScan(ctx context.Context, tx neo4j.ExplicitTransaction, scanType utils.Neo4jScanType, bulkScanID string, scanIDs []string) error

func AddNewCloudComplianceScan

func AddNewCloudComplianceScan(
	ctx context.Context,
	tx neo4j.ExplicitTransaction,
	scanID string,
	benchmarkTypes []string,
	nodeID string,
	nodeType string,
	isPriority bool) error

func AddNewScan

func AddNewScan(ctx context.Context,
	tx neo4j.ExplicitTransaction,
	scanType utils.Neo4jScanType,
	scanID string,
	nodeType controls.ScanResource,
	nodeID string,
	isPriority bool,
	action controls.Action,
	deepfenceSystemScan bool) error

func FetchPushBack

func FetchPushBack(ctx context.Context) int32

func GetActiveCloudControls

func GetActiveCloudControls(ctx context.Context, tx neo4j.ExplicitTransaction, complianceTypes []string,
	cloudProvider string) ([]controls.CloudComplianceScanBenchmark, error)

func GetPushBack

func GetPushBack(ctx context.Context, driver neo4j.DriverWithContext) (int32, error)

func UpdatePushBack

func UpdatePushBack(ctx context.Context, newValue *atomic.Int32, prev int32) error

TODO: improve syncro across multiple servers

func UpdateScanStatus

func UpdateScanStatus(ctx context.Context, scanType string, scanID string, status, message string) error

Types

type AgentNotInstalledError

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

func (*AgentNotInstalledError) Error

func (ve *AgentNotInstalledError) Error() string

type AlreadyRunningScanError

type AlreadyRunningScanError struct {
	ScanID   string
	ScanType string
	// contains filtered or unexported fields
}

func (*AlreadyRunningScanError) Error

func (ve *AlreadyRunningScanError) Error() string

type CacheEntry

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

type CloudComplianceIngester

type CloudComplianceIngester struct{}

func (*CloudComplianceIngester) Ingest

func (tc *CloudComplianceIngester) Ingest(
	ctx context.Context,
	cs []ingestersUtil.CloudCompliance,
	ingestC chan *kgo.Record,
) error

type CloudComplianceScanStatusIngester

type CloudComplianceScanStatusIngester struct{}

func (*CloudComplianceScanStatusIngester) Ingest

type CloudResourceIngester

type CloudResourceIngester struct{}

func (*CloudResourceIngester) Ingest

func (tc *CloudResourceIngester) Ingest(
	ctx context.Context,
	cs []ingestersUtil.CloudResource,
	ingestC chan *kgo.Record,
) error

type ComplianceIngester

type ComplianceIngester struct{}

func (*ComplianceIngester) Ingest

func (tc *ComplianceIngester) Ingest(
	ctx context.Context,
	cs []ingestersUtil.Compliance,
	ingestC chan *kgo.Record,
) error

type ComplianceScanStatusIngester

type ComplianceScanStatusIngester struct{}

func (*ComplianceScanStatusIngester) Ingest

type Connection

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

type DeepfenceSystemScanError

type DeepfenceSystemScanError struct {
	NodeID string
}

func (*DeepfenceSystemScanError) Error

func (ve *DeepfenceSystemScanError) Error() string

type EndpointResolvers

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

type EndpointResolversCache

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

func (*EndpointResolversCache) Close

func (erc *EndpointResolversCache) Close()

type Ingester

type Ingester[T any] interface {
	Ingest(ctx context.Context, data T) error
	IsReady() bool
	// TOREMOVE
	PushToDB(ctx context.Context, batches ReportIngestionData, session neo4j.SessionWithContext) error
	Close()
}

func NewNeo4jCollector

func NewNeo4jCollector(ctx context.Context) (Ingester[report.CompressedReport], error)

type KafkaIngester

type KafkaIngester[T any] interface {
	Ingest(ctx context.Context, data T, ingestChan chan *kgo.Record) error
}

func NewCloudComplianceIngester

func NewCloudComplianceIngester() KafkaIngester[[]ingestersUtil.CloudCompliance]

func NewCloudResourceIngester

func NewCloudResourceIngester() KafkaIngester[[]ingestersUtil.CloudResource]

func NewComplianceIngester

func NewComplianceIngester() KafkaIngester[[]ingestersUtil.Compliance]

func NewComplianceScanStatusIngester

func NewComplianceScanStatusIngester() KafkaIngester[[]ingestersUtil.ComplianceScanStatus]

func NewMalwareIngester

func NewMalwareIngester() KafkaIngester[[]map[string]interface{}]

func NewMalwareScanStatusIngester

func NewMalwareScanStatusIngester() KafkaIngester[[]ingestersUtil.MalwareScanStatus]

func NewSecretIngester

func NewSecretIngester() KafkaIngester[[]map[string]interface{}]

func NewSecretScanStatusIngester

func NewSecretScanStatusIngester() KafkaIngester[[]ingestersUtil.SecretScanStatus]

func NewVulnerabilityIngester

func NewVulnerabilityIngester() KafkaIngester[[]ingestersUtil.Vulnerability]

type MalwareIngester

type MalwareIngester struct{}

func (*MalwareIngester) Ingest

func (tc *MalwareIngester) Ingest(
	ctx context.Context,
	cs []map[string]interface{},
	ingestC chan *kgo.Record,
) error

type MalwareScanStatusIngester

type MalwareScanStatusIngester struct{}

func (*MalwareScanStatusIngester) Ingest

func (tc *MalwareScanStatusIngester) Ingest(
	ctx context.Context,
	statuses []ingestersUtil.MalwareScanStatus,
	ingestC chan *kgo.Record,
) error

type NodeNotActiveError

type NodeNotActiveError struct {
	NodeID string
}

func (*NodeNotActiveError) Error

func (ve *NodeNotActiveError) Error() string

type NodeNotFoundError

type NodeNotFoundError struct {
	NodeID string
}

func (*NodeNotFoundError) Error

func (ve *NodeNotFoundError) Error() string

type RegisterKubernetesScannerRequest

type RegisterKubernetesScannerRequest struct {
	NodeID                string `json:"node_id"`
	KubernetesClusterName string `json:"kubernetes_cluster_name"`
}

type ReportIngestionData

type ReportIngestionData struct {
	ProcessBatch           []map[string]interface{} `json:"process_batch" required:"true"`
	HostBatch              []map[string]interface{} `json:"host_batch" required:"true"`
	ContainerBatch         []map[string]interface{} `json:"container_batch" required:"true"`
	PodBatch               []map[string]interface{} `json:"pod_batch" required:"true"`
	ContainerImageBatch    []map[string]interface{} `json:"container_image_batch" required:"true"`
	KubernetesClusterBatch []map[string]interface{} `json:"kubernetes_cluster_batch" required:"true"`

	ProcessEdgesBatch          []map[string]interface{} `json:"process_edges_batch" required:"true"`
	ContainerEdgesBatch        []map[string]interface{} `json:"container_edges_batch" required:"true"`
	ContainerProcessEdgesBatch []map[string]interface{} `json:"container_process_edge_batch" required:"true"`
	PodEdgesBatch              []map[string]interface{} `json:"pod_edges_batch" required:"true"`
	PodHostEdgesBatch          []map[string]interface{} `json:"pod_host_edges_batch" required:"true"`
	EndpointEdgesBatch         []map[string]interface{} `json:"endpoint_edges_batch" required:"true"`
	ContainerImageEdgeBatch    []map[string]interface{} `json:"container_image_edge_batch" required:"true"`
	KubernetesClusterEdgeBatch []map[string]interface{} `json:"kubernetes_cluster_edge_batch" required:"true"`

	Hosts     []map[string]interface{} `json:"hosts" required:"true"`
	NumMerged int                      `json:"num_merged" required:"true"`
	Retries   int
}

func NewReportIngestionData

func NewReportIngestionData() ReportIngestionData

type SecretIngester

type SecretIngester struct{}

func (*SecretIngester) Ingest

func (tc *SecretIngester) Ingest(
	ctx context.Context,
	cs []map[string]interface{},
	ingestC chan *kgo.Record,
) error

type SecretScanStatusIngester

type SecretScanStatusIngester struct{}

func (*SecretScanStatusIngester) Ingest

func (tc *SecretScanStatusIngester) Ingest(
	ctx context.Context,
	statuses []ingestersUtil.SecretScanStatus,
	ingestC chan *kgo.Record,
) error

type VulnerabilityIngester

type VulnerabilityIngester struct{}

func (*VulnerabilityIngester) Ingest

func (tc *VulnerabilityIngester) Ingest(
	ctx context.Context,
	cs []ingestersUtil.Vulnerability,
	ingestC chan *kgo.Record,
) error

type VulnerabilityStatusIngester

type VulnerabilityStatusIngester struct{}

func (*VulnerabilityStatusIngester) Ingest

func (tc *VulnerabilityStatusIngester) Ingest(
	ctx context.Context,
	statuses []ingestersUtil.VulnerabilityScanStatus,
	ingestC chan *kgo.Record,
) error

Jump to

Keyboard shortcuts

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