discover

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package discover runs the host discovery pipeline end to end:

sensors -> evidence graph -> derived capability

and returns the graph. Turning the graph into a CBOM is the cbom package's job; this package never touches CycloneDX, and never touches the operating system itself: sensors do, through sense.Env.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrivilegeNote

func PrivilegeNote(tier string, denied int) string

PrivilegeNote is the warning for a run below the highest privilege tier: full results may need Administrator (Windows) or root (Linux). It is empty at admin. When the run counted locations it could not read, it says how many.

Types

type Options

type Options struct {
	FS       fs.FS  // the host's root filesystem
	OS       string // the host's OS family: "linux" or "windows"
	Tier     string // the privilege tier of this run: "user" or "admin"
	HostName string // the host name to record
	// Live says FS is this machine's own root, so sensors that ask the operating
	// system may run. It must be false for any other root.
	Live bool

	// RedactHost replaces the host name with a stable label derived from the
	// platform machine id (ADR-0009). The run fails if no machine id is available,
	// rather than emit an unstable label.
	RedactHost bool

	Enabled  []string
	Disabled []string
	Timeout  time.Duration
}

Options configures a discovery run.

type Result

type Result struct {
	Graph *evidence.Graph
	Run   sense.Result
	// PrivilegeNote is the warning to show when the run had less than the highest
	// privilege tier; empty at admin.
	PrivilegeNote string
}

Result is the outcome of a discovery run.

func Run

func Run(ctx context.Context, reg *sense.Registry, o Options) (*Result, error)

Run drives the sensors, normalises their evidence into a graph and derives capability. It returns an error only for a request that cannot be honoured or a sensor that broke the evidence contract (a bug, not a partial result).

Jump to

Keyboard shortcuts

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