Documentation ¶
Index ¶
- Constants
- type CleanupFunc
- type ClusterRoleBindingIngest
- func (i *ClusterRoleBindingIngest) Close(ctx context.Context) error
- func (i *ClusterRoleBindingIngest) Complete(ctx context.Context) error
- func (i *ClusterRoleBindingIngest) IngestClusterRoleBinding(ctx context.Context, crb types.ClusterRoleBindingType) error
- func (i *ClusterRoleBindingIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *ClusterRoleBindingIngest) Name() string
- func (i *ClusterRoleBindingIngest) Run(ctx context.Context) error
- type ClusterRoleIngest
- func (i *ClusterRoleIngest) Close(ctx context.Context) error
- func (i *ClusterRoleIngest) Complete(ctx context.Context) error
- func (i *ClusterRoleIngest) IngestClusterRole(ctx context.Context, role types.ClusterRoleType) error
- func (i *ClusterRoleIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *ClusterRoleIngest) Name() string
- func (i *ClusterRoleIngest) Run(ctx context.Context) error
- type Dependencies
- type EndpointIngest
- func (i *EndpointIngest) Close(ctx context.Context) error
- func (i *EndpointIngest) Complete(ctx context.Context) error
- func (i *EndpointIngest) IngestEndpoint(ctx context.Context, eps types.EndpointType) error
- func (i *EndpointIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *EndpointIngest) Name() string
- func (i *EndpointIngest) Run(ctx context.Context) error
- type FlushFunc
- type Group
- type IngestResourceOption
- type IngestResources
- type NodeIngest
- func (i *NodeIngest) Close(ctx context.Context) error
- func (i *NodeIngest) Complete(ctx context.Context) error
- func (i *NodeIngest) IngestNode(ctx context.Context, node types.NodeType) error
- func (i *NodeIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *NodeIngest) Name() string
- func (i *NodeIngest) Run(ctx context.Context) error
- type ObjectIngest
- type PodIngest
- func (i *PodIngest) Close(ctx context.Context) error
- func (i *PodIngest) Complete(ctx context.Context) error
- func (i *PodIngest) IngestPod(ctx context.Context, pod types.PodType) error
- func (i *PodIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *PodIngest) Name() string
- func (i *PodIngest) Run(ctx context.Context) error
- type RoleBindingIngest
- func (i *RoleBindingIngest) Close(ctx context.Context) error
- func (i *RoleBindingIngest) Complete(ctx context.Context) error
- func (i *RoleBindingIngest) IngestRoleBinding(ctx context.Context, rb types.RoleBindingType) error
- func (i *RoleBindingIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *RoleBindingIngest) Name() string
- func (i *RoleBindingIngest) Run(ctx context.Context) error
- type RoleIngest
- func (i *RoleIngest) Close(ctx context.Context) error
- func (i *RoleIngest) Complete(ctx context.Context) error
- func (i *RoleIngest) IngestRole(ctx context.Context, role types.RoleType) error
- func (i *RoleIngest) Initialize(ctx context.Context, deps *Dependencies) error
- func (i *RoleIngest) Name() string
- func (i *RoleIngest) Run(ctx context.Context) error
- type Sequence
Constants ¶
const (
ClusterRoleBindingIngestName = "k8s-cluster-role-binding-ingest"
)
const (
ClusterRoleIngestName = "k8s-cluster-role-ingest"
)
const (
EndpointIngestName = "k8s-endpoint-ingest"
)
const (
NodeIngestName = "k8s-node-ingest"
)
const (
PodIngestName = "k8s-pod-ingest"
)
const (
RoleBindingIngestName = "k8s-role-binding-ingest"
)
const (
RoleIngestName = "k8s-role-ingest"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanupFunc ¶
CleanupFunc is a callback to be registered in the cleanup array.
type ClusterRoleBindingIngest ¶
type ClusterRoleBindingIngest struct {
// contains filtered or unexported fields
}
func (*ClusterRoleBindingIngest) Close ¶
func (i *ClusterRoleBindingIngest) Close(ctx context.Context) error
func (*ClusterRoleBindingIngest) Complete ¶
func (i *ClusterRoleBindingIngest) Complete(ctx context.Context) error
completeCallback is invoked by the collector when all roles have been streamed. The function flushes all writers and waits for completion.
func (*ClusterRoleBindingIngest) IngestClusterRoleBinding ¶
func (i *ClusterRoleBindingIngest) IngestClusterRoleBinding(ctx context.Context, crb types.ClusterRoleBindingType) error
streamCallback is invoked by the collector for each cluster role binding collected. The function ingests an input cluster role binding object into the store/graph and then ingests all child objects (identites, etc) through their own ingestion pipeline.
func (*ClusterRoleBindingIngest) Initialize ¶
func (i *ClusterRoleBindingIngest) Initialize(ctx context.Context, deps *Dependencies) error
func (*ClusterRoleBindingIngest) Name ¶
func (i *ClusterRoleBindingIngest) Name() string
type ClusterRoleIngest ¶
type ClusterRoleIngest struct {
// contains filtered or unexported fields
}
func (*ClusterRoleIngest) Complete ¶
func (i *ClusterRoleIngest) Complete(ctx context.Context) error
completeCallback is invoked by the collector when all cluster roles have been streamed. The function flushes all writers and waits for completion.
func (*ClusterRoleIngest) IngestClusterRole ¶
func (i *ClusterRoleIngest) IngestClusterRole(ctx context.Context, role types.ClusterRoleType) error
streamCallback is invoked by the collector for each cluster role collected. The function ingests an input cluster role into the cache/store/graph databases asynchronously.
func (*ClusterRoleIngest) Initialize ¶
func (i *ClusterRoleIngest) Initialize(ctx context.Context, deps *Dependencies) error
func (*ClusterRoleIngest) Name ¶
func (i *ClusterRoleIngest) Name() string
type Dependencies ¶
type Dependencies struct { Config *config.KubehoundConfig Collector collector.CollectorClient Cache cache.CacheProvider StoreDB storedb.Provider GraphDB graphdb.Provider }
Dependencies encapsulates all of the ingest pipeline dependencies (initialized).
type EndpointIngest ¶
type EndpointIngest struct {
// contains filtered or unexported fields
}
func (*EndpointIngest) Complete ¶
func (i *EndpointIngest) Complete(ctx context.Context) error
Complete is invoked by the collector when all nodes have been streamed. The function flushes all writers and waits for completion.
func (*EndpointIngest) IngestEndpoint ¶
func (i *EndpointIngest) IngestEndpoint(ctx context.Context, eps types.EndpointType) error
IngestEndpoint is invoked by the collector for each endpoint slice collected. The function ingests an input endpoint slice into the cache/store/graph databases asynchronously.
func (*EndpointIngest) Initialize ¶
func (i *EndpointIngest) Initialize(ctx context.Context, deps *Dependencies) error
func (*EndpointIngest) Name ¶
func (i *EndpointIngest) Name() string
type Group ¶
type Group struct { Name string // Name of the ingest group Ingests []ObjectIngest // Parallelized object ingest pipelines }
Group encapsulates a collection of object ingest pipelines that can be run in parallel.s
type IngestResourceOption ¶
type IngestResourceOption func(ctx context.Context, oic *resourceOptions, deps *Dependencies) error
IngestResourceOption enables options to be passed to the pipeline initializer.
func WithCacheReader ¶
func WithCacheReader() IngestResourceOption
WithCacheReader initializes a cache reader (and registers a cleanup function to close the connection) for the ingest pipeline.
func WithCacheWriter ¶
func WithCacheWriter(opts ...cache.WriterOption) IngestResourceOption
WithCacheWriter initializes a cache writer (and registers a cleanup function) for the ingest pipeline.
func WithConverterCache ¶
func WithConverterCache() IngestResourceOption
WithCacheWriter initializes a store converter with cache access for the ingest pipeline.
func WithGraphWriter ¶
func WithGraphWriter(v vertex.Builder) IngestResourceOption
WithStoreWriter initializes a bulk graph writer (and registers a cleanup function) for the provided vertex. To access the writer use the graphWriter(v vertex.Vertex) function.
func WithStoreWriter ¶
func WithStoreWriter[T collections.Collection](c T) IngestResourceOption
WithStoreWriter initializes a bulk store writer (and registers a cleanup function) for the provided collection. To access the writer use the storeWriter(c collections.Collection) function.
type IngestResources ¶
type IngestResources struct {
// contains filtered or unexported fields
}
IngestResources provides the base functionality (service initialization, flush and cleanup) for any object ingest pipeline.
func CreateResources ¶
func CreateResources(ctx context.Context, deps *Dependencies, opts ...IngestResourceOption) (*IngestResources, error)
CreateResources handles the base initialization of service dependencies for an object ingest pipeline. This should be called from the ObjectIngest::Initialize function.
type NodeIngest ¶
type NodeIngest struct {
// contains filtered or unexported fields
}
func (*NodeIngest) Complete ¶
func (i *NodeIngest) Complete(ctx context.Context) error
completeCallback is invoked by the collector when all nodes have been streamed. The function flushes all writers and waits for completion.
func (*NodeIngest) IngestNode ¶
streamCallback is invoked by the collector for each node collected. The function ingests an input node into the cache/store/graph databases asynchronously.
func (*NodeIngest) Initialize ¶
func (i *NodeIngest) Initialize(ctx context.Context, deps *Dependencies) error
func (*NodeIngest) Name ¶
func (i *NodeIngest) Name() string
type ObjectIngest ¶
type ObjectIngest interface { // Name returns the name of the object ingest pipeline. Name() string // Initialize intializes an object ingest pipeline with any servic dependencies. Initialize(ctx context.Context, deps *Dependencies) error // Run executes the ingest pipeline, returning when all are complete. Run(ctx context.Context) error // Close cleans up any resources held in the ingest pipeline on completion/error. Close(ctx context.Context) error }
ObjectIngest represents an ingestion pipeline that receives an input object from a collector implementation, processes and persists all resulting KubeHound objects (store models, cache entries, graph vertices, etc).
type PodIngest ¶
type PodIngest struct {
// contains filtered or unexported fields
}
func (*PodIngest) Complete ¶
completeCallback is invoked by the collector when all pods have been streamed. The function flushes all writers and waits for completion.
func (*PodIngest) IngestPod ¶
streamCallback is invoked by the collector for each pod collected. The function ingests an input pod object into the cache/store/graph and then ingests all child objects (containers, volumes, etc) through their own ingestion pipeline.
func (*PodIngest) Initialize ¶
func (i *PodIngest) Initialize(ctx context.Context, deps *Dependencies) error
type RoleBindingIngest ¶
type RoleBindingIngest struct {
// contains filtered or unexported fields
}
func (*RoleBindingIngest) Complete ¶
func (i *RoleBindingIngest) Complete(ctx context.Context) error
completeCallback is invoked by the collector when all roles have been streamed. The function flushes all writers and waits for completion.
func (*RoleBindingIngest) IngestRoleBinding ¶
func (i *RoleBindingIngest) IngestRoleBinding(ctx context.Context, rb types.RoleBindingType) error
streamCallback is invoked by the collector for each role binding collected. The function ingests an input role binding object into the store/graph and then ingests all child objects (identites, etc) through their own ingestion pipeline.
func (*RoleBindingIngest) Initialize ¶
func (i *RoleBindingIngest) Initialize(ctx context.Context, deps *Dependencies) error
func (*RoleBindingIngest) Name ¶
func (i *RoleBindingIngest) Name() string
type RoleIngest ¶
type RoleIngest struct {
// contains filtered or unexported fields
}
func (*RoleIngest) Complete ¶
func (i *RoleIngest) Complete(ctx context.Context) error
completeCallback is invoked by the collector when all roles have been streamed. The function flushes all writers and waits for completion.
func (*RoleIngest) IngestRole ¶
streamCallback is invoked by the collector for each role collected. The function ingests an input role into the cache/store/graph databases asynchronously.
func (*RoleIngest) Initialize ¶
func (i *RoleIngest) Initialize(ctx context.Context, deps *Dependencies) error
func (*RoleIngest) Name ¶
func (i *RoleIngest) Name() string