Documentation
¶
Overview ¶
Package config loads the YAML configuration file.
Every key is optional: an empty or absent file yields Default. Unknown keys are an error, so that a typo such as `disable:` for `disabled:` is caught instead of silently running the plugin the operator meant to switch off.
Index ¶
Constants ¶
const DefaultSpec = "1.7"
DefaultSpec is the CycloneDX version written unless configured otherwise.
Variables ¶
This section is empty.
Functions ¶
func DefaultRoot ¶
func DefaultRoot() string
DefaultRoot is where the host's filesystem is visible by default: "/" on Unix, and the system drive on Windows (a bare "/" there would mean whichever drive the working directory happens to be on).
Types ¶
type Config ¶
type Config struct {
Output Output `yaml:"output"`
Host Host `yaml:"host"`
Plugins Plugins `yaml:"plugins"`
PQC PQC `yaml:"pqc"`
}
Config is the whole configuration.
func Default ¶
func Default() Config
Default returns the configuration used when nothing is specified.
type Host ¶
type Host struct {
// Root is the directory the host's filesystem is visible under: "/" natively,
// "/host" in a container with the host mounted.
Root string `yaml:"root"`
// Name overrides the hostname recorded as the CBOM's subject.
Name string `yaml:"name"`
// Redact replaces the host name with a stable label derived from the machine
// id, so the CBOM does not carry the name. See docs/decisions/ADR-0009.
Redact bool `yaml:"redact"`
}
Host describes the machine being scanned.
type Output ¶
type Output struct {
// Path is the file to write, atomically. Empty means standard output.
Path string `yaml:"path"`
// Pretty indents the JSON.
Pretty bool `yaml:"pretty"`
// Spec is the CycloneDX version written: "1.7" (the default) or "1.6" for consumers that have
// not moved to 1.7.
Spec string `yaml:"spec"`
}
Output controls where the CBOM goes.
type PQC ¶
type PQC struct {
Enabled bool `yaml:"enabled"`
}
PQC controls post-quantum risk annotation.
type Plugins ¶
type Plugins struct {
// Enabled restricts the run to these sensors; empty means every registered one.
Enabled []string `yaml:"enabled"`
// Disabled removes sensors from the run.
Disabled []string `yaml:"disabled"`
// Timeout bounds each sensor (Detect plus Collect); 0 disables the bound.
Timeout time.Duration `yaml:"timeout"`
}
Plugins selects and bounds sensors. (The section keeps its historical name so existing configuration files keep working.)