app

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 48 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 app implements the command-line interface. cmd/cipherhorizon/main.go is a thin shim over Main so that everything here is testable in-process, with the clock, serial number, hostname and output streams injected.

Index

Constants

View Source
const (
	ExitOK         = hostcmd.ExitOK         // success
	ExitFatal      = hostcmd.ExitFatal      // nothing was produced: bad usage, bad config, I/O error, interrupted
	ExitIncomplete = hostcmd.ExitIncomplete // a CBOM was written, but a sensor failed or a budget was hit
)

Exit codes.

View Source
const ExitPolicy = 3

ExitPolicy is the exit code when a --fail-on condition is met (PRD-007 REQ-CL-3): the scan ran, and the result is not acceptable. It is distinct from 1 (nothing could be done) and 2 (a result, but an incomplete one), so a CI step can tell the three apart.

View Source
const OneLiner = "" /* 183-byte string literal not displayed */

OneLiner says what the product is, the same words everywhere it introduces itself: --help, version, the container image's description, the README (PRD-007 REQ-ST-4).

View Source
const ScriptsSumsFile = "inventory-scripts.sha256"

ScriptsSumsFile is the name of the checksum list `scripts export` writes beside the scripts, in the format `sha256sum --check` reads. Releases ship it, covered by the signed checksums.

Variables

This section is empty.

Functions

func Main

func Main(ctx context.Context, args []string, env Env) int

Main runs the CLI and returns the process exit code.

Types

type Env

type Env struct {
	Stdin  io.Reader // "tls cbom --from -" reads it; nil means os.Stdin
	Stdout io.Writer // the CBOM goes here unless an output file is configured
	Stderr io.Writer // progress, warnings and the PQC summary

	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

	// Dial and LookupIP replace the network for "tls scan": how it connects and how it resolves
	// a name. nil means the real network. They exist for tests.
	Dial     func(ctx context.Context, network, addr string) (net.Conn, error)
	LookupIP func(ctx context.Context, host string) ([]net.IP, error)
}

Env carries everything Main needs from the outside world.

Jump to

Keyboard shortcuts

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