Documentation
¶
Overview ¶
Package tools describes the external command-line scanners Draugr orchestrates and detects whether they are installed. It backs `draugr doctor` — an explicit preflight so a missing tool is reported up front with an install hint, instead of surfacing as a buried "executable file not found" error mid-scan.
Detection only ever reads the environment (looks on PATH, runs a version probe). It never downloads or installs anything — provisioning is a separate, opt-in step.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Catalog ¶
Catalog returns the external tools Draugr's built-in scanners use, keyed by binary name. Several scanners share one binary (trivy backs images, sca, and iac), so the catalog is keyed by the binary rather than the scanner.
func Installable ¶ added in v0.8.0
func Installable() []string
Installable returns the names of the tools `tools install` can provision, sorted.
func SemgrepPipxCommand ¶ added in v0.8.0
func SemgrepPipxCommand() string
SemgrepPipxCommand returns the recommended pinned install command for Semgrep, which is a Python package rather than a standalone binary.
func SemgrepVersion ¶ added in v0.8.0
func SemgrepVersion() string
SemgrepVersion is the pinned Semgrep version.
Types ¶
type Asset ¶ added in v0.8.0
type Asset struct {
URL string
SHA256 string
BinaryInArchive string // name of the binary within the .tar.gz
}
Asset is one platform's download for an installable tool.
type InstallSpec ¶ added in v0.8.0
InstallSpec pins an installable tool to a version and its per-platform assets, keyed by "GOOS/GOARCH" (e.g. "linux/amd64").
func Spec ¶ added in v0.8.0
func Spec(name string) (InstallSpec, bool)
Spec returns the pinned install spec for a tool.
type Installed ¶ added in v0.8.0
Installed describes a successfully provisioned tool.
type LookPathFunc ¶
LookPathFunc resolves a binary name to a path (defaults to exec.LookPath).
type Status ¶
type Status struct {
Tool Tool
Found bool
Path string
Version string
// Err is set when the tool was found but the version probe failed (non-fatal).
Err error
}
Status is the outcome of detecting a Tool.
type Tool ¶
type Tool struct {
// Binary is the executable name looked up on PATH, e.g. "trivy".
Binary string
// VersionArgs prints the tool's version, e.g. ["--version"]. Empty skips the probe.
VersionArgs []string
// InstallHint tells the user how or where to install the tool when it's missing.
InstallHint string
}
Tool describes an external executable a scanner shells out to.