Documentation
¶
Index ¶
- Constants
- Variables
- type AuditCmd
- type CLI
- type CPECmd
- type CVECmd
- type CVEOutput
- type Deps
- type HostAuditCmd
- type LinuxAuditCmd
- type OfflineCmd
- type OfflinePurgeCmd
- type OfflineStatusCmd
- type OfflineSyncCmd
- type ScanCmd
- type ScanDirCmd
- type ScanImageCmd
- type ScanOutput
- type ScanRepoCmd
- type ScanSBOMCmd
- type ScanSummary
- type SearchCmd
- type StixCmd
- type VersionCmd
- type VersionInfo
- type WinFullAuditCmd
- type WindowsAuditCmd
Constants ¶
const ( ExitOK = model.ExitOK ExitFindings = model.ExitFindings )
Re-export exit codes for use by main.go.
const ExitRuntimeError = model.ExitRuntimeError
Variables ¶
var ( Version = "dev" Commit = "none" Date = "unknown" )
Set via ldflags at build time.
Functions ¶
This section is empty.
Types ¶
type AuditCmd ¶
type AuditCmd struct {
Linux LinuxAuditCmd `cmd:"" help:"Audit Linux packages"`
Windows WindowsAuditCmd `cmd:"" help:"Audit Windows KB updates"`
Host HostAuditCmd `cmd:"" help:"Audit host packages (v4 API)"`
Winaudit WinFullAuditCmd `cmd:"" name:"winaudit" help:"Full Windows audit (KBs + software)"`
}
AuditCmd is the command group for OS package auditing.
type CLI ¶
type CLI struct {
// Global flags
Output string `help:"Output format (json, table, sarif, html, cyclonedx)" enum:"json,table,sarif,html,cyclonedx" default:"json"`
Quiet bool `help:"Suppress non-error output" short:"q"`
Verbose bool `help:"Enable verbose/debug output" short:"v"`
Offline bool `help:"Use offline database only"`
FailOn string `help:"Fail with exit code 1 if findings at or above severity (low, medium, high, critical)" default:""`
Ignore []string `help:"CVE IDs to ignore"`
VEX string `help:"Path to OpenVEX document for suppression"`
// Commands
Version VersionCmd `cmd:"" help:"Print version information"`
Search SearchCmd `cmd:"" help:"Search Vulners database"`
CVE CVECmd `cmd:"" name:"cve" help:"Look up a CVE by ID"`
CPE CPECmd `cmd:"" name:"cpe" help:"Search by CPE"`
Audit AuditCmd `cmd:"" help:"Audit OS packages"`
Scan ScanCmd `cmd:"" help:"Scan targets for vulnerabilities"`
Offline_ OfflineCmd `cmd:"" name:"offline" help:"Manage offline database"`
STIX StixCmd `cmd:"" name:"stix" help:"Export STIX bundle for a bulletin or CVE"`
}
CLI is the root Kong command structure.
type CPECmd ¶
type CPECmd struct {
Product string `arg:"" help:"Product name to search"`
Vendor string `help:"Vendor name" default:""`
Limit int `help:"Maximum results to return" default:"10"`
}
CPECmd searches by CPE.
type CVECmd ¶
type CVECmd struct {
ID string `arg:"" help:"CVE identifier (e.g. CVE-2021-44228)"`
References bool `help:"Include external references"`
History bool `help:"Include change history"`
}
CVECmd looks up a CVE by ID.
type CVEOutput ¶
type CVEOutput struct {
Bulletin *vulners.Bulletin `json:"bulletin"`
References []string `json:"references,omitempty"`
History []vulners.HistoryEntry `json:"history,omitempty"`
}
CVEOutput wraps bulletin data with optional references and history.
type HostAuditCmd ¶
type HostAuditCmd struct {
OS string `help:"Operating system name (e.g. ubuntu, centos)" required:""`
Version string `help:"OS version (e.g. 22.04, 8)" required:""`
Packages []string `help:"Packages in 'name version' format" required:""`
}
HostAuditCmd audits host packages using the v4 Host audit API.
type LinuxAuditCmd ¶
type LinuxAuditCmd struct {
Distro string `help:"Linux distribution name (e.g. ubuntu, debian, centos)" required:""`
Version string `help:"Distribution version (e.g. 22.04)" required:""`
Pkg []string `help:"Package names with versions (e.g. openssl=3.0.2)" required:""`
}
LinuxAuditCmd audits Linux distribution packages.
type OfflineCmd ¶
type OfflineCmd struct {
Sync OfflineSyncCmd `cmd:"" help:"Sync vulnerability data for offline use"`
Status OfflineStatusCmd `cmd:"" help:"Show offline database status"`
Purge OfflinePurgeCmd `cmd:"" help:"Purge offline database"`
}
OfflineCmd is the command group for offline mode management.
type OfflineStatusCmd ¶
type OfflineStatusCmd struct{}
OfflineStatusCmd shows offline database status.
type OfflineSyncCmd ¶
type OfflineSyncCmd struct {
Collections []string `help:"Collections to sync (e.g. cve,exploit,debian)" default:"cve"`
Full bool `help:"Force full sync even if recent data exists"`
}
OfflineSyncCmd syncs vulnerability data for offline use.
type ScanCmd ¶
type ScanCmd struct {
Repo ScanRepoCmd `cmd:"" help:"Scan a repository for vulnerabilities"`
SBOM ScanSBOMCmd `cmd:"" name:"sbom" help:"Scan an SBOM file"`
Image ScanImageCmd `cmd:"" help:"Scan a container image (requires syft)"`
Dir ScanDirCmd `cmd:"" help:"Scan a directory for package manifests"`
}
ScanCmd is the command group for scanning targets.
type ScanDirCmd ¶
type ScanDirCmd struct {
Path string `arg:"" help:"Directory path to scan" default:"."`
}
ScanDirCmd scans a directory for package manifests and finds vulnerabilities.
type ScanImageCmd ¶
type ScanImageCmd struct {
Image string `arg:"" help:"Image reference (e.g. alpine:3.18, ./image.tar)"`
}
ScanImageCmd scans a container image (requires syft for SBOM generation).
type ScanOutput ¶
type ScanOutput struct {
SchemaVersion string `json:"schemaVersion"`
Target string `json:"target"`
Components []model.Component `json:"components"`
Findings []model.Finding `json:"findings"`
Summary ScanSummary `json:"summary"`
}
ScanOutput is the structured output for scan commands.
type ScanRepoCmd ¶
type ScanRepoCmd struct {
Path string `arg:"" help:"Path to repository" default:"."`
}
ScanRepoCmd scans a repository for vulnerabilities.
type ScanSBOMCmd ¶
type ScanSBOMCmd struct {
File string `arg:"" help:"Path to SBOM file"`
Format string `help:"SBOM format (cyclonedx, spdx)" enum:"cyclonedx,spdx" default:"cyclonedx"`
}
ScanSBOMCmd scans an SBOM file for vulnerabilities.
type ScanSummary ¶
type ScanSummary struct {
ComponentCount int `json:"componentCount"`
FindingCount int `json:"findingCount"`
Critical int `json:"critical"`
High int `json:"high"`
Medium int `json:"medium"`
Low int `json:"low"`
ExploitedCount int `json:"exploitedCount,omitempty"`
HighEPSSCount int `json:"highEpssCount,omitempty"`
}
ScanSummary summarizes scan results.
type SearchCmd ¶
type SearchCmd struct {
Query string `arg:"" help:"Lucene search query"`
Limit int `help:"Maximum results to return" default:"10"`
Offset int `help:"Result offset for pagination" default:"0"`
Exploits bool `help:"Search exploits only"`
}
SearchCmd searches the Vulners database.
type StixCmd ¶
type StixCmd struct {
ID string `arg:"" help:"Bulletin or CVE identifier"`
ByCVE bool `help:"Look up by CVE ID instead of bulletin ID"`
}
StixCmd exports STIX bundles from Vulners.
type VersionCmd ¶
type VersionCmd struct{}
VersionCmd prints version information.
func (*VersionCmd) Run ¶
func (c *VersionCmd) Run(globals *CLI) error
Run executes the version command.
type VersionInfo ¶
type VersionInfo struct {
Version string `json:"version"`
Commit string `json:"commit"`
Date string `json:"date"`
GoVersion string `json:"goVersion"`
}
VersionInfo holds version metadata.
type WinFullAuditCmd ¶
type WinFullAuditCmd struct {
OS string `help:"Windows version (e.g. 'Windows 10')" required:""`
Version string `help:"OS build version" required:""`
KB []string `help:"Installed KB numbers"`
Software []string `help:"Installed software in 'name version' format"`
}
WinFullAuditCmd audits Windows using the WinAudit API (KBs + software).
type WindowsAuditCmd ¶
type WindowsAuditCmd struct {
OS string `help:"Windows OS version (e.g. 'Windows 10')" default:"Windows 10"`
KB []string `help:"Installed KB identifiers" required:""`
}
WindowsAuditCmd audits Windows KB updates.