reporters_search

package
v0.0.0-...-c736c87 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountAllNodeLabels

func CountAllNodeLabels(ctx context.Context) (map[string]int64, error)

func SearchReport

func SearchReport[T reporters.Cypherable](ctx context.Context, filter SearchFilter, extendedFilter SearchFilter, indirectFilter *ChainedSearchFilter, fw model.FetchWindow) ([]T, error)

func SearchScansReport

func SearchScansReport(ctx context.Context, filter SearchScanReq, scanType utils.Neo4jScanType) ([]model.ScanInfo, error)

Types

type ChainedSearchFilter

type ChainedSearchFilter struct {
	NodeFilter   SearchFilter         `json:"node_filter" required:"true"`
	RelationShip string               `json:"relation_ship" required:"true"`
	NextFilter   *ChainedSearchFilter `json:"next_filter"`
}

type FakeCypher

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

func (FakeCypher) ExtendedField

func (fc FakeCypher) ExtendedField() string

func (FakeCypher) NodeType

func (fc FakeCypher) NodeType() string

type NodeCountResp

type NodeCountResp struct {
	CloudProviders    int64 `json:"cloud_provider" required:"true"`
	Host              int64 `json:"host" required:"true"`
	Container         int64 `json:"container" required:"true"`
	ContainerImage    int64 `json:"container_image" required:"true"`
	Pod               int64 `json:"pod" required:"true"`
	KubernetesCluster int64 `json:"kubernetes_cluster" required:"true"`
	Namespace         int64 `json:"namespace" required:"true"`
}

func CountNodes

func CountNodes(ctx context.Context) (NodeCountResp, error)

type ResultGroup

type ResultGroup struct {
	Name     string `json:"name"`
	Count    int64  `json:"count"`
	Severity string `json:"severity"`
}

type ResultGroupResp

type ResultGroupResp struct {
	Groups []ResultGroup `json:"groups"`
}

type SearchCountResp

type SearchCountResp struct {
	Count      int              `json:"count" required:"true"`
	Categories map[string]int32 `json:"categories" required:"true"`
}

type SearchFilter

type SearchFilter struct {
	InFieldFilter []string                `json:"in_field_filter" required:"true"` // Fields to return
	Filters       reporters.FieldsFilters `json:"filters" required:"true"`
	Window        model.FetchWindow       `json:"window" required:"true"`
}

If no nodeIds are provided, will return all If no field are provided, will return all fields. (Fields can only be top level since neo4j does not support nested fields)

type SearchNodeReq

type SearchNodeReq struct {
	NodeFilter         SearchFilter         `json:"node_filter" required:"true"`
	ExtendedNodeFilter SearchFilter         `json:"extended_node_filter"`
	IndirectFilters    *ChainedSearchFilter `json:"related_node_filter"`
	Window             model.FetchWindow    `json:"window" required:"true"`
}

type SearchScanReq

type SearchScanReq struct {
	ScanFilter          SearchFilter         `json:"scan_filters" required:"true"`
	NodeFilter          SearchFilter         `json:"node_filters" required:"true"`
	NodeIndirectFilters *ChainedSearchFilter `json:"related_node_filter"`
	Window              model.FetchWindow    `json:"window" required:"true"`
}

Jump to

Keyboard shortcuts

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