Documentation
¶
Overview ¶
Package hostcmd implements the host-inventory command line: `run`, `plugins` and `version`. It is shared by two programs:
- cmd/cipherhorizon-collector, the small program to deploy on endpoints. It links only this package's dependencies: no web server, no database, no TLS scanner;
- cmd/cipherhorizon, the full product, whose `run` command is this same code.
Keeping it in its own package is what lets the collector stay small and auditable (internal/archtest fails the build if the collector links the server, the store or the scanner).
Index ¶
Constants ¶
const ( ExitOK = 0 // success ExitFatal = 1 // nothing was produced: bad usage, bad config, I/O error, interrupted ExitIncomplete = 2 // a CBOM was written, but a sensor failed or a budget was hit )
Exit codes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Stdout io.Writer // the CBOM goes here unless an output file is configured
Stderr io.Writer // progress, warnings and the PQC summary
// Prog is the program name used in messages ("cipherhorizon" by default).
Prog string
Registry *sense.Registry // nil means sense.Default
Now func() time.Time // nil means time.Now
NewSerial func() string // nil means a random UUID
Hostname func() (string, error)
// OS is the host's operating system family, "linux" or "windows"; empty means
// this process's own. Tier reports the privilege of the run ("user" or
// "admin"); nil means the process's real privilege. Both exist so tests are
// deterministic on any machine.
OS string
Tier func() string
}
Env carries everything the commands need from the outside world.