Documentation
¶
Index ¶
- func Execute() error
- func LoadFromMemory(rootPath string, freshExploits, freshAdvisories, freshVulns bool) error
- type AIBOMPassOptions
- type AIBOMPassResult
- type CBOMPassOptions
- type CBOMPassResult
- type CommandManifest
- type EcoGroups
- type EcoStatus
- type GateBreach
- type LicensePolicyFlags
- type LicenseRunOptions
- type LicenseRunResult
- type ManifestCommand
- type MultiPolicyBreachError
- type PolicyBreachError
- type SeverityBreachError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadFromMemory ¶
LoadFromMemory reconstructs the scan pretty output from .vulnetix/sbom.cdx.json. When fresh* flags are true, selective API calls are made to refresh that data.
Types ¶
type AIBOMPassOptions ¶ added in v3.79.0
type AIBOMPassOptions struct {
RootPath string
Depth int
Ignore []string
CatalogPath string
NoBuiltinCatalog bool
// Passes selects which detection passes run; the zero value runs none, so
// callers must be explicit.
Passes aibomPasses
IncludeHome bool
CommitMax int
RespectGitignore bool
// SpecVersion defaults to 1.7.
SpecVersion string
// Upload submits the AIBOM to the backend when authenticated.
Upload bool
GitCtx *gitctx.GitContext
}
AIBOMPassOptions is the AIBOM owner's entry contract. The `aibom` command builds it from its flags; `scan` builds it with the pass defaults. Both go through runAIBOMPass, so there is one definition of "detect AI usage".
type AIBOMPassResult ¶ added in v3.79.0
type AIBOMPassResult struct {
Detections cyclonedx.AIDetections
BOM []byte
SpecVersion string
}
AIBOMPassResult carries what the caller renders or writes.
type CBOMPassOptions ¶ added in v3.79.0
type CBOMPassOptions struct {
RootPath string
Depth int
Ignore []string
CatalogPath string
NoBuiltinCatalog bool
// Passes selects which detection passes run; the zero value runs none.
Passes cbomPasses
RespectGitignore bool
// SpecVersion defaults to 1.7.
SpecVersion string
// Upload submits the CBOM to the backend when authenticated.
Upload bool
GitCtx *gitctx.GitContext
}
CBOMPassOptions is the CBOM owner's entry contract, mirroring AIBOMPassOptions: the `cbom` command builds it from its flags, `scan` builds it with the pass defaults, and runCBOMPass is the only implementation.
type CBOMPassResult ¶ added in v3.79.0
type CBOMPassResult struct {
Detections cyclonedx.CryptoDetections
BOM []byte
SpecVersion string
}
CBOMPassResult carries what the caller renders, writes or gates on.
type CommandManifest ¶ added in v3.56.0
type CommandManifest struct {
Commands map[string]ManifestCommand `json:"commands"`
}
CommandManifest is the serialized shape of the Cobra tree.
func BuildCommandManifest ¶ added in v3.56.0
func BuildCommandManifest() CommandManifest
BuildCommandManifest walks the live root command and records every command path with its flags. Persistent flags are attributed to the command that declares them and to every descendant, because that is how a user sees them.
type GateBreach ¶
type GateBreach struct {
Gate string // "malware" | "exploits" | "severity" | "eol"
Count int
Message string // pre-formatted, ready to print
}
GateBreach captures one quality gate's failure details.
type LicensePolicyFlags ¶ added in v3.79.0
LicensePolicyFlags is the license policy as the scan-family flags express it (`--license-mode`, `--allow`, `--allow-file`). It travels through the scan pipeline to the license owner so a scan and a standalone `license` run apply the same policy.
type LicenseRunOptions ¶ added in v3.79.0
type LicenseRunOptions struct {
RootPath string
// Mode is the license.EvalConfig mode ("inclusive" or "individual"). Empty
// defaults to inclusive.
Mode string
// AllowCSV / AllowFile are the two spellings of the allow list; AllowFile
// wins when both are set.
AllowCSV string
AllowFile string
// SeverityThreshold filters findings below the given severity.
SeverityThreshold string
// Packages are the parsed manifest packages to analyse.
Packages []scan.ScopedPackage
// ManifestGroups carries the dependency graph used for introduced-via chains.
ManifestGroups []scan.ManifestGroup
// LicensedPackages lets a caller reuse an earlier license.DetectLicenses
// result (the scan pipeline resolves licenses before its SCA round-trip so
// the payload can carry them). Empty means "detect now".
LicensedPackages []license.PackageLicense
// Memory, when non-nil, receives this run's findings and the resolution of
// findings that have disappeared. The caller owns saving it.
Memory *memory.Memory
GitCtx *gitctx.GitContext
// Stderr receives warnings; nil means os.Stderr.
Stderr io.Writer
}
LicenseRunOptions is everything the license pipeline needs from a caller. The `license` command builds it from its own flags; `scan --evaluate-licenses` builds it from the scan-family license flags and passes the packages it has already parsed. Both go through runLicensePipeline so there is exactly one implementation of "what does a license finding mean".
type LicenseRunResult ¶ added in v3.79.0
type LicenseRunResult struct {
Result *license.AnalysisResult
LicensedPackages []license.PackageLicense
// FindingVulnerabilities are this run's open license findings as CycloneDX
// vulnerability entries.
FindingVulnerabilities []cdx.Vulnerability
// VEXVulnerabilities are the resolution attestations read back from memory.
// They are kept separate from the findings because the scan pipeline feeds
// them through cdx.ApplyVEXAnalysis (which annotates an existing entry rather
// than appending a twin), while the license command merges both into the BOM
// in one call.
VEXVulnerabilities []cdx.Vulnerability
// StateChanges are the memory transitions this run produced (new findings,
// resolutions). Empty when Options.Memory was nil.
StateChanges []memory.StateChange
}
LicenseRunResult is the pipeline's output. Callers decide what to do with it: the `license` command merges the CycloneDX entries into the on-disk BOM, the scan pipeline appends them to the BOM it is already building in memory.
func (*LicenseRunResult) CDXVulnerabilities ¶ added in v3.79.0
func (r *LicenseRunResult) CDXVulnerabilities() []cdx.Vulnerability
CDXVulnerabilities is the findings and their VEX attestations in one slice, for callers that merge everything into the BOM at once.
func (*LicenseRunResult) LicenseSpdxIDByPackage ¶ added in v3.79.0
func (r *LicenseRunResult) LicenseSpdxIDByPackage() map[string]string
LicenseSpdxIDByPackage maps "name@version" → resolved SPDX id for every package whose license was determined. It is what the CycloneDX component population and the /v2/cli.sca payload both consume.
type ManifestCommand ¶ added in v3.56.0
type ManifestCommand struct {
Short string `json:"short"`
Flags []string `json:"flags"`
Deprecated []string `json:"deprecatedFlags,omitempty"`
Subs []string `json:"subcommands,omitempty"`
}
ManifestCommand describes one command path (e.g. "auth login").
type MultiPolicyBreachError ¶
type MultiPolicyBreachError struct {
Breaches []GateBreach
}
MultiPolicyBreachError is returned when one or more quality gates are breached.
func (*MultiPolicyBreachError) Error ¶
func (e *MultiPolicyBreachError) Error() string
type PolicyBreachError ¶
type PolicyBreachError interface {
error
// contains filtered or unexported methods
}
PolicyBreachError is implemented by all quality-gate breach errors. Execute() uses this interface to suppress redundant error printing — the command itself has already printed the breach details.
type SeverityBreachError ¶
type SeverityBreachError struct {
// contains filtered or unexported fields
}
SeverityBreachError is returned when --severity threshold is breached. It signals main() to exit with code 1 without printing a redundant error message.
func (*SeverityBreachError) Error ¶
func (e *SeverityBreachError) Error() string
Source Files
¶
- ai_firewall.go
- ai_firewall_apply.go
- ai_firewall_policy.go
- aibom.go
- analyze.go
- auth.go
- banner.go
- binary_scan.go
- cbom.go
- cdx.go
- cli_helpers.go
- cli_sca.go
- completion.go
- config.go
- config_ai_firewall.go
- env.go
- fix.go
- fix_autofix.go
- fix_prompt.go
- from_memory.go
- gh_dependabot.go
- gha.go
- gha_setup.go
- gha_submit.go
- insights_graph.go
- insights_upload.go
- license.go
- malscan.go
- malscan_curation.go
- malscan_engine.go
- malscan_render.go
- malscan_sarif.go
- manifest.go
- package_firewall.go
- progress.go
- quality_gate_enforce.go
- reconcile.go
- report.go
- root.go
- sarif_persist.go
- sast_rules.go
- scan.go
- skills.go
- specialized_scans.go
- status_summary.go
- suppress.go
- suppress_filter.go
- suppress_sync.go
- tea.go
- tea_publish.go
- tea_release.go
- testsuite_scan.go
- update.go
- upload.go
- upload_publish.go
- vdb.go
- vdb_ai.go
- vdb_attack_techniques.go
- vdb_ecosystem.go
- vdb_exploits_poc.go
- vdb_iocs.go
- vdb_kev.go
- vdb_msrc.go
- vdb_nuclei.go
- vdb_raw.go
- vdb_reachability.go
- vdb_sightings.go
- vdb_snort_rules.go
- vdb_trends.go
- vdb_triage.go
- vdb_v2.go
- vdb_vex.go
- vdb_yara_rules.go
- version.go