vdb

package
v4.27.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: AGPL-3.0 Imports: 30 Imported by: 1 module, 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

Index

Constants

View Source
const (
	// StaticEnumTTL is the cache TTL for slowly-changing enumeration endpoints.
	StaticEnumTTL = 1 * time.Hour
	// PaginatedEnumTTL is the cache TTL for paginated list endpoints.
	PaginatedEnumTTL = 5 * time.Minute
)
View Source
const (
	JailVerdictClear         = "clear"
	JailVerdictJailed        = "jailed"
	JailVerdictIndeterminate = "indeterminate"
	JailVerdictNoPolicy      = "no-policy"
)

Jail verdicts.

View Source
const (
	JailStatePass          = "pass"
	JailStateBreach        = "breach"
	JailStateWarn          = "warn"
	JailStateIndeterminate = "indeterminate"
	JailStateSkipped       = "skipped"
	JailStateExempt        = "exempt"
)

Jail rule states.

View Source
const (
	VexOriginScanVexFile = "scan_vex_file"
	VexOriginBOMEnrich   = "bom_enrich"
	VexOriginUpload      = "upload"
	VexOriginBOMAnalysis = "bom_analysis"
	VexOriginTriage      = "triage"
	VexOriginReconcile   = "reconcile"
	VexOriginDefend      = "defend"
	VexOriginJail        = "jail"
)

Origins of a document sent to /v2/cli.vex-ingest.

View Source
const (
	VexIngestMaxDocuments     = 10
	VexIngestMaxDocumentBytes = 8 << 20
)

The server's limits: documents per request and bytes per document.

View Source
const (
	DefaultBaseURL    = "https://api.vdb.vulnetix.com"
	DefaultAPIVersion = "/v2"
	Region            = "us-east-1"
	Service           = "vdb"
	Algorithm         = "AWS4-HMAC-SHA512"
	TokenExpiry       = 15 * time.Minute
	MaxRetries        = 2
	BaseBackoff       = 2 * time.Second
)
View Source
const DefenceCountsMaxItems = 100

DefenceCountsMaxItems is the most items one request may carry.

View Source
const GHAOIDCHeader = "X-Vulnetix-GHA-OIDC"

GHAOIDCHeader carries a GitHub Actions OIDC id token (audience "vulnetix"). vdb-api verifies it against GitHub's JWKS and ranks it above every claim in CliEnv.Identity.

Variables

View Source
var GHAOIDCToken func() string

GHAOIDCToken returns the runner's OIDC token, or "" outside a runner that grants one. The cmd layer sets it to ghactx.OIDCToken; it lives here as a variable because internal/ghactx imports this package.

View Source
var Verbose bool

Verbose controls whether transient retry/backoff progress messages (rate-limit retries, countdown waits) are emitted to stderr. Final errors are always returned to the caller. Set by the cmd layer from the --verbose flag.

Functions

func LoadCredentials

func LoadCredentials() (orgID, secretKey string, err error)

LoadCredentials loads VDB credentials using the centralized auth package. Returns orgID and secretKey for backward compatibility with existing callers.

func LoadFullCredentials

func LoadFullCredentials() (*auth.Credentials, error)

LoadFullCredentials loads credentials as a full Credentials struct

Types

type APIKeyResponse

type APIKeyResponse struct {
	Success bool   `json:"success"`
	OrgID   string `json:"orgId"`
	APIKey  string `json:"apiKey"`
	Error   string `json:"error,omitempty"`
}

APIKeyResponse represents the derived API key response for SigV4 users.

type AffectedLookup

type AffectedLookup struct {
	ID     string
	Params V2QueryParams
}

AffectedLookup is one GET /v2/vuln/{id}/affected request.

type AffectedResult

type AffectedResult struct {
	Data map[string]interface{}
	Err  error
}

AffectedResult is one AffectedLookup's answer, as V2AffectedCached gives it.

type AiFirewallBaselineGuardrail

type AiFirewallBaselineGuardrail struct {
	ID          string   `json:"id"` // stable; the key for excludes
	Name        string   `json:"name"`
	Description string   `json:"description"`
	RuleType    string   `json:"ruleType"`
	Action      string   `json:"action"`
	Pattern     string   `json:"pattern"`
	Priority    int      `json:"priority"`
	Enabled     bool     `json:"enabled"`
	Tags        []string `json:"tags"`
	Severity    string   `json:"severity"`
}

AiFirewallBaselineGuardrail is one entry in the server's recommended set. The enums match AiFirewallGuardrail exactly, so a baseline entry is applied through the ordinary guardrail write path.

type AiFirewallGateway

type AiFirewallGateway struct {
	BaseURL  string              `json:"baseUrl"`
	WireAPIs map[string][]string `json:"wireApis"`
}

AiFirewallGateway advertises what the gateway can actually serve. WireAPIs maps a provider slug to the request formats it proxies ("chat", "responses", "messages"). Without it the CLI cannot know whether a client that speaks a non-chat wire (Codex, Claude Code) can be pointed at the gateway at all, so an absent Gateway means "assume chat only" rather than "assume it works".

type AiFirewallGuardrail

type AiFirewallGuardrail struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	RuleType string `json:"ruleType"` // content: blocked_pattern|max_messages|pii_redact; capability: tool_/mcp_/skill_/client_ allow|deny
	Action   string `json:"action"`   // "block" | "redact" | "strip" | "flag"
	Pattern  string `json:"pattern"`
	Enabled  bool   `json:"enabled"`
	Priority int    `json:"priority"`
}

AiFirewallGuardrail is one content guardrail enforced inline by the gateway.

type AiFirewallInventoryEntry

type AiFirewallInventoryEntry struct {
	Kind          string `json:"kind"`
	Identity      string `json:"identity"`
	Detail        string `json:"detail"`
	Source        string `json:"source"`
	ClientName    string `json:"clientName"`
	ClientVersion string `json:"clientVersion"`
	ProviderSlug  string `json:"providerSlug"`
	Wire          string `json:"wire"`
	FirstSeenAt   int64  `json:"firstSeenAt"`
	LastSeenAt    int64  `json:"lastSeenAt"`
	Observations  int64  `json:"observations"`
}

AiFirewallInventoryEntry is one capability the gateway has seen an agent carry: a tool, an MCP server, or a skill.

Source is the evidence grade and is deliberately not smoothed over: "declared" was read verbatim from a request, "invoked" was seen being called, and "inferred" was derived from a naming convention — a convention must never read as a protocol fact.

Observations counts distinct observation windows, NOT requests: the gateway collapses an unchanged agent configuration to one write per window, so it is how often a configuration has turned up, not traffic volume.

type AiFirewallModelPolicy

type AiFirewallModelPolicy struct {
	ModelUUID    string `json:"modelUuid"`
	Slug         string `json:"slug"`
	Name         string `json:"name"`
	ProviderUUID string `json:"providerUuid"`
	ProviderSlug string `json:"providerSlug"`
	Action       string `json:"action"` // "allow" | "deny"
	IsActive     bool   `json:"isActive"`
}

AiFirewallModelPolicy is one model allow/deny entry.

type AiFirewallProviderState

type AiFirewallProviderState struct {
	UUID          string `json:"uuid"`
	Slug          string `json:"slug"`
	Name          string `json:"name"`
	BaseURL       string `json:"baseUrl"`
	GlobalEnabled bool   `json:"globalEnabled"`
	ModelCount    int    `json:"modelCount"`
	OrgAction     string `json:"orgAction"` // "allow" | "deny" | "" (default-allow)
	HasKey        bool   `json:"hasKey"`
	KeyUpdatedAt  int64  `json:"keyUpdatedAt"`
}

AiFirewallProviderState is one provider in the catalog, with this org's association and BYOK status. HasKey/KeyUpdatedAt are absent on older servers, in which case HasKey is false — treat that as "unknown", not as "no key".

type AttackTechniquesSearchParams

type AttackTechniquesSearchParams struct {
	TechniqueIDs []string
	Tactics      []string
	CveIDs       []string
	Sources      []string
	CapecID      string
	Domain       string
	Subtechnique string
	DerivedBy    string
	Q            string
	Since        string
	Until        string
	Limit        int
	Offset       int
}

AttackTechniquesSearchParams carries the optional filter knobs for the MITRE ATT&CK collection endpoint.

type CVEInfo

type CVEInfo struct {
	Data interface{} // Store full response for display (array or object)
}

CVEInfo represents vulnerability information for a CVE

type CliAIBOMRequest

type CliAIBOMRequest struct {
	SpecVersion    string          `json:"specVersion,omitempty"`
	CatalogVersion string          `json:"catalogVersion,omitempty"`
	BomJSON        string          `json:"bomJson,omitempty"`
	Detections     json.RawMessage `json:"detections,omitempty"`
}

CliAIBOMRequest is the payload for POST /v2/cli.ai-bom: the validated CycloneDX AIBOM (BomJSON, stored verbatim for lossless reconstruction) plus the structured detections that the server decomposes into relational rows.

type CliAIBOMResponse

type CliAIBOMResponse struct {
	Aibom *CliIngestionSnapshot `json:"aibom,omitempty"`
}

CliAIBOMResponse is returned by /v2/cli.ai-bom; Aibom carries the user-facing AI Inventory link (nil for community/unauthenticated callers — no persistence).

type CliAPIError

type CliAPIError struct {
	StatusCode int
	RetryAfter time.Duration // parsed from the Retry-After header; 0 if absent
	Message    string
}

CliAPIError is returned by the cli.* endpoints when the API responds with an HTTP status >= 400. It carries the status code (so callers can distinguish retryable 5xx/429 from terminal 4xx) and any Retry-After hint parsed from the response headers, enabling the self-healing retry/backoff loop in cli_sca.go.

func (*CliAPIError) Error

func (e *CliAPIError) Error() string

type CliAiFirewallBaseline

type CliAiFirewallBaseline struct {
	Version    string                        `json:"version"`
	Ref        string                        `json:"ref"`
	Guardrails []AiFirewallBaselineGuardrail `json:"guardrails"`
}

CliAiFirewallBaseline is the server's recommended guardrail set.

type CliAiFirewallBaselineRequest

type CliAiFirewallBaselineRequest struct {
	Ref string `json:"ref,omitempty"`
}

CliAiFirewallBaselineRequest asks the server for its recommended guardrail set (PII masking, prompt injection, and so on). Ref selects a named set.

type CliAiFirewallGuardrailRequest

type CliAiFirewallGuardrailRequest struct {
	UUID     string  `json:"uuid,omitempty"` // empty = create
	Name     *string `json:"name,omitempty"`
	RuleType *string `json:"ruleType,omitempty"` // content: blocked_pattern|max_messages|pii_redact; capability: tool_/mcp_/skill_/client_ allow|deny
	Action   *string `json:"action,omitempty"`   // "block" | "redact" | "strip" | "flag"
	Pattern  *string `json:"pattern,omitempty"`
	Priority *int    `json:"priority,omitempty"`
	Enabled  *bool   `json:"enabled,omitempty"`
	Delete   bool    `json:"delete,omitempty"`
}

type CliAiFirewallInventory

type CliAiFirewallInventory struct {
	Entries   []AiFirewallInventoryEntry `json:"entries"`
	Counts    map[string]int             `json:"counts"`
	Truncated bool                       `json:"truncated"`
	// Cleared and Removed are returned instead of Entries when Clear was set.
	Cleared bool  `json:"cleared,omitempty"`
	Removed int64 `json:"removed,omitempty"`
}

CliAiFirewallInventory is the inventory read. Truncated says the caller's limit bounded the answer, not that the estate is that small — a capped list that looks complete is the failure worth spending a field on.

type CliAiFirewallInventoryRequest

type CliAiFirewallInventoryRequest struct {
	Kind   string `json:"kind,omitempty"`   // "tool" | "mcp_server" | "skill"
	Client string `json:"client,omitempty"` // exact client name
	Search string `json:"search,omitempty"` // substring match on the identity
	Limit  int    `json:"limit,omitempty"`  // 1..1000, default 200 server-side
	Clear  bool   `json:"clear,omitempty"`
}

CliAiFirewallInventoryRequest reads the org's observed AI capability inventory. Every field is a filter; Clear removes the whole inventory instead of reading it.

type CliAiFirewallKeyRequest

type CliAiFirewallKeyRequest struct {
	Provider string `json:"provider"`         // provider slug
	APIKey   string `json:"apiKey,omitempty"` // write-only
	Delete   bool   `json:"delete,omitempty"`
}

CliAiFirewallKeyRequest sets or removes the org's BYOK provider key. The key is write-only: no endpoint ever returns it, and the response carries only HasKey/KeyUpdatedAt.

type CliAiFirewallModelRequest

type CliAiFirewallModelRequest struct {
	Slug        string `json:"slug"`
	Provider    string `json:"provider,omitempty"` // provider slug; empty with AnyProvider targets all providers
	AnyProvider bool   `json:"anyProvider,omitempty"`
	Action      string `json:"action"` // "allow" | "deny" | "remove"
}

type CliAiFirewallProviderRequest

type CliAiFirewallProviderRequest struct {
	Slug   string `json:"slug"`
	Action string `json:"action"` // "allow" | "deny" | "clear"
}

type CliAiFirewallSettingsRequest

type CliAiFirewallSettingsRequest struct {
	LogsEnabled *bool `json:"logsEnabled,omitempty"`
}

CliAiFirewallSettingsRequest toggles org-wide AI Firewall settings. Nil means "leave as-is".

type CliAiFirewallState

type CliAiFirewallState struct {
	Providers     []AiFirewallProviderState `json:"providers"`
	ModelPolicies []AiFirewallModelPolicy   `json:"modelPolicies"`
	Guardrails    []AiFirewallGuardrail     `json:"guardrails"`
	LogsEnabled   bool                      `json:"logsEnabled"`
	Gateway       *AiFirewallGateway        `json:"gateway"`
}

CliAiFirewallState is the typed form of the cli.ai-firewall-get response.

type CliApiSpec

type CliApiSpec struct {
	// Path is the file's path within the repository.
	Path string `json:"path"`
	// Content is the raw document, exactly as on disk.
	Content string `json:"content"`
	// Discovered marks a spec found by probing rather than committed in the
	// repository; the server lands it as a candidate for a person to accept.
	Discovered bool `json:"discovered,omitempty"`
}

CliApiSpec is one OpenAPI or Swagger document the CLI found, uploaded for the attack surface feature. The server re-reads Content through the shared vdb-openapi module and never trusts a client-side parse, so only the raw bytes and where they came from are sent.

type CliApiSpecsRequest

type CliApiSpecsRequest struct {
	RepoName        string       `json:"repoName,omitempty"`
	CommitSha       string       `json:"commitSha,omitempty"`
	InsightsRunUuid string       `json:"insightsRunUuid,omitempty"`
	Specs           []CliApiSpec `json:"specs"`
}

CliApiSpecsRequest is the POST /v2/cli.api-specs body.

type CliApiSpecsResponse

type CliApiSpecsResponse struct {
	SpecUuids []string `json:"specUuids"`
	Accepted  int      `json:"accepted"`
	Rejected  int      `json:"rejected"`
}

CliApiSpecsResponse is what the server returns per upload.

type CliBinaryAnalyzeEntry

type CliBinaryAnalyzeEntry struct {
	Path          string                  `json:"path"`
	Size          int64                   `json:"size"`
	ELFType       string                  `json:"elfType,omitempty"`
	ELFArch       string                  `json:"elfArch,omitempty"`
	ELFOSABI      string                  `json:"elfOSABI,omitempty"`
	Hashes        CliBinaryHashes         `json:"hashes"`
	Weaknesses    []string                `json:"weaknesses,omitempty"`
	Capabilities  []string                `json:"capabilities,omitempty"`
	Strings       []string                `json:"strings,omitempty"`
	Exif          map[string]any          `json:"exif,omitempty"`
	Hashlookup    *CliHashlookupResult    `json:"hashlookup,omitempty"`
	MalwareBazaar *CliMalwareBazaarResult `json:"malwareBazaar,omitempty"`
}

CliBinaryAnalyzeEntry is one ELF binary in the /v2/cli.analyze payload.

type CliBinaryAnalyzeRequest

type CliBinaryAnalyzeRequest struct {
	ScannerRunUUID string                  `json:"scannerRunUuid"`
	Path           string                  `json:"path"`
	Binaries       []CliBinaryAnalyzeEntry `json:"binaries"`
	SnapshotUuid   string                  `json:"ingestionSnapshotUuid,omitempty"`
}

CliBinaryAnalyzeRequest is the full payload for POST /v2/cli.analyze.

ScannerRunUUID is this run's local correlation id. The server does not use it as a key — it mints its own, as every other cli.* route does.

SnapshotUuid attaches the inventory to the container scan that produced it, so one `vulnetix containers` invocation yields one snapshot rather than two. Empty opens a run of its own, which is what a standalone rootfs scan needs.

type CliBinaryAnalyzeResponse

type CliBinaryAnalyzeResponse struct {
	BinariesStored    int                   `json:"binariesStored"`
	FindingsCreated   int                   `json:"findingsCreated"`
	MalwareHits       int                   `json:"malwareHits"`
	CveMatches        int                   `json:"cveMatches"`
	IngestionSnapshot *CliIngestionSnapshot `json:"ingestionSnapshot,omitempty"`
}

CliBinaryAnalyzeResponse is the typed response from /v2/cli.analyze.

FindingsCreated and CveMatches are 0 by design. Malware raises its Finding through cli.malscan, which owns the Finding/Triage/OpenVEX chain, and packages found inside binaries reach cli.sca as real purls — deriving CVEs here from an unqualified hashlookup package name would be fuzzy matching on a bare string. Both fields are kept so the shape does not change under a client if either ever gains a source it can substantiate.

type CliBinaryHashes

type CliBinaryHashes struct {
	SHA256    string `json:"sha256"`
	MD5       string `json:"md5"`
	SHA1      string `json:"sha1"`
	SSDEEP    string `json:"ssdeep,omitempty"`
	TLSH      string `json:"tlsh,omitempty"`
	SHA256Raw string `json:"sha256Raw,omitempty"`
	MD5Raw    string `json:"md5Raw,omitempty"`
	SHA1Raw   string `json:"sha1Raw,omitempty"`
}

CliBinaryHashes carries every hash the CLI computed for one ELF binary.

type CliCBOMRequest

type CliCBOMRequest struct {
	SpecVersion    string          `json:"specVersion,omitempty"`
	CatalogVersion string          `json:"catalogVersion,omitempty"`
	BomJSON        string          `json:"bomJson,omitempty"`
	Detections     json.RawMessage `json:"detections,omitempty"`
}

CliCBOMRequest is the payload for POST /v2/cli.cbom: the validated CycloneDX CBOM (BomJSON, stored verbatim) plus the structured crypto detections the server decomposes into relational rows.

type CliCBOMResponse

type CliCBOMResponse struct {
	Cbom *CliIngestionSnapshot `json:"cbom,omitempty"`
}

CliCBOMResponse is returned by /v2/cli.cbom; Cbom carries the user-facing Cryptography Inventory link (nil for community/unauthenticated callers).

type CliCIContext

type CliCIContext struct {
	Provider        string `json:"provider,omitempty"` // "github-actions"
	Repository      string `json:"repository,omitempty"`
	RepositoryID    int64  `json:"repositoryId,omitempty"`
	RepositoryOwner string `json:"repositoryOwner,omitempty"`
	OwnerType       string `json:"ownerType,omitempty"`
	Visibility      string `json:"visibility,omitempty"`
	DefaultBranch   string `json:"defaultBranch,omitempty"`
	LicenseSpdxID   string `json:"licenseSpdxId,omitempty"`

	RunID        int64  `json:"runId,omitempty"`
	RunNumber    int    `json:"runNumber,omitempty"`
	RunAttempt   int    `json:"runAttempt,omitempty"`
	RunURL       string `json:"runUrl,omitempty"`
	WorkflowName string `json:"workflowName,omitempty"`
	WorkflowRef  string `json:"workflowRef,omitempty"`
	WorkflowSHA  string `json:"workflowSha,omitempty"`
	JobName      string `json:"jobName,omitempty"`

	EventName         string `json:"eventName,omitempty"`
	Ref               string `json:"ref,omitempty"`
	RefName           string `json:"refName,omitempty"`
	RefType           string `json:"refType,omitempty"`
	HeadRef           string `json:"headRef,omitempty"`
	BaseRef           string `json:"baseRef,omitempty"`
	SHA               string `json:"sha,omitempty"`
	PullRequestNumber int    `json:"pullRequestNumber,omitempty"`
	Actor             string `json:"actor,omitempty"`
	TriggeringActor   string `json:"triggeringActor,omitempty"`

	ServerURL string `json:"serverUrl,omitempty"`
	APIURL    string `json:"apiUrl,omitempty"`
	// Workspace is GITHUB_WORKSPACE — the root SARIF file paths are relative to.
	// The server needs it to reproduce this CLI's path relativisation when it
	// re-decomposes the document.
	Workspace  string `json:"workspace,omitempty"`
	RunnerOS   string `json:"runnerOs,omitempty"`
	RunnerArch string `json:"runnerArch,omitempty"`
	RunnerName string `json:"runnerName,omitempty"`
}

CliCIContext is the CI pipeline the scan ran in. Mirrors vdb-api/internal/handler/v2_cli_common.go. Populated by `vulnetix gha upload` from the GitHub Actions environment, the webhook payload at GITHUB_EVENT_PATH, and (only to fill remaining gaps) the GitHub REST API.

type CliContainerSourceFile

type CliContainerSourceFile struct {
	Path   string                    `json:"path"`
	Stages []CliContainerSourceStage `json:"stages"`
}

CliContainerSourceFile is one Dockerfile.

type CliContainerSourceInstall

type CliContainerSourceInstall struct {
	Line     int                         `json:"line"`
	Manager  string                      `json:"manager"`
	Packages []CliContainerSourcePackage `json:"packages"`
}

CliContainerSourceInstall is one package-manager install line.

type CliContainerSourcePackage

type CliContainerSourcePackage struct {
	Name string `json:"name"`
	Spec string `json:"spec,omitempty"`
}

CliContainerSourcePackage is a package as the install line wrote it.

type CliContainerSourceStage

type CliContainerSourceStage struct {
	Index          int                         `json:"index"`
	Name           string                      `json:"name,omitempty"`
	Line           int                         `json:"line"`
	RawRef         string                      `json:"rawRef"`
	ResolvedRef    string                      `json:"resolvedRef,omitempty"`
	FromStage      string                      `json:"fromStage,omitempty"`
	Platform       string                      `json:"platform,omitempty"`
	IsFinal        bool                        `json:"isFinal"`
	UnresolvedArgs bool                        `json:"unresolvedArgs,omitempty"`
	Installs       []CliContainerSourceInstall `json:"installs,omitempty"`
}

CliContainerSourceStage is one FROM and the install lines after it.

type CliContainerSourcesRequest

type CliContainerSourcesRequest struct {
	RepoFullName string                   `json:"repoFullName,omitempty"`
	CommitSha    string                   `json:"commitSha,omitempty"`
	Files        []CliContainerSourceFile `json:"files"`
}

CliContainerSourcesRequest is the payload for POST /v2/cli.container-sources.

type CliContainerSourcesResponse

type CliContainerSourcesResponse struct {
	RepoFullName string `json:"repoFullName"`
	Stages       int    `json:"stages"`
	Installs     int    `json:"installs"`
	LinkedImages int    `json:"linkedImages"`
	Persisted    bool   `json:"persisted"`
}

CliContainerSourcesResponse is what /v2/cli.container-sources recorded.

type CliControlFlag

type CliControlFlag struct {
	Flag  string `json:"flag"`
	Value string `json:"value"`
}

CliControlFlag is one control flag in effect for the scan (e.g. {"--severity","high"}, {"--block-malware","true"}). Captures every control flag the user set — not only the ones that breached — so the server can reconstruct the full invocation for the build-outcome display.

type CliCweGuidanceRequest

type CliCweGuidanceRequest struct {
	CweIDs []string `json:"cweIds"`
}

CliCweGuidanceRequest accepts CWE-* ids.

type CliDeploymentContext

type CliDeploymentContext struct {
	// Project is what the artefact is and who owns it. High cardinality.
	Project string `json:"project,omitempty"`
	// Cluster is where it is deployed. Low cardinality, platform-team owned.
	Cluster string `json:"cluster,omitempty"`
	// Namespace is the sub-cluster boundary it runs in.
	Namespace string `json:"namespace,omitempty"`
	// Environment is the deployment stage, e.g. production, staging.
	Environment string `json:"environment,omitempty"`
	// Tags are additional free-form labels supplied with --tag key=value.
	Tags map[string]string `json:"tags,omitempty"`
}

CliDeploymentContext is the deployment label set carried on a submission.

Cluster and project are separate, orthogonal dimensions rather than one field: a scan belongs to cluster `prod-eu` AND project `payment-service` at the same time, and collapsing them would make either query impossible.

type CliEnv

type CliEnv struct {
	CliVersion      string                `json:"cliVersion,omitempty"`
	Commit          string                `json:"commit,omitempty"`
	BuildDate       string                `json:"buildDate,omitempty"`
	Platform        string                `json:"platform,omitempty"`
	Arch            string                `json:"arch,omitempty"`
	OS              string                `json:"os,omitempty"`
	Hostname        string                `json:"hostname,omitempty"`
	Shell           string                `json:"shell,omitempty"`
	Git             *CliGitContext        `json:"git,omitempty"`
	PackageManagers []CliPackageMgr       `json:"packageManagers,omitempty"`
	MemoryPath      string                `json:"memoryPath,omitempty"`
	Licenses        []CliLicenseHit       `json:"licenses,omitempty"`
	Manifests       []CliManifestMetadata `json:"manifests,omitempty"`
	ToolMetadata    *CliSBOMToolMetadata  `json:"toolMetadata,omitempty"`
	Capabilities    []CliPMCapability     `json:"capabilities,omitempty"`
	// TestConfigs are test-runner configuration files detected in the repo
	// (metadata only, no raw body) — corroborating evidence for the SAST
	// test-suite attribution. Carried on the SAST submission's env.
	TestConfigs []CliTestConfigMetadata `json:"testConfigs,omitempty"`
	// CI is the pipeline identity when the scan ran in CI rather than on a
	// workstation. In a GitHub Actions runner this is the only trustworthy repo
	// and branch information: the checkout is a detached HEAD, so Git.Branch
	// reads "HEAD (detached)".
	CI *CliCIContext `json:"ci,omitempty"`
	// Deployment is where these results are deployed and who owns them
	// (--project/--cluster/--namespace/--environment/--tag).
	//
	// A repository scan cannot know where its artefacts run, so the labels come
	// from the pipeline that deployed them. Carrying them on every submission is
	// what lets the server answer fleet questions the CLI structurally cannot:
	// which clusters run the vulnerable version, which projects share a
	// dependency, where a component is at inconsistent versions. Absent when the
	// run supplied none — an unlabelled scan must not claim a cluster.
	Deployment *CliDeploymentContext `json:"deployment,omitempty"`
	// Identity is best-effort evidence of who ran the CLI. The CLI verifies
	// none of it; the server ranks it below the key's principal and the GitHub
	// Actions OIDC token (header X-Vulnetix-GHA-OIDC). It never carries a
	// token or a secret.
	Identity *CliIdentity `json:"identity,omitempty"`
}

CliEnv carries local-machine context. Every field is optional; older CLIs keep working as new fields are added server-side.

func SnapshotEnv

func SnapshotEnv(cwd, cliVersion, cliCommit, cliBuildDate string) CliEnv

SnapshotEnv assembles the CliEnv block from the running CLI process. Safe to call at the start of every CLI command; reads are cheap (gitctx walks the cwd once, ManifestFiles is a static map lookup). Callers should pass the version/commit/buildDate constants the cmd package already plumbs.

type CliFinalizeRequest

type CliFinalizeRequest struct {
	IngestionSnapshotUuid string           `json:"ingestionSnapshotUuid"`
	ExitCode              int              `json:"exitCode"`               // 0 = pass, 1 = break build
	BreakBuild            bool             `json:"breakBuild"`             // true when a gate breached
	Gates                 []CliGateResult  `json:"gates"`                  // per-gate breach detail (empty when clean)
	ControlFlags          []CliControlFlag `json:"controlFlags,omitempty"` // every control flag in effect (incl. non-breaching)
	// LocalSuppressions are the findings this run's ignore rules hid before
	// upload, so the server can record which rule hid which snapshot finding.
	LocalSuppressions []CliLocalSuppression `json:"localSuppressions,omitempty"`
}

CliFinalizeRequest reports the scan's policy-gate decision back to the server, anchored to the IngestionSnapshot.uuid from /v2/cli.sca.

type CliFinalizeResponse

type CliFinalizeResponse struct {
	Persisted bool `json:"persisted"`
	// Deferred: the API recorded the request to be saved after its answer.
	Deferred bool `json:"deferred,omitempty"`
}

CliFinalizeResponse is the success body.

type CliFindingResult

type CliFindingResult struct {
	FindingID      string                 `json:"findingId"`
	FindingUuid    string                 `json:"findingUuid"`
	PackageName    string                 `json:"packageName,omitempty"`
	PackageVersion string                 `json:"packageVersion,omitempty"`
	Purl           string                 `json:"purl,omitempty"`
	IntroducedVia  []CliIntroducedViaPath `json:"introducedVia,omitempty"`
}

CliFindingResult mirrors the persisted Finding for reachability correlation.

type CliGHAStatusRequest

type CliGHAStatusRequest struct {
	RunID        int64  `json:"runId,omitempty"`
	RunAttempt   int    `json:"runAttempt,omitempty"`
	SnapshotUuid string `json:"ingestionSnapshotUuid,omitempty"`
}

CliGHAStatusRequest asks what a workflow run published. RunID alone reports every tool from that run; RunAttempt narrows to one attempt (a re-run mints its own runs); SnapshotUuid asks about one submission.

type CliGHAStatusResponse

type CliGHAStatusResponse struct {
	RunID   int64             `json:"runId,omitempty"`
	Runs    []CliGHAStatusRun `json:"runs"`
	Total   int               `json:"total"`
	Tools   int               `json:"tools"`
	Message string            `json:"message,omitempty"`
}

CliGHAStatusResponse is the report for one workflow run.

type CliGHAStatusRun

type CliGHAStatusRun struct {
	ToolName       string `json:"toolName"`
	ToolVersion    string `json:"toolVersion,omitempty"`
	Vendor         string `json:"vendor,omitempty"`
	Category       string `json:"category"`
	ScannerRunUuid string `json:"scannerRunUuid"`
	SnapshotUuid   string `json:"ingestionSnapshotUuid,omitempty"`
	SnapshotURL    string `json:"snapshotUrl,omitempty"`
	AnalysisKey    string `json:"analysisKey,omitempty"`
	RepoName       string `json:"repoName,omitempty"`
	CreatedAt      int64  `json:"createdAt"`

	FindingsCreated int `json:"findingsCreated"`
	IngestedTotal   int `json:"ingestedTotal"`
	Critical        int `json:"critical"`
	High            int `json:"high"`
	Medium          int `json:"medium"`
	Low             int `json:"low"`
	Informational   int `json:"informational"`

	RunAttempt int `json:"runAttempt,omitempty"`
}

CliGHAStatusRun is one tool's published result. Mirrors vdb-api/internal/handler/v2_cli_gha_status.go.

type CliGateResult

type CliGateResult struct {
	Gate    string `json:"gate"`
	Count   int    `json:"count"`
	Message string `json:"message"`
}

CliGateResult is one gate's decision — mirrors cmd.GateBreach.

type CliGitContext

type CliGitContext struct {
	Branch   string   `json:"branch,omitempty"`
	Commit   string   `json:"commit,omitempty"`
	Author   string   `json:"author,omitempty"`
	Remotes  []string `json:"remotes,omitempty"`
	Dirty    bool     `json:"dirty,omitempty"`
	RepoRoot string   `json:"repoRoot,omitempty"`
}

CliGitContext is the subset of repo state useful for triage correlation.

type CliGitHubActionRef

type CliGitHubActionRef struct {
	Action string `json:"action"`
	Ref    string `json:"ref"`
}

CliGitHubActionRef is one uses: reference: owner/repo[/path] and its ref.

type CliGitHubAdvisoriesResponse

type CliGitHubAdvisoriesResponse struct {
	Advisories map[string][]CliGitHubAdvisory `json:"advisories"`
	Incomplete bool                           `json:"incomplete"`
}

CliGitHubAdvisoriesResponse is keyed "action@ref" as the request named them; a reference with nothing to report is absent. Incomplete means at least one lookup failed, so an absent key is not a clean bill of health.

type CliGitHubAdvisory

type CliGitHubAdvisory struct {
	ID    string `json:"id"`
	Range string `json:"range,omitempty"`
}

CliGitHubAdvisory is a published advisory for an action version.

type CliHashlookupResult

type CliHashlookupResult struct {
	FileName       string `json:"fileName,omitempty"`
	FileSize       string `json:"fileSize,omitempty"`
	MD5            string `json:"md5,omitempty"`
	SHA1           string `json:"sha1,omitempty"`
	SHA256         string `json:"sha256,omitempty"`
	SSDEEP         string `json:"ssdeep,omitempty"`
	TLSH           string `json:"tlsh,omitempty"`
	PackageName    string `json:"packageName,omitempty"`
	PackageVersion string `json:"packageVersion,omitempty"`
}

CliHashlookupResult carries the CIRCL hashlookup response subset the CLI forwards to the API. The API uses PackageName+PackageVersion for CVE matching.

type CliIDsRequest

type CliIDsRequest struct {
	IDs []string `json:"ids"`
}

CliIDsRequest is the standard { ids: [...] } shape.

type CliIdentity

type CliIdentity struct {
	GitConfigName     string `json:"gitConfigName,omitempty"`
	GitConfigEmail    string `json:"gitConfigEmail,omitempty"`
	HeadAuthorName    string `json:"headAuthorName,omitempty"`
	HeadAuthorEmail   string `json:"headAuthorEmail,omitempty"`
	OSUser            string `json:"osUser,omitempty"`
	Hostname          string `json:"hostname,omitempty"`
	CIProvider        string `json:"ciProvider,omitempty"`
	CIActor           string `json:"ciActor,omitempty"`
	CITriggeringActor string `json:"ciTriggeringActor,omitempty"`
	CIRepository      string `json:"ciRepository,omitempty"`
	CIRunID           string `json:"ciRunId,omitempty"`
	CISha             string `json:"ciSha,omitempty"`
}

CliIdentity is the claimed identity evidence on a request. Mirrors vdb-api/internal/handler/v2_cli_common.go. Every field is optional and self-reported.

type CliImagePackage

type CliImagePackage struct {
	Purl        string `json:"purl"`
	Name        string `json:"name"`
	Version     string `json:"version"`
	Ecosystem   string `json:"ecosystem,omitempty"`
	LayerIndex  *int   `json:"layerIndex,omitempty"`
	LayerDigest string `json:"layerDigest,omitempty"`
}

CliImagePackage is one package with the layer that installed it.

type CliImageRequest

type CliImageRequest struct {
	Ref                string             `json:"ref"`
	Registry           string             `json:"registry,omitempty"`
	Repository         string             `json:"repository,omitempty"`
	Tag                string             `json:"tag,omitempty"`
	Digest             string             `json:"digest"`
	ManifestListDigest string             `json:"manifestListDigest,omitempty"`
	Platform           string             `json:"platform,omitempty"`
	DiffIDs            []string           `json:"diffIds"`
	Labels             map[string]string  `json:"labels,omitempty"`
	OS                 string             `json:"os,omitempty"`
	OSRelease          string             `json:"osRelease,omitempty"`
	PurlDistro         string             `json:"purlDistro,omitempty"`
	Libc               string             `json:"libc,omitempty"`
	HasShell           *bool              `json:"hasShell,omitempty"`
	NonRoot            *bool              `json:"nonRoot,omitempty"`
	DefaultUser        string             `json:"defaultUser,omitempty"`
	PkgManager         string             `json:"pkgManager,omitempty"`
	RuntimeName        string             `json:"runtimeName,omitempty"`
	RuntimeVersion     string             `json:"runtimeVersion,omitempty"`
	Packages           []CliImagePackage  `json:"packages"`
	Source             *CliImageSourceRef `json:"source,omitempty"`
}

CliImageRequest is the payload for POST /v2/cli.image.

type CliImageResponse

type CliImageResponse struct {
	ContainerUuid     string `json:"containerUuid"`
	PackagesStored    int    `json:"packagesStored"`
	BaseResolution    string `json:"baseResolution"`
	BaseRef           string `json:"baseRef"`
	BaseMatchedLayers int    `json:"baseMatchedLayers"`
	WorkloadsLinked   int    `json:"workloadsLinked"`
	Persisted         bool   `json:"persisted"`
}

CliImageResponse is what /v2/cli.image recorded.

type CliImageSourceRef

type CliImageSourceRef struct {
	RepoFullName string `json:"repoFullName"`
	FilePath     string `json:"filePath,omitempty"`
}

CliImageSourceRef names the repository that built the image.

type CliIngestionSnapshot

type CliIngestionSnapshot struct {
	Uuid      string `json:"uuid"`
	URL       string `json:"url"`
	CreatedAt int64  `json:"createdAt"`
	// ScannerRunUuid is read when the server sends it; current servers do not.
	ScannerRunUuid string `json:"scannerRunUuid,omitempty"`
}

CliIngestionSnapshot is the persistent snapshot the server creates when the authenticated org has a SaaS-side Org row. URL is the user-facing link.

type CliInsightsClassif

type CliInsightsClassif struct {
	Label      string `json:"label,omitempty"`
	Thresholds string `json:"thresholds,omitempty"`
}

type CliInsightsCollector

type CliInsightsCollector struct {
	Name            string  `json:"name"`
	Status          string  `json:"status"` // completed | skipped | failed
	Reason          string  `json:"reason,omitempty"`
	DurationSeconds float64 `json:"durationSeconds,omitempty"`
}

type CliInsightsCrossRepoEdge

type CliInsightsCrossRepoEdge struct {
	ID             string          `json:"id"`
	LocalNodeID    string          `json:"localNodeId"`
	JoinKind       string          `json:"joinKind"`
	JoinKey        string          `json:"joinKey"`
	Role           string          `json:"role"`
	TargetRepoHint string          `json:"targetRepoHint,omitempty"`
	Confidence     *float64        `json:"confidence,omitempty"`
	Properties     json.RawMessage `json:"properties,omitempty"`
}

CliInsightsCrossRepoEdge is half an edge: the join key this repository publishes, and whether it provides or consumes it. The other half lives in another repository's scan, and the server forms the edge where the two meet. No scan ever reads a second repository.

type CliInsightsDiag

type CliInsightsDiag struct {
	Level     string `json:"level,omitempty"`
	Collector string `json:"collector,omitempty"`
	MetricID  string `json:"metricId,omitempty"`
	Message   string `json:"message,omitempty"`
	Caveat    bool   `json:"caveat,omitempty"`
}

type CliInsightsEdge

type CliInsightsEdge struct {
	ID         string          `json:"id"`
	Kind       string          `json:"kind"`
	From       string          `json:"from"`
	To         string          `json:"to"`
	Confidence *float64        `json:"confidence,omitempty"`
	Resolution string          `json:"resolution,omitempty"`
	Properties json.RawMessage `json:"properties,omitempty"`
}

type CliInsightsEvidenceIn

type CliInsightsEvidenceIn struct {
	Records []json.RawMessage `json:"records,omitempty"`
}

CliInsightsEvidenceIn is the record store — the evidence that has no open format: commits, contributors, issues, pull requests, reviews, branches, files, dependencies, graph elements. Records are keyed by `id`, which is what a metric's `record` ref points at, and every ref must resolve to a record in this store or the server refuses the whole submission.

type CliInsightsEvidenceRef

type CliInsightsEvidenceRef struct {
	Kind string `json:"kind"`

	RunIndex    *int `json:"runIndex,omitempty"`
	ResultIndex *int `json:"resultIndex,omitempty"`

	StatementIndex *int `json:"statementIndex,omitempty"`

	BomRef string `json:"bomRef,omitempty"`
	SpdxID string `json:"spdxId,omitempty"`

	Check       string `json:"check,omitempty"`
	DetailIndex *int   `json:"detailIndex,omitempty"`

	RecordID string `json:"recordId,omitempty"`
}

CliInsightsEvidenceRef points at one piece of evidence: a SARIF result, a VEX statement, a BOM component, a Scorecard check, or a record in the store below.

type CliInsightsGraph

type CliInsightsGraph struct {
	Nodes          []CliInsightsNode          `json:"nodes,omitempty"`
	Edges          []CliInsightsEdge          `json:"edges,omitempty"`
	CrossRepoEdges []CliInsightsCrossRepoEdge `json:"crossRepoEdges,omitempty"`

	// Set only when the CLI capped the graph it built. Its absence is a claim — "this is
	// the whole graph" — so it must survive the wire rather than being quietly dropped.
	Truncation *CliInsightsGraphTruncation `json:"truncation,omitempty"`
}

type CliInsightsGraphTruncation

type CliInsightsGraphTruncation struct {
	NodesOmitted int    `json:"nodesOmitted,omitempty"`
	EdgesOmitted int    `json:"edgesOmitted,omitempty"`
	FilesSkipped int    `json:"filesSkipped,omitempty"`
	Reason       string `json:"reason,omitempty"`
}

type CliInsightsMetric

type CliInsightsMetric struct {
	ID         string `json:"id"`
	Family     string `json:"family"`
	Name       string `json:"name"`
	Definition string `json:"definition"`
	Unit       string `json:"unit,omitempty"`
	Statistic  string `json:"statistic,omitempty"`

	// nil means "not measured". Never 0 — that would claim we looked.
	Value any `json:"value"`

	Window         *CliInsightsMetricWindow `json:"window,omitempty"`
	Classification *CliInsightsClassif      `json:"classification,omitempty"`

	EvidenceSemantics    string `json:"evidenceSemantics"`
	EvidenceCompleteness string `json:"evidenceCompleteness"`
	PopulationSize       *int   `json:"populationSize,omitempty"`
	OmittedCount         int    `json:"omittedCount,omitempty"`
	TruncationReason     string `json:"truncationReason,omitempty"`

	EvidenceRefs []CliInsightsEvidenceRef `json:"evidenceRefs"`

	// The sources the metric's definition cites — the survey papers and reference
	// implementations its formula came from.
	References []CliInsightsReference `json:"references,omitempty"`
}

CliInsightsMetric carries its own evidence. The server re-checks, before it writes anything, that the evidence accounts for the value — so the refs cannot be sent apart from the metric, and there is no state in which a stored metric cites evidence that is not there.

EvidenceSemantics and EvidenceCompleteness go over the wire lower-case, as the report writes them. The server compares them lower-case and upper-cases only on the way into the enum column.

type CliInsightsMetricWindow

type CliInsightsMetricWindow struct {
	Since int64  `json:"since,omitempty"`
	Until int64  `json:"until,omitempty"`
	Label string `json:"label,omitempty"`
}

type CliInsightsNode

type CliInsightsNode struct {
	ID            string          `json:"id"`
	Kind          string          `json:"kind"`
	Name          string          `json:"name"`
	QualifiedName string          `json:"qualifiedName,omitempty"`
	Path          string          `json:"path,omitempty"`
	StartLine     int             `json:"startLine,omitempty"`
	EndLine       int             `json:"endLine,omitempty"`
	Language      string          `json:"language,omitempty"`
	Purl          string          `json:"purl,omitempty"`
	Exported      bool            `json:"exported,omitempty"`
	Properties    json.RawMessage `json:"properties,omitempty"`
}

type CliInsightsReference

type CliInsightsReference struct {
	Title string `json:"title,omitempty"`
	URL   string `json:"url"`
}

type CliInsightsRequest

type CliInsightsRequest struct {
	// Set on chunks 1..N to append to a run created by chunk 0. Unused: a gzipped submission
	// fits one request, and one request is one transaction — a failure then stores nothing,
	// rather than leaving a half-run that reads as a whole one.
	InsightsRunUuid string `json:"insightsRunUuid,omitempty"`

	SchemaVersion string              `json:"schemaVersion,omitempty"`
	Tool          *CliInsightsTool    `json:"tool,omitempty"`
	Target        *CliInsightsTarget  `json:"target,omitempty"`
	Run           *CliInsightsRunMeta `json:"run,omitempty"`

	Graph    *CliInsightsGraph      `json:"graph,omitempty"`
	Metrics  []CliInsightsMetric    `json:"metrics,omitempty"`
	Evidence *CliInsightsEvidenceIn `json:"evidence,omitempty"`

	// The verbatim report, schema-valid, including its SARIF / OpenVEX / CycloneDX
	// attachments. Stored to S3 untouched; it is not the source of any row.
	ReportJSON  string            `json:"reportJson,omitempty"`
	Diagnostics []CliInsightsDiag `json:"diagnostics,omitempty"`
}

type CliInsightsResponse

type CliInsightsResponse struct {
	Insights *CliInsightsSnapshot `json:"insights,omitempty"`

	// Skipped names a reason nothing was stored that is not a failure — "community". Absent
	// Insights with no Skipped is a failure, whatever the status code says.
	Skipped string `json:"skipped,omitempty"`

	// Deferred: the API took the report to store after its answer (CliInsightsDeferred).
	Deferred bool `json:"deferred,omitempty"`
}

type CliInsightsRunMeta

type CliInsightsRunMeta struct {
	// When the scan ran, by its own clock — the server's createdAt is when it was
	// stored, which on a slow upload or a retry is a different and later time. Epoch ms.
	StartedAt       int64   `json:"startedAt,omitempty"`
	CompletedAt     int64   `json:"completedAt,omitempty"`
	DurationSeconds float64 `json:"durationSeconds,omitempty"`

	HistoryWindow *CliInsightsWindow `json:"historyWindow,omitempty"`

	// The report's own account of what ran and what did not. A skipped forge collector
	// is why four metrics are null; without this the nulls have no story.
	Collectors []CliInsightsCollector `json:"collectors,omitempty"`
}

type CliInsightsSnapshot

type CliInsightsSnapshot struct {
	Uuid      string `json:"uuid"`
	URL       string `json:"url,omitempty"`
	CreatedAt int64  `json:"createdAt"`

	MetricsStored        int `json:"metricsStored"`
	EvidenceStored       int `json:"evidenceStored"`
	NodesStored          int `json:"nodesStored"`
	EdgesStored          int `json:"edgesStored"`
	CrossRepoEdgesStored int `json:"crossRepoEdgesStored"`
}

CliInsightsSnapshot is the persisted run, plus what actually landed. The counts are the server's, not ours — if they disagree with what we sent, that is worth seeing.

type CliInsightsTarget

type CliInsightsTarget struct {
	RepoID        string `json:"repoId,omitempty"`
	OrgKey        string `json:"orgKey,omitempty"`
	RemoteURL     string `json:"remoteUrl,omitempty"`
	DefaultBranch string `json:"defaultBranch,omitempty"`
	HeadCommit    string `json:"headCommit,omitempty"`

	// The head commit's own timestamp, epoch ms — "analysed as of when the code last
	// changed", which is the date a reader wants, not the upload date.
	HeadCommittedAt int64 `json:"headCommittedAt,omitempty"`
}

type CliInsightsTool

type CliInsightsTool struct {
	Name           string `json:"name,omitempty"`
	Version        string `json:"version,omitempty"`
	CatalogVersion string `json:"catalogVersion,omitempty"`
}

type CliInsightsWindow

type CliInsightsWindow struct {
	Since         int64 `json:"since,omitempty"`
	Until         int64 `json:"until,omitempty"`
	CommitsWalked int   `json:"commitsWalked,omitempty"`
	CommitLimit   int   `json:"commitLimit,omitempty"`
}

type CliIntroducedViaPath

type CliIntroducedViaPath struct {
	PathIndex      int      `json:"pathIndex"`
	PathLength     int      `json:"pathLength"`
	PackageManager string   `json:"packageManager"`
	ManifestFile   string   `json:"manifestFile"`
	DependencyPath string   `json:"dependencyPath"`
	DependencyKeys []string `json:"dependencyKeys"`
}

CliIntroducedViaPath mirrors FindingIntroducedVia rows.

type CliJailCategoryFreshness

type CliJailCategoryFreshness struct {
	Category   string             `json:"category"`
	LatestAt   int64              `json:"latestAt"`
	AgeDays    int                `json:"ageDays"`
	CommitSha  string             `json:"commitSha,omitempty"`
	Stale      bool               `json:"stale"`
	WindowDays int                `json:"windowDays"`
	Tools      []CliJailToolCover `json:"tools"`
}

type CliJailExemptRequest

type CliJailExemptRequest struct {
	RuleUuid  string `json:"ruleUuid,omitempty"`
	Repo      string `json:"repo,omitempty"`
	Reason    string `json:"reason"`
	ExpiresAt int64  `json:"expiresAt,omitempty"`

	Deactivate       string `json:"deactivate,omitempty"`
	DeactivateReason string `json:"deactivateReason,omitempty"`
}

CliJailExemptRequest is the payload for POST /v2/cli.jail-exempt.

type CliJailExemptResponse

type CliJailExemptResponse struct {
	Exemption *CliJailExemptionApplied `json:"exemption,omitempty"`
	Action    string                   `json:"action"`
	// Warnings name what the server changed about the request, such as an
	// expiry shortened to the maximum window.
	Warnings []string `json:"warnings,omitempty"`
}

type CliJailExemptionApplied

type CliJailExemptionApplied struct {
	Uuid       string `json:"uuid"`
	RuleUuid   string `json:"ruleUuid,omitempty"`
	Reason     string `json:"reason"`
	ApprovedBy string `json:"approvedBy"`
	ExpiresAt  int64  `json:"expiresAt,omitempty"`
	DaysLeft   int    `json:"daysLeft,omitempty"`
}

CliJailExemptionApplied records an exemption that changed a verdict — the audit trail for why a red gate is green.

type CliJailFreshness

type CliJailFreshness struct {
	Categories []CliJailCategoryFreshness `json:"categories"`
	Missing    []string                   `json:"missing,omitempty"`
	Stale      []string                   `json:"stale,omitempty"`

	// CommitDrift is informational and never a breach.
	CommitDrift  bool   `json:"commitDrift"`
	DriftFrom    string `json:"driftFrom,omitempty"`
	DriftTo      string `json:"driftTo,omitempty"`
	WorstAgeDays int    `json:"worstAgeDays"`
}

CliJailFreshness is the coverage state the verdict rests on.

type CliJailPolicyRef

type CliJailPolicyRef struct {
	Uuid                 string `json:"uuid"`
	Name                 string `json:"name"`
	Source               string `json:"source"` // repo | org
	EnforcementMode      string `json:"enforcementMode"`
	DefaultStalenessDays int    `json:"defaultStalenessDays"`
	OnStale              string `json:"onStale"`
	RuleCount            int    `json:"ruleCount"`
}

CliJailPolicyRef names the policy row that decided this run.

type CliJailRequest

type CliJailRequest struct {
	// Mode selects the read shape: "" or "assess" gates, "explain" adds the
	// matched-item detail behind every verdict, "list" reports the rules in
	// effect without producing artefacts.
	Mode string `json:"mode,omitempty"`

	// Repo and Branch override the server-derived scope. Honoured for explain
	// and list only — an assess run that could name its own scope could name a
	// clean one.
	Repo   string `json:"repo,omitempty"`
	Branch string `json:"branch,omitempty"`

	RuleUuids []string `json:"ruleUuids,omitempty"`

	// KnownSnapshotUuids names scanner runs this invocation just created, so a
	// single-step scan-then-gate does not read its own upload as missing
	// coverage while the read replica catches up.
	KnownSnapshotUuids []string `json:"knownSnapshotUuids,omitempty"`

	IncludeVex   bool `json:"includeVex,omitempty"`
	IncludeSarif bool `json:"includeSarif,omitempty"`

	// StalenessDays and OnStale may only TIGHTEN the policy; the server ignores
	// and reports a looser request.
	StalenessDays int    `json:"stalenessDays,omitempty"`
	OnStale       string `json:"onStale,omitempty"`

	MaxLookbackDays int `json:"maxLookbackDays,omitempty"`
}

CliJailRequest is the payload for POST /v2/cli.jail.

type CliJailResponse

type CliJailResponse struct {
	Verdict     string `json:"verdict"`
	ExitCode    int    `json:"exitCode"`
	EvaluatedAt int64  `json:"evaluatedAt"`

	Policy     *CliJailPolicyRef         `json:"policy,omitempty"`
	Scope      CliJailScope              `json:"scope"`
	Freshness  CliJailFreshness          `json:"freshness"`
	Rules      []CliJailRuleVerdict      `json:"rules"`
	Exemptions []CliJailExemptionApplied `json:"exemptions,omitempty"`
	Vex        *CliJailVexPayload        `json:"vex,omitempty"`
	Sarif      *CliJailSarifPayload      `json:"sarif,omitempty"`
	Summary    CliJailSummary            `json:"summary"`

	Warnings []string `json:"warnings,omitempty"`
}

CliJailResponse is the verdict.

ExitCode is advisory: the CLI owns process exit, and code 2 (usage/config) is CLI-local and never appears here.

type CliJailRuleVerdict

type CliJailRuleVerdict struct {
	RuleUuid   string `json:"ruleUuid"`
	Kind       string `json:"kind"`
	OrderIndex int    `json:"orderIndex"`
	Label      string `json:"label"`

	State string `json:"state"`

	Aggregate     string   `json:"aggregate"`
	Operator      string   `json:"operator"`
	Observed      float64  `json:"observed"`
	ThresholdLow  float64  `json:"thresholdLow"`
	ThresholdHigh *float64 `json:"thresholdHigh,omitempty"`

	OnBreach string `json:"onBreach"`
	Reason   string `json:"reason"`

	// Stale is true when the rule was graded on coverage past its window.
	// Always inspect this before believing a pass.
	Stale      bool     `json:"stale,omitempty"`
	Categories []string `json:"categories,omitempty"`

	Deadline      int64    `json:"deadline,omitempty"`
	DaysRemaining int      `json:"daysRemaining,omitempty"`
	Ratcheted     bool     `json:"ratcheted,omitempty"`
	Baseline      *float64 `json:"baseline,omitempty"`

	ExemptionUuid string `json:"exemptionUuid,omitempty"`

	Items []string `json:"items,omitempty"`
}

CliJailRuleVerdict is one rule's outcome.

type CliJailSarifPayload

type CliJailSarifPayload struct {
	Rules   []CliJailSarifRule   `json:"rules"`
	Results []CliJailSarifResult `json:"results"`
}

CliJailSarifPayload is the non-vulnerability half — EOL, GOAL and HYGIENE. Written to disk and never posted back: the server records a ScannerRun on any SARIF body, so a jail that uploaded would manufacture the coverage the next jail measures freshness against.

type CliJailSarifResult

type CliJailSarifResult struct {
	RuleID      string `json:"ruleId"`
	Message     string `json:"message"`
	ArtifactURI string `json:"artifactUri"`
	Severity    string `json:"severity"`
	Level       string `json:"level"`
	StartLine   int    `json:"startLine,omitempty"`
}

type CliJailSarifRule

type CliJailSarifRule struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Description string   `json:"description"`
	HelpURI     string   `json:"helpUri,omitempty"`
	Severity    string   `json:"severity"`
	Level       string   `json:"level"`
	Tags        []string `json:"tags,omitempty"`
}

type CliJailScope

type CliJailScope struct {
	Repo         string `json:"repo"`
	Branch       string `json:"branch"`
	Commit       string `json:"commit,omitempty"`
	RepoSource   string `json:"repoSource"`
	BranchSource string `json:"branchSource"`
}

CliJailScope is the resolved repo and branch the verdict is about.

Echoed back because the CLI derives the same values independently, and a disagreement between the two is the most likely cause of a gate reporting an empty repo.

type CliJailSummary

type CliJailSummary struct {
	RulesEvaluated int `json:"rulesEvaluated"`
	Breaches       int `json:"breaches"`
	Warnings       int `json:"warnings"`
	Indeterminate  int `json:"indeterminate"`
	Skipped        int `json:"skipped"`
	Exempted       int `json:"exempted"`
}

type CliJailToolCover

type CliJailToolCover struct {
	ToolName     string `json:"toolName"`
	ToolVersion  string `json:"toolVersion,omitempty"`
	LatestAt     int64  `json:"latestAt"`
	AgeDays      int    `json:"ageDays"`
	SnapshotUuid string `json:"snapshotUuid"`
	Total        int    `json:"ingestedTotal"`
}

type CliJailVexPayload

type CliJailVexPayload struct {
	DocumentID string                `json:"documentId"`
	Author     string                `json:"author"`
	Statements []CliJailVexStatement `json:"statements"`
}

CliJailVexPayload carries the statements the CLI feeds to internal/triage.GenerateOpenVEX and GenerateCDXVEX.

Justification is never empty on a statement the server sends, and the CLI asserts that rather than trusting it: GenerateOpenVEX rewrites a statement with a fixed version and an empty justification to status not_affected, which is the exact inverse of what a jail asserts.

type CliJailVexStatement

type CliJailVexStatement struct {
	VulnID           string `json:"vulnId"`
	Package          string `json:"package,omitempty"`
	Ecosystem        string `json:"ecosystem,omitempty"`
	InstalledVersion string `json:"installedVersion,omitempty"`
	FixedVersion     string `json:"fixedVersion,omitempty"`
	Status           string `json:"status"`
	Justification    string `json:"justification"`
	ActionStatement  string `json:"actionStatement,omitempty"`
	Severity         string `json:"severity,omitempty"`
	RuleUuid         string `json:"ruleUuid,omitempty"`
}

type CliLicenseHit

type CliLicenseHit struct {
	SPDXID      string `json:"spdxId,omitempty"`
	Name        string `json:"name,omitempty"`
	URL         string `json:"url,omitempty"`
	Source      string `json:"source,omitempty"`
	Acknowledge string `json:"acknowledgement,omitempty"`
	Text        string `json:"text,omitempty"`
}

CliLicenseHit mirrors vdb-api/internal/handler/v2_cli_common.go.

type CliLicensesData

type CliLicensesData struct {
	Licenses map[string]string `json:"licenses"`
}

CliLicensesData maps each key the API has a stored licence for to it.

type CliLicensesRequest

type CliLicensesRequest struct {
	Keys []string `json:"keys"`
}

CliLicensesRequest names packages by the key their Dependency row uses: the package's purl, or name@version when it has none.

type CliLocalSuppression

type CliLocalSuppression struct {
	RuleUUID  string `json:"ruleUuid,omitempty"`
	Source    string `json:"source"` // memory | remote | nosec
	Category  string `json:"category,omitempty"`
	FindingID string `json:"findingId,omitempty"`
	RuleID    string `json:"ruleId,omitempty"`
	Purl      string `json:"purl,omitempty"`
	FilePath  string `json:"filePath,omitempty"`
	Line      int    `json:"line,omitempty"`
	Type      string `json:"type,omitempty"`
	Reason    string `json:"reason,omitempty"`
}

CliLocalSuppression is one finding a suppression rule hid locally. RuleUUID is empty for a rule that exists only in memory.yaml; the server skips those. A VEX not_affected or fixed statement from --vex-file is not a rule and is never sent here.

type CliMalscanIOC

type CliMalscanIOC struct {
	Type         string   `json:"type"`                   // domain|url|ipv4|ipv6|file-hash|exfil-endpoint|wallet|install-command|email|package-name
	Value        string   `json:"value"`                  // the observable
	Ecosystem    string   `json:"ecosystem,omitempty"`    // npm|pypi|cargo|… (selects the S3 processor prefix)
	FilePath     string   `json:"filePath,omitempty"`     // path (relative to scan root) the IOC was found in
	RuleID       string   `json:"ruleId,omitempty"`       // originating malscan rule/signal id
	Severity     string   `json:"severity,omitempty"`     // STIX severity, when known
	References   []string `json:"references,omitempty"`   // STIX external references / provenance URLs
	SampleSHA256 string   `json:"sampleSha256,omitempty"` // sha256 of the offending-file sample (S3 key component)
	SampleBase64 string   `json:"sampleBase64,omitempty"` // offending-file content (size-capped), base64-encoded
	SampleName   string   `json:"sampleName,omitempty"`   // original sample file name
}

CliMalscanIOC is one indicator of compromise the local malscan extracted, plus the offending-file sample so the server can persist a MalwareIoc row and store the sample to S3 linked to it (attributed to the IOC's ecosystem processor). Mirrors vdb-api/internal/handler/cli_persist_malscan.go.

type CliMalscanRequest

type CliMalscanRequest struct {
	SARIF                 map[string]any    `json:"sarif"`
	Findings              []CliSARIFFinding `json:"findings"`
	IOCs                  []CliMalscanIOC   `json:"iocs,omitempty"`
	IngestionSnapshotUuid string            `json:"ingestionSnapshotUuid,omitempty"`
}

CliMalscanRequest is the payload for POST /v2/cli.malscan. It carries the same SARIF doc + typed findings shape as the other scan endpoints (so persistence reuses the SARIF path) plus the extracted IOCs + samples that the server folds into MalwareIoc rows. Chunked uploads anchor to IngestionSnapshotUuid exactly like the SARIF endpoints.

type CliMalscanResponse

type CliMalscanResponse struct {
	IngestionSnapshot *CliIngestionSnapshot `json:"ingestionSnapshot,omitempty"`
	Findings          []CliFindingResult    `json:"findings,omitempty"`
	Stats             CliSARIFStats         `json:"stats"`
}

CliMalscanResponse is returned by /v2/cli.malscan: the ingestion snapshot link (nil for community/unauthenticated callers — no persistence) plus persisted finding handles and run stats.

type CliMalwareBazaarResult

type CliMalwareBazaarResult struct {
	Malicious bool   `json:"malicious"`
	FileName  string `json:"fileName,omitempty"`
}

CliMalwareBazaarResult carries the local malware corpus check result.

type CliManifestMetadata

type CliManifestMetadata struct {
	Path        string `json:"path"`
	Ecosystem   string `json:"ecosystem,omitempty"`
	IsLock      bool   `json:"isLock,omitempty"`
	SHA256      string `json:"sha256,omitempty"`
	Size        int    `json:"size,omitempty"`
	ContentType string `json:"contentType,omitempty"`
	License     string `json:"license,omitempty"` // declared license from the manifest field
	Provider    string `json:"provider,omitempty"`
	Registry    string `json:"registry,omitempty"`
	Content     string `json:"content,omitempty"` // raw manifest body (chunk-0 only)
}

CliManifestMetadata describes one manifest the CLI parsed. Content is the raw file body; it is populated only on the chunk-0 env (the chunk that carries Packages, where persistence runs) to keep within the request size cap.

type CliOrgVexReply added in v4.23.0

type CliOrgVexReply struct {
	OrgStatementsByVuln map[string][]CliOrgVexStatement `json:"orgStatementsByVuln"`
}

CliOrgVexReply is the organisation's arm of a cli.vex reply, by vulnerability.

type CliOrgVexRequest added in v4.23.0

type CliOrgVexRequest struct {
	IDs        []string `json:"ids"`
	Closing    bool     `json:"closing,omitempty"`
	Repository string   `json:"repository,omitempty"`
}

CliOrgVexRequest asks for the statements that could close findings in one repository. Every scan writes an affected statement per finding, so a plain read fills the reply with statements that close nothing.

type CliOrgVexStatement added in v4.23.0

type CliOrgVexStatement struct {
	Status             string   `json:"status"`
	Justification      string   `json:"justification"`
	ImpactStatement    string   `json:"impactStatement"`
	ActionStatement    string   `json:"actionStatement"`
	SuppressionUUID    string   `json:"suppressionUuid"`
	Timestamp          int64    `json:"timestamp"`
	DocumentID         string   `json:"documentId"`
	RepositoryFullName string   `json:"repositoryFullName"`
	Tooling            string   `json:"tooling"`
	Products           []string `json:"products"`
}

CliOrgVexStatement is one of the organisation's own statements in a cli.vex reply. Products and Tooling are absent from an older server's reply.

type CliPMCapability

type CliPMCapability struct {
	Ecosystem      string  `json:"ecosystem"`
	CapabilityName string  `json:"capabilityName"`
	Supported      bool    `json:"supported"`
	Detected       bool    `json:"detected"`
	Confidence     float64 `json:"confidence,omitempty"`
	Evidence       string  `json:"evidence,omitempty"`
	FilePath       string  `json:"filePath,omitempty"`
	Binary         string  `json:"binary,omitempty"`
	BinaryPath     string  `json:"binaryPath,omitempty"`
	Version        string  `json:"version,omitempty"`
	VersionCommand string  `json:"versionCommand,omitempty"`
	Authoritative  bool    `json:"authoritative,omitempty"`
}

CliPMCapability — one detected package-manager capability on the host. The binary/version fields describe a concrete resolver binary; Authoritative is true when a lockfile narrowed the manifest to this specific binary.

type CliPackageChecksum

type CliPackageChecksum struct {
	Alg   string `json:"alg"`
	Value string `json:"value"`
}

CliPackageChecksum represents an integrity hash for a package.

type CliPackageEntry

type CliPackageEntry struct {
	Purl          string               `json:"purl"`
	Name          string               `json:"name,omitempty"`
	Version       string               `json:"version,omitempty"`
	Ecosystem     string               `json:"ecosystem,omitempty"`
	ManifestFile  string               `json:"manifestFile,omitempty"`
	Scope         string               `json:"scope,omitempty"`
	License       string               `json:"license,omitempty"`
	IntroducedVia [][]string           `json:"introducedVia,omitempty"`
	Checksums     []CliPackageChecksum `json:"checksums,omitempty"`
	// Discovery-source provenance: "manifest" (declared) | "installed" (found in
	// an install dir, not declared). InstalledPath is the root-relative install
	// location (e.g. "node_modules/lodash") for installed packages.
	SourceType    string `json:"sourceType,omitempty"`
	InstalledPath string `json:"installedPath,omitempty"`
}

CliPackageEntry — per-package dependency-path context so the server can compute FindingIntroducedVia paths.

type CliPackageFirewallConfigRequest

type CliPackageFirewallConfigRequest struct {
	CvssThreshold   *float64 `json:"cvssThreshold,omitempty"`
	EpssThreshold   *float64 `json:"epssThreshold,omitempty"`
	CessThreshold   *float64 `json:"cessThreshold,omitempty"`
	BlockMalware    *bool    `json:"blockMalware,omitempty"`
	BlockEol        *bool    `json:"blockEol,omitempty"`
	BlockKev        *bool    `json:"blockKev,omitempty"`
	BlockWeaponized *bool    `json:"blockWeaponized,omitempty"`
	BlockActive     *bool    `json:"blockActive,omitempty"`
	BlockPoc        *bool    `json:"blockPoc,omitempty"`
	BlockBadActors  *bool    `json:"blockBadActors,omitempty"`
	CooldownDays    *int     `json:"cooldownDays,omitempty"`
	VersionLag      *int     `json:"versionLag,omitempty"`
}

type CliPackageFirewallMirrorRequest

type CliPackageFirewallMirrorRequest struct {
	Ecosystem string `json:"ecosystem"`
	URL       string `json:"url"`
	Priority  *int   `json:"priority,omitempty"`
	IsActive  *bool  `json:"isActive,omitempty"`
}

type CliPackageInsight

type CliPackageInsight struct {
	Purl           string                  `json:"purl"`
	Name           string                  `json:"name"`
	Version        string                  `json:"version"`
	Ecosystem      string                  `json:"ecosystem"`
	PublishedAt    *int64                  `json:"publishedAt,omitempty"`    // ms epoch — installed version (--cooldown)
	PublishSource  string                  `json:"publishSource,omitempty"`  // "db" | "deps.dev"
	LatestVersions []CliVersionStamp       `json:"latestVersions,omitempty"` // newest-first by publish date (--version-lag)
	SafeVersions   []CliSafeHarbourVersion `json:"safeVersions,omitempty"`
	SafeHarbour    *CliSafeHarbourSummary  `json:"safeHarbour,omitempty"`
	IsEOL          bool                    `json:"isEol,omitempty"`
	EOLFrom        string                  `json:"eolFrom,omitempty"`
	IsMalicious    bool                    `json:"isMalicious,omitempty"`
	MalwareSource  string                  `json:"malwareSource,omitempty"`
	// TransitiveFix is the server-resolved cross-ecosystem parent-upgrade for a
	// transitive vulnerable package. When present, --sca-autofix prefers it over a
	// deterministic override; the CLI no longer queries a registry directly.
	TransitiveFix *CliTransitiveFix `json:"transitiveFix,omitempty"`
}

CliPackageInsight carries per-package policy-gate signals the server computes for --cooldown, --version-lag, --block-eol and --block-malware. Mirrors the vdb-api handler.CliPackageInsight contract.

type CliPackageInsightLite

type CliPackageInsightLite struct {
	Purl           string                `json:"purl"`
	Name           string                `json:"name,omitempty"`
	Version        string                `json:"version,omitempty"`
	Ecosystem      string                `json:"ecosystem,omitempty"`
	PublishedAt    *int64                `json:"publishedAt,omitempty"`
	LatestVersions []CliVersionStampLite `json:"latestVersions,omitempty"`
	SafeHarbour    *CliSafeHarbourLite   `json:"safeHarbour,omitempty"`
	IsEOL          bool                  `json:"isEOL,omitempty"`
	IsMalicious    bool                  `json:"isMalicious,omitempty"`
}

CliPackageInsightLite mirrors the server's CliPackageInsight, narrowed to the fields analyze reads. Unknown fields are ignored rather than failing the decode, so a server that learns to say more does not break a client that does not care.

type CliPackageInsightsRequest

type CliPackageInsightsRequest struct {
	Purls   []string          `json:"purls"`
	Options CliSCAOptionsLite `json:"options,omitempty"`
}

type CliPackageInsightsResponse

type CliPackageInsightsResponse struct {
	InsightsByPurl map[string]CliPackageInsightLite `json:"insightsByPurl"`

	// Unparseable PURLs, returned rather than silently dropped: a caller that sent 200
	// and got 194 answers deserves to know which six, rather than concluding those six
	// are fine.
	Unparseable []string `json:"unparseable,omitempty"`
}

type CliPackageMgr

type CliPackageMgr struct {
	Ecosystem string `json:"ecosystem"`
	Manifest  string `json:"manifest,omitempty"`
	IsLock    bool   `json:"isLock,omitempty"`
}

CliPackageMgr is one manifest detected near the cwd.

type CliPurlsRequest

type CliPurlsRequest struct {
	Purls []string `json:"purls"`
}

CliPurlsRequest — { purls: [...] }.

type CliQualityGateConfigRequest

type CliQualityGateConfigRequest struct {
	EolNextQuarterSeverity  *string `json:"eolNextQuarterSeverity,omitempty"`
	EolThisQuarterSeverity  *string `json:"eolThisQuarterSeverity,omitempty"`
	EolWithin30DaysSeverity *string `json:"eolWithin30DaysSeverity,omitempty"`
	EolRetiredSeverity      *string `json:"eolRetiredSeverity,omitempty"`

	// Org-wide CLI scan enforcement settings (all nullable — a nil pointer means
	// the org did not set this, so the caller's flag / builtin default stands).
	// The upsert merges on conflict (COALESCE), so omitted fields preserve their
	// stored value; clearing a value is done via the website full-replace PUT.
	BlockEol               *bool   `json:"blockEol,omitempty"`
	BlockMalware           *bool   `json:"blockMalware,omitempty"`
	BlockUnpinned          *bool   `json:"blockUnpinned,omitempty"`
	Cooldown               *int    `json:"cooldown,omitempty"`
	VersionLag             *int    `json:"versionLag,omitempty"`
	ScaAutofixMaxMajorBump *int    `json:"scaAutofixMaxMajorBump,omitempty"`
	Exploits               *string `json:"exploits,omitempty"`
	Severity               *string `json:"severity,omitempty"`
	ScaAutofixStrategy     *string `json:"scaAutofixStrategy,omitempty"`

	// Clear lists camelCase enforcement field names to reset to NULL (unset) for
	// the org — distinct from an omitted field, which preserves its stored value.
	Clear []string `json:"clear,omitempty"`
}

type CliReachabilityHit

type CliReachabilityHit struct {
	VulnID      string           `json:"vulnId"`
	Purl        string           `json:"purl,omitempty"`
	Source      string           `json:"source,omitempty"`
	Language    string           `json:"language"`
	Name        string           `json:"name"`
	QueryText   string           `json:"queryText"`
	QueryHash   string           `json:"queryHash,omitempty"`
	Description string           `json:"description,omitempty"`
	DerivedBy   string           `json:"derivedBy,omitempty"`
	Captures    []map[string]any `json:"captures,omitempty"`
	Predicates  []map[string]any `json:"predicates,omitempty"`
}

type CliReachabilityPayload

type CliReachabilityPayload struct {
	CveID                  string `json:"cveId"`
	FindingUuid            string `json:"findingUuid,omitempty"`
	PackageName            string `json:"packageName"`
	PackageVersion         string `json:"packageVersion,omitempty"`
	Purl                   string `json:"purl,omitempty"`
	Language               string `json:"language,omitempty"`
	Ecosystem              string `json:"ecosystem,omitempty"`
	Source                 string `json:"source"`
	Verdict                string `json:"verdict"`
	TreeSitterQueryUuid    string `json:"treeSitterQueryUuid,omitempty"`
	QueryHash              string `json:"queryHash,omitempty"`
	MatchedFile            string `json:"matchedFile,omitempty"`
	MatchedRoutine         string `json:"matchedRoutine,omitempty"`
	MatchedModule          string `json:"matchedModule,omitempty"`
	MatchStartLine         int    `json:"matchStartLine,omitempty"`
	MatchEndLine           int    `json:"matchEndLine,omitempty"`
	EvidenceJSON           string `json:"evidenceJSON,omitempty"`
	MemoryVexStatus        string `json:"memoryVexStatus,omitempty"`
	MemoryVexJustification string `json:"memoryVexJustification,omitempty"`
	MemoryVexAction        string `json:"memoryVexAction,omitempty"`
	Severity               string `json:"severity,omitempty"`
	FixedVersion           string `json:"fixedVersion,omitempty"`
}

CliReachabilityPayload is one local reachability hit (tree-sitter OR grep-symbol).

type CliReachabilityRequest

type CliReachabilityRequest struct {
	IDs       []string `json:"ids"`
	Languages []string `json:"languages,omitempty"`
}

CliReachabilityRequest restricts queries to specific languages.

type CliRemediationRequest

type CliRemediationRequest struct {
	IDs     []string          `json:"ids"`
	Context map[string]string `json:"context,omitempty"`
}

CliRemediationRequest carries per-id context (ecosystem, packageName, etc.).

type CliResponse

type CliResponse[T any] struct {
	Meta CliResponseMeta
	Data T
}

CliResponse couples meta + the typed payload after decode. Returned by every method so callers can surface tier-gated affordances in the CLI output.

type CliResponseMeta

type CliResponseMeta struct {
	Tier            string          `json:"tier"`
	EndpointVersion string          `json:"endpointVersion"`
	RequestID       string          `json:"requestId"`
	Timestamp       int64           `json:"timestamp"`
	TierGated       map[string]bool `json:"tierGated,omitempty"`
}

CliResponseMeta is the top-level meta block on every response.

type CliSARIFFinding

type CliSARIFFinding struct {
	sarif.Finding

	MemoryVexStatus        string `json:"memoryVexStatus,omitempty"`
	MemoryVexJustification string `json:"memoryVexJustification,omitempty"`
	MemoryVexAction        string `json:"memoryVexAction,omitempty"`

	// Test-suite attribution (set by internal/testsuite). IsTestSuite drives the
	// backend's Finding.isTestSuite column and SSVC LOW-priority deprioritization.
	IsTestSuite        bool     `json:"isTestSuite,omitempty"`
	TestFramework      string   `json:"testFramework,omitempty"`
	TestLanguage       string   `json:"testLanguage,omitempty"`
	TestConfidence     string   `json:"testConfidence,omitempty"`
	TestMatchedPattern string   `json:"testMatchedPattern,omitempty"`
	TestEvidence       []string `json:"testEvidence,omitempty"`
}

CliSARIFFinding mirrors vdb-api/internal/handler/cli_persist_sarif.go.

The SARIF-derived half is the shared sarif.Finding, embedded so the CLI and the server decompose SARIF through exactly the same code. The fields below it are Vulnetix-product concepts a generic SARIF library has no business modelling. Embedding keeps the JSON flat, so the wire shape is unchanged.

type CliSARIFRequest

type CliSARIFRequest struct {
	SARIF    map[string]any    `json:"sarif"`
	Findings []CliSARIFFinding `json:"findings"`
	// IngestionSnapshotUuid is empty on chunk 0 (server creates the snapshot/run)
	// and set on chunks 1..N to the uuid chunk 0 returned, so the server appends
	// each chunk's findings under one snapshot/run instead of creating new ones.
	// Lets the CLI split a large SARIF submission into sub-8-MiB requests.
	IngestionSnapshotUuid string `json:"ingestionSnapshotUuid,omitempty"`
	// Suppressions carries the scan's reconciled ignore rules (nosec directives
	// discovered this run, plus drift-relocated / auto-deactivated existing
	// rules) so the server upserts org Suppression rows keyed by uuid (when
	// known) or the repo/file/ruleId business key. Sent on the first chunk only.
	Suppressions []CliSuppressionMint `json:"suppressions,omitempty"`
	// Attribution names the tool behind a report the CLI relayed rather than
	// produced. Set on the /v2/cli.<category>-sarif routes; absent on first-party
	// scans, where the route's own tool name applies.
	Attribution *CliToolAttribution `json:"attribution,omitempty"`
}

CliSARIFRequest is the shared payload for every SARIF-shaped subcommand (sast / secrets / iac / containers / license).

type CliSARIFResponse

type CliSARIFResponse struct {
	IngestionSnapshot *CliIngestionSnapshot  `json:"ingestionSnapshot,omitempty"`
	Findings          []CliFindingResult     `json:"findings,omitempty"`
	Stats             CliSARIFStats          `json:"stats"`
	Suppressions      []CliSuppressionResult `json:"suppressions,omitempty"`
	// AlreadyIngested reports that this report was published under this
	// analysisKey before and nothing was written. A chunked submission must stop:
	// appending the remaining chunks would add a second copy of their findings to
	// a run that is already complete.
	AlreadyIngested bool `json:"alreadyIngested,omitempty"`
}

CliSARIFResponse is the typed response from every SARIF endpoint.

type CliSARIFStats

type CliSARIFStats struct {
	Findings   int            `json:"findings"`
	Rules      int            `json:"rules"`
	BySeverity map[string]int `json:"bySeverity"`
}

CliSARIFStats summarises the run for end-of-scan CLI output.

type CliSBOMToolMetadata

type CliSBOMToolMetadata struct {
	ToolName    string `json:"toolName,omitempty"`
	ToolVersion string `json:"toolVersion,omitempty"`
	ToolVendor  string `json:"toolVendor,omitempty"`
	ToolHash    string `json:"toolHash,omitempty"`
}

CliSBOMToolMetadata describes the CLI tool itself for the SBOMToolMetadata row.

type CliSCAOptions

type CliSCAOptions struct {
	IncludeReachability *bool `json:"includeReachability,omitempty"`
	IncludeVEX          *bool `json:"includeVEX,omitempty"`
	// Gate-data toggles: request per-package policy signals (PackageInsights)
	// only when a `scan` gate is active, so a plain scan pays nothing extra.
	IncludeCooldown     bool `json:"includeCooldown,omitempty"`     // installed-version publish dates (--cooldown)
	IncludeVersionLag   bool `json:"includeVersionLag,omitempty"`   // full version list (--version-lag)
	IncludeSafeVersions bool `json:"includeSafeVersions,omitempty"` // ranked Safe-Harbour versions (--sca-autofix)
	IncludeEOL          bool `json:"includeEol,omitempty"`          // package-level EOL (--block-eol)
	IncludeMalware      bool `json:"includeMalware,omitempty"`      // malicious-package check (--block-malware)
}

type CliSCAOptionsLite

type CliSCAOptionsLite struct {
	IncludeCooldown   bool `json:"includeCooldown,omitempty"`
	IncludeVersionLag bool `json:"includeVersionLag,omitempty"`
	IncludeEOL        bool `json:"includeEol,omitempty"`
	IncludeMalware    bool `json:"includeMalware,omitempty"`
}

CliSCAOptionsLite is the subset of the SCA option block that makes sense outside a scan. Reachability and VEX are scan-time concerns and have no meaning here.

type CliSCAReachabilityRequest

type CliSCAReachabilityRequest struct {
	IngestionSnapshotUuid string                   `json:"ingestionSnapshotUuid"`
	Results               []CliReachabilityPayload `json:"results"`
}

CliSCAReachabilityRequest is the payload for the reachability post-step.

type CliSCAReachabilityResponse

type CliSCAReachabilityResponse struct {
	Persisted   int    `json:"persisted"`
	Deferred    bool   `json:"deferred,omitempty"`
	SBOMUrl     string `json:"sbomUrl,omitempty"`
	VEXUrl      string `json:"vexUrl,omitempty"`
	OpenVexUuid string `json:"openVexUuid,omitempty"`
}

CliSCAReachabilityResponse is the success body.

type CliSCARequest

type CliSCARequest struct {
	Purls    []string          `json:"purls"`
	Packages []CliPackageEntry `json:"packages,omitempty"`
	Options  CliSCAOptions     `json:"options,omitempty"`
	// IngestionSnapshotUuid is set on discovery chunks (i>0) to the snapshot UUID
	// chunk 0 returned, so the server appends each chunk's findings under one run
	// instead of persisting only chunk 0's. Empty on chunk 0.
	IngestionSnapshotUuid string `json:"ingestionSnapshotUuid,omitempty"`
	// Attribution names the tool behind an SBOM the CLI relayed rather than
	// generated — a syft or trivy CycloneDX document published from CI.
	Attribution *CliToolAttribution `json:"attribution,omitempty"`
}

type CliSCAResponse

type CliSCAResponse struct {
	CycloneDX         map[string]any        `json:"cyclonedx"`
	Reachability      []CliReachabilityHit  `json:"reachability"`
	Stats             CliSCAStats           `json:"stats"`
	IngestionSnapshot *CliIngestionSnapshot `json:"ingestionSnapshot,omitempty"`
	Findings          []CliFindingResult    `json:"findings,omitempty"`
	PackageInsights   []CliPackageInsight   `json:"packageInsights,omitempty"`
}

type CliSCAStats

type CliSCAStats struct {
	PurlsRequested       int `json:"purlsRequested"`
	PurlsResolved        int `json:"purlsResolved"`
	VulnerabilitiesFound int `json:"vulnerabilitiesFound"`
	ReachabilityQueries  int `json:"reachabilityQueries"`
}

type CliSafeHarbourLite

type CliSafeHarbourLite struct {
	Recommendation *CliSafeHarbourRecommendation `json:"recommendation,omitempty"`
}

CliSafeHarbourLite reuses the existing CliSafeHarbourRecommendation rather than declaring a second shape for the same fact.

type CliSafeHarbourPicks

type CliSafeHarbourPicks struct {
	Scheme        string            `json:"scheme,omitempty"`
	Orderable     bool              `json:"orderable,omitempty"`
	Latest        string            `json:"latest,omitempty"`
	Safest        string            `json:"safest,omitempty"`
	Stable        string            `json:"stable,omitempty"`
	Rolling       []string          `json:"rolling,omitempty"`
	RollingDate   string            `json:"rollingDate,omitempty"`
	RollingTarget string            `json:"rollingTarget,omitempty"`
	Reasons       map[string]string `json:"reasons,omitempty"`
}

CliSafeHarbourPicks mirrors the vdb-api per-strategy picks. Stable and RollingTarget are computed for the installed version the request named. A pick the server could not make is empty, with the cause in Reasons keyed by strategy name. The CLI only depends on the stable subset below.

type CliSafeHarbourRecommendation

type CliSafeHarbourRecommendation struct {
	Version string `json:"version,omitempty"`
	Reason  string `json:"reason,omitempty"`
}

type CliSafeHarbourSummary

type CliSafeHarbourSummary struct {
	RecommendedVersions []string                      `json:"recommendedVersions,omitempty"`
	HighestScore        float64                       `json:"highestScore,omitempty"`
	Recommendation      *CliSafeHarbourRecommendation `json:"recommendation,omitempty"`
	// Picks is the server's answer per strategy. An older server omits it, and
	// the CLI then derives the pick from SafeVersions itself.
	Picks *CliSafeHarbourPicks `json:"picks,omitempty"`
}

CliSafeHarbourSummary mirrors the recommendation block returned with ranked safe versions. Recommendation.Version is used as a fallback by --sca-autofix.

type CliSafeHarbourVersion

type CliSafeHarbourVersion struct {
	Version            string   `json:"version,omitempty"`
	VulnerabilityCount int      `json:"vulnerabilityCount,omitempty"`
	SafeHarbourScore   float64  `json:"safeHarbourScore,omitempty"`
	IsMalware          bool     `json:"isMalware,omitempty"`
	ExploitCount       int      `json:"exploitCount,omitempty"`
	CveIds             []string `json:"cveIds,omitempty"`
	// PublishedAt is the release date in Unix ms; older servers omit it.
	PublishedAt *int64 `json:"publishedAt,omitempty"`
}

CliSafeHarbourVersion mirrors the vdb-api SafeHarbourVersion shape used by /v2/cli.sca. The CLI only depends on the stable subset below; extra server-side fields are ignored by encoding/json.

type CliScanRequest

type CliScanRequest struct {
	CliSCARequest
	ContainerImages []string `json:"containerImages,omitempty"`
	IaCFrameworks   []string `json:"iacFrameworks,omitempty"`
	Languages       []string `json:"languages,omitempty"`
}

CliScanRequest is the superset payload for /v2/cli.scan.

type CliSuppression

type CliSuppression struct {
	UUID               string `json:"uuid"`
	RuleID             string `json:"ruleId"`
	Category           string `json:"category"`
	FindingUUID        string `json:"findingUuid"`
	SuppressionType    string `json:"suppressionType"`
	Reason             string `json:"reason"`
	TargetValue        string `json:"targetValue"`
	FilePath           string `json:"filePath"`
	LineNumber         int    `json:"lineNumber"`
	LineRange          string `json:"lineRange"`
	RepositoryFullName string `json:"repositoryFullName"`
	BranchName         string `json:"branchName"`
	IgnoreDays         int    `json:"ignoreDays"`
	CreatedAt          int64  `json:"createdAt"`
	ExpiresAt          int64  `json:"expiresAt"`
	IsActive           bool   `json:"isActive"`

	// The fields below describe the VEX statement behind a rule a VexSource (or
	// an ingested VEX document) made; they are empty for every other rule and
	// for a server that predates them.
	VulnerabilityID  string `json:"vulnerabilityId,omitempty"`
	ProductPurl      string `json:"productPurl,omitempty"`
	ProductPurlBase  string `json:"productPurlBase,omitempty"`
	Justification    string `json:"justification,omitempty"`
	Status           string `json:"status,omitempty"` // OpenVEX status of the statement
	SourceKind       string `json:"sourceKind,omitempty"`
	VexSourceUUID    string `json:"vexSourceUuid,omitempty"`
	Source           string `json:"source,omitempty"`     // the VexSource's name
	SourceType       string `json:"sourceType,omitempty"` // tea, s3, git, path or urls
	SourceRef        string `json:"sourceRef,omitempty"`  // the statement within its document
	SourceDocumentID string `json:"sourceDocumentId,omitempty"`
	// StatementTimestamp is when the statement was made, unix seconds.
	StatementTimestamp int64 `json:"statementTimestamp,omitempty"`
}

CliSuppression mirrors the backend Suppression row (subset). Timestamps are unix seconds.

type CliSuppressionMint

type CliSuppressionMint struct {
	UUID              string `json:"uuid,omitempty"`
	RuleID            string `json:"ruleId,omitempty"`
	Category          string `json:"category,omitempty"`
	SuppressionType   string `json:"suppressionType,omitempty"`
	Reason            string `json:"reason,omitempty"`
	FilePath          string `json:"filePath,omitempty"`
	LineNumber        int    `json:"lineNumber,omitempty"`
	LineRange         string `json:"lineRange,omitempty"`
	CodeSnippet       string `json:"codeSnippet,omitempty"`
	BranchName        string `json:"branchName,omitempty"`
	Origin            string `json:"origin,omitempty"`
	Active            bool   `json:"active"`
	DeactivatedReason string `json:"deactivatedReason,omitempty"`
	Fingerprint       string `json:"fingerprint,omitempty"`
}

CliSuppressionMint is one suppression the CLI wants the server to upsert. Active=true creates-or-updates the row (relocating file/line on drift); Active=false auto-deactivates it (the anchor is gone from the code). The Fingerprint is the CLI's stable local key so it can map the returned uuid back onto its memory.yaml record.

type CliSuppressionResult

type CliSuppressionResult struct {
	Fingerprint string `json:"fingerprint"`
	UUID        string `json:"uuid"`
	Action      string `json:"action,omitempty"` // created | updated | deactivated
}

CliSuppressionResult maps a request Fingerprint to the uuid the server minted/updated, so the CLI can persist the uuid locally for future drift updates.

type CliSuppressionSetRequest

type CliSuppressionSetRequest struct {
	Action             string `json:"action,omitempty"` // "create" | "deactivate"
	UUID               string `json:"uuid,omitempty"`
	RuleID             string `json:"ruleId,omitempty"`
	Category           string `json:"category,omitempty"`
	SuppressionType    string `json:"suppressionType,omitempty"`
	Reason             string `json:"reason,omitempty"`
	TargetValue        string `json:"targetValue,omitempty"`
	FilePath           string `json:"filePath,omitempty"`
	LineNumber         int    `json:"lineNumber,omitempty"`
	LineRange          string `json:"lineRange,omitempty"`
	RepositoryFullName string `json:"repositoryFullName,omitempty"`
	BranchName         string `json:"branchName,omitempty"`
	IgnoreDays         int    `json:"ignoreDays,omitempty"`
	DeactivatedReason  string `json:"deactivatedReason,omitempty"`
}

CliSuppressionSetRequest creates or deactivates a suppression.

type CliSuppressionsGetRequest

type CliSuppressionsGetRequest struct {
	RepositoryFullName string `json:"repositoryFullName,omitempty"`
	BranchName         string `json:"branchName,omitempty"`
	Category           string `json:"category,omitempty"`
	TargetValue        string `json:"targetValue,omitempty"`
	ActiveOnly         bool   `json:"activeOnly,omitempty"`
}

CliSuppressionsGetRequest scopes the read to a repo/branch/category.

type CliSuppressionsListData

type CliSuppressionsListData struct {
	Suppressions []CliSuppression `json:"suppressions"`
	// VexTruncated is true when the server held more VEX-sourced rules than it
	// returns in one reply.
	VexTruncated bool `json:"vexTruncated,omitempty"`
}

CliSuppressionsListData is the data payload of cli.suppressions-get.

type CliSurfaceObservation

type CliSurfaceObservation struct {
	Host string `json:"host"`
	Port int    `json:"port,omitempty"`
	// Method is the element's; ProbeMethod is what the check sent (OPTIONS for a POST route).
	Method       string `json:"method,omitempty"`
	ProbeMethod  string `json:"probeMethod,omitempty"`
	Path         string `json:"path,omitempty"`
	PathTemplate string `json:"pathTemplate,omitempty"`
	ObservedBy   string `json:"observedBy"`
	// Status is a pointer so a failed dial (0) is sent as 0 and never dropped as empty.
	Status        *int   `json:"status,omitempty"`
	AuthChallenge string `json:"authChallenge,omitempty"`
	LatencyMs     int    `json:"latencyMs,omitempty"`
	At            int64  `json:"at,omitempty"`
}

CliSurfaceObservation is one live sighting the liveness check reports.

type CliSurfaceObservationsRequest

type CliSurfaceObservationsRequest struct {
	Observations []CliSurfaceObservation `json:"observations"`
}

CliSurfaceObservationsRequest is the POST /v2/cli.surface-observations body.

type CliSurfaceTarget

type CliSurfaceTarget struct {
	ElementKey   string `json:"elementKey"`
	Kind         string `json:"kind"`
	Host         string `json:"host"`
	Method       string `json:"method"`
	PathTemplate string `json:"pathTemplate"`
}

CliSurfaceTarget is one registered route, operation or host the liveness check probes from inside the customer network.

type CliSurfaceTargetsResponse

type CliSurfaceTargetsResponse struct {
	Targets []CliSurfaceTarget `json:"targets"`
}

CliSurfaceTargetsResponse is the list the server returns.

type CliTestConfigMetadata

type CliTestConfigMetadata struct {
	Path        string `json:"path"`
	Framework   string `json:"framework,omitempty"`
	Language    string `json:"language,omitempty"`
	ContentType string `json:"contentType,omitempty"`
	SHA256      string `json:"sha256,omitempty"`
	Size        int64  `json:"size,omitempty"`
}

CliTestConfigMetadata describes one test-runner configuration file detected in the repository (jest.config.js, pytest.ini, phpunit.xml, …). Metadata only — unlike CliManifestMetadata it never carries the raw body. Mirrors vdb-api/internal/handler/v2_cli_common.go.

type CliToolAttribution

type CliToolAttribution struct {
	ToolName       string `json:"toolName,omitempty"`
	ToolVersion    string `json:"toolVersion,omitempty"`
	Vendor         string `json:"vendor,omitempty"`
	Source         string `json:"source,omitempty"` // "github-actions"
	ArtifactName   string `json:"artifactName,omitempty"`
	FileName       string `json:"fileName,omitempty"`
	Format         string `json:"format,omitempty"` // sarif | cyclonedx | spdx
	InformationURI string `json:"informationUri,omitempty"`
	// AnalysisKey identifies this tool's report within one workflow run
	// ("gha:{runId}:{runAttempt}:{tool}"). Re-publishing the same key reuses the
	// existing ScannerRun instead of minting a duplicate.
	AnalysisKey string `json:"analysisKey,omitempty"`
}

CliToolAttribution names the tool that actually produced a report the CLI relayed rather than generated.

It fills gaps only: the server takes whatever the SARIF document declares in runs[].tool.driver over anything asserted here, because the document is the artefact of record. The category is never carried here at all — it is fixed by the endpoint the report is posted to.

type CliTransitiveFix

type CliTransitiveFix struct {
	Method       string `json:"method"`
	ParentName   string `json:"parentName"`
	ParentTarget string `json:"parentTarget"`
	ChildName    string `json:"childName"`
	ChildTarget  string `json:"childTarget"`
	Ecosystem    string `json:"ecosystem"`
	Reason       string `json:"reason"`
}

CliTransitiveFix mirrors the vdb-api TransitiveFixRecommendation contract.

type CliTriageRequest

type CliTriageRequest struct {
	Severity []string `json:"severity,omitempty"`
	MinCvss  float64  `json:"minCvss,omitempty"`
	MinEpss  float64  `json:"minEpss,omitempty"`
	InKev    *bool    `json:"inKev,omitempty"`
	Since    string   `json:"since,omitempty"`
	Limit    int      `json:"limit,omitempty"`
	Offset   int      `json:"offset,omitempty"`
}

CliTriageRequest mirrors the /v2/triage filters in body form.

type CliVersionStamp

type CliVersionStamp struct {
	Version     string `json:"version"`
	PublishedAt *int64 `json:"publishedAt,omitempty"`
}

CliVersionStamp is one version + its publish date (ms epoch).

type CliVersionStampLite

type CliVersionStampLite struct {
	Version     string `json:"version"`
	PublishedAt *int64 `json:"publishedAt,omitempty"`
}

CliVersionStampLite is one release and when it was published.

type CliVexDocument

type CliVexDocument struct {
	Path    string `json:"path"`
	Format  string `json:"format"` // openvex | cyclonedx | csaf
	Sha256  string `json:"sha256"`
	Content string `json:"content"`
}

CliVexDocument is one document, sent as base64 of its exact bytes.

type CliVexIngestRequest

type CliVexIngestRequest struct {
	Origin         string `json:"origin"`
	ScannerRunUuid string `json:"scannerRunUuid,omitempty"`
	// IngestionSnapshotUuid is the snapshot this run produced. /v2/cli.sca
	// answers with a snapshot uuid and no run uuid, so this is what lets the
	// server find the run when ScannerRunUuid is empty. Not in the shared
	// contract yet; a server that does not read it ignores it.
	IngestionSnapshotUuid string           `json:"ingestionSnapshotUuid,omitempty"`
	RepositoryFullName    string           `json:"repositoryFullName,omitempty"`
	GitCommit             string           `json:"gitCommit,omitempty"`
	Documents             []CliVexDocument `json:"documents"`
}

CliVexIngestRequest is the /v2/cli.vex-ingest payload.

type CliVexIngestResponse

type CliVexIngestResponse struct {
	Documents []CliVexIngestResult `json:"documents"`
}

CliVexIngestResponse is the success body.

type CliVexIngestResult

type CliVexIngestResult struct {
	Path         string   `json:"path"`
	OpenVexUuid  string   `json:"openVexUuid,omitempty"`
	ArtifactUuid string   `json:"artifactUuid,omitempty"`
	Format       string   `json:"format,omitempty"`
	Grounded     bool     `json:"grounded"`
	Statements   int      `json:"statements"`
	Created      []string `json:"created,omitempty"`
	Pending      []string `json:"pending,omitempty"`
	Linked       []string `json:"linked,omitempty"`
	Superseded   []string `json:"superseded,omitempty"`
	Triaged      int      `json:"triaged"`
	Applied      int      `json:"applied"`
	Error        string   `json:"error,omitempty"`
}

CliVexIngestResult is what the server did with one document.

type CliVulnRequest

type CliVulnRequest struct {
	Identifier string `json:"identifier"`
}

CliVulnRequest fetches a single envelope.

type Client

type Client struct {
	BaseURL         string
	APIVersion      string
	OrgID           string
	SecretKey       string
	AuthMethod      auth.AuthMethod
	APIKey          string // hex digest for Direct API Key auth
	Token           string // Authentik API token for Bearer auth
	HTTPClient      *http.Client
	LastRateLimit   *RateLimitInfo
	LastCacheStatus string // "HIT", "MISS", "LOCAL", "REVALIDATED", or "" if no X-Cache header

	Cache         *cache.DiskCache
	NoCache       bool
	RefreshCache  bool
	FallbackCreds *auth.Credentials // community creds to use when quota exhausted; nil = disabled
	UsingFallback bool              // true after client switched to fallback (readable by cmd layer)
	// contains filtered or unexported fields
}

Client represents a VDB API client

func NewClient

func NewClient(orgID, secretKey string) *Client

NewClient creates a new VDB API client using SigV4 auth

func NewClientFromCredentials

func NewClientFromCredentials(creds *auth.Credentials) *Client

NewClientFromCredentials creates a VDB API client from centralized credentials

func (*Client) CliAI

func (c *Client) CliAI(env CliEnv, payload any) (*CliResponse[map[string]any], error)

Remaining stub-class endpoints (ai/trends) — these still use the legacy generic shape; they are not part of the SARIF persistence flow.

func (*Client) CliAIBOM

func (c *Client) CliAIBOM(env CliEnv, req CliAIBOMRequest) (*CliResponse[CliAIBOMResponse], error)

func (*Client) CliAdvisories

func (c *Client) CliAdvisories(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliAffected

func (c *Client) CliAffected(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliAiFirewallBaseline

func (c *Client) CliAiFirewallBaseline(env CliEnv, req CliAiFirewallBaselineRequest) (*CliResponse[CliAiFirewallBaseline], error)

CliAiFirewallBaseline — POST /v2/cli.ai-firewall-baseline. The server's recommended guardrail set. Callers must treat a failure as non-fatal: the endpoint may not exist on the server they are talking to.

func (*Client) CliAiFirewallGet

func (c *Client) CliAiFirewallGet(env CliEnv) (*CliResponse[map[string]any], error)

CliAiFirewallGet — POST /v2/cli.ai-firewall-get. Read-only aggregate of the AI Firewall (guardrails.vulnetix.com) policy: the provider catalog with the org's allow/deny association, the org's model allow/deny entries, and the org's content guardrails. Org is resolved from the authenticated request, so the payload is empty.

func (*Client) CliAiFirewallGuardrail

func (c *Client) CliAiFirewallGuardrail(env CliEnv, req CliAiFirewallGuardrailRequest) (*CliResponse[map[string]any], error)

CliAiFirewallGuardrail — POST /v2/cli.ai-firewall-guardrail. Creates (empty UUID), partially updates (pointer fields), or deletes (Delete=true) a content guardrail.

func (*Client) CliAiFirewallInventory

func (c *Client) CliAiFirewallInventory(env CliEnv, req CliAiFirewallInventoryRequest) (*CliResponse[CliAiFirewallInventory], error)

CliAiFirewallInventory — POST /v2/cli.ai-firewall-inventory. What tools, MCP servers and skills this org's agents actually carry, as observed on the wire.

This answers a question a repository scan cannot: a scan finds the AI that is written down, this finds what ran. It is metadata only — a tool name, an MCP server host, a user-agent — never a prompt, completion, tool argument or tool result, which is why the gateway records it for every org rather than only those that opted into inference logging.

func (*Client) CliAiFirewallKey

func (c *Client) CliAiFirewallKey(env CliEnv, req CliAiFirewallKeyRequest) (*CliResponse[map[string]any], error)

CliAiFirewallKey — POST /v2/cli.ai-firewall-key. Stores (or removes) the org's provider API key. The key is encrypted server-side under a context bound to the org and provider, and is never returned.

func (*Client) CliAiFirewallModel

func (c *Client) CliAiFirewallModel(env CliEnv, req CliAiFirewallModelRequest) (*CliResponse[map[string]any], error)

CliAiFirewallModel — POST /v2/cli.ai-firewall-model. Adds ("allow" | "deny") or removes ("remove") model policy entries; AnyProvider expands server-side to every provider whose catalog lists the model slug.

func (*Client) CliAiFirewallProvider

func (c *Client) CliAiFirewallProvider(env CliEnv, req CliAiFirewallProviderRequest) (*CliResponse[map[string]any], error)

CliAiFirewallProvider — POST /v2/cli.ai-firewall-provider. Sets ("allow" | "deny") or clears ("clear") the org's association for a provider slug.

func (*Client) CliAiFirewallSettings

func (c *Client) CliAiFirewallSettings(env CliEnv, req CliAiFirewallSettingsRequest) (*CliResponse[map[string]any], error)

CliAiFirewallSettings — POST /v2/cli.ai-firewall-settings. Org-wide toggles.

func (*Client) CliAiFirewallState

func (c *Client) CliAiFirewallState(env CliEnv) (*CliResponse[CliAiFirewallState], error)

CliAiFirewallState is CliAiFirewallGet decoded into typed structs. Same route: an older server simply leaves the newer fields (hasKey, logsEnabled, gateway) at their zero values.

func (*Client) CliApiSpecs

CliApiSpecs — POST /v2/cli.api-specs. Upload the OpenAPI and Swagger documents found in a repository.

func (*Client) CliAttackTechniques

func (c *Client) CliAttackTechniques(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliBinaryAnalyze

CliBinaryAnalyze — POST /v2/cli.analyze. Sends the full binary scan payload (ELF metadata, hashes, weaknesses, CIRCL correlation, MalwareBazaar results) to the server for persistence and CVE correlation.

func (*Client) CliCBOM

func (c *Client) CliCBOM(env CliEnv, req CliCBOMRequest) (*CliResponse[CliCBOMResponse], error)

func (*Client) CliContainerSources

CliContainerSources — POST /v2/cli.container-sources.

func (*Client) CliContainers

func (c *Client) CliContainers(env CliEnv, req CliSARIFRequest) (*CliResponse[CliSARIFResponse], error)

func (*Client) CliCweGuidance

func (c *Client) CliCweGuidance(env CliEnv, cweIDs []string) (*CliResponse[map[string]any], error)

CliCweGuidance — POST /v2/cli.cwe-guidance.

func (*Client) CliExploits

func (c *Client) CliExploits(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

CliExploits — POST /v2/cli.exploits.

func (*Client) CliFinalize

func (c *Client) CliFinalize(env CliEnv, req CliFinalizeRequest) (*CliResponse[CliFinalizeResponse], error)

CliFinalize — POST /v2/cli.finalize. The final leg: report the scan's policy gate decision (exit code + per-gate breaches) anchored to the IngestionSnapshot.uuid so the server records it on the env row.

func (*Client) CliFinalizeDeferred

func (c *Client) CliFinalizeDeferred(env CliEnv, req CliFinalizeRequest) (*CliResponse[CliFinalizeResponse], error)

CliFinalizeDeferred is CliFinalize answered at once, recorded after the response (see CliSCAReachabilityDeferred).

func (*Client) CliFixes

func (c *Client) CliFixes(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

CliFixes — POST /v2/cli.fixes. Replaces the 3-call registry/distributions/source dance.

func (*Client) CliGHAStatus

CliGHAStatus — POST /v2/cli.gha-status. Reports what `gha upload` recorded for a workflow run.

func (*Client) CliGitHub

func (c *Client) CliGitHub(ctx context.Context, env CliEnv, req CliSARIFRequest) (*CliResponse[CliSARIFResponse], error)

CliGitHub posts GitHub posture SARIF (`vulnetix gha audit` and the other gha analysis tasks) to /v2/cli.github, where it is stored as an IAC snapshot attributed to "Vulnetix GitHub".

func (*Client) CliGitHubAdvisories

func (c *Client) CliGitHubAdvisories(ctx context.Context, env CliEnv, refs []CliGitHubActionRef) (*CliResponse[CliGitHubAdvisoriesResponse], error)

CliGitHubAdvisories asks /v2/cli.github.advisories for the advisories that affect the action versions refs name (rule VNX-GH-105). Nothing is stored.

func (*Client) CliIAC

func (*Client) CliIOCs

func (c *Client) CliIOCs(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliImage

func (c *Client) CliImage(env CliEnv, req CliImageRequest) (*CliResponse[CliImageResponse], error)

CliImage — POST /v2/cli.image. Gzipped: an image's package list is large.

func (*Client) CliInsights

func (c *Client) CliInsights(env CliEnv, req CliInsightsRequest) (*CliResponse[CliInsightsResponse], error)

CliInsights submits one analyze run. The body is gzipped: a report is the whole shape of a repository and does not fit an uncompressed envelope.

func (*Client) CliInsightsDeferred

func (c *Client) CliInsightsDeferred(env CliEnv, req CliInsightsRequest) (*CliResponse[CliInsightsResponse], error)

CliInsightsDeferred is CliInsights for a caller that does not read the answer (a scan's graph-insights upload): the API answers at once and stores the report after the response. An API that predates deferral answers in full.

func (*Client) CliJail

CliJail evaluates the org's jail policy for this repo.

Uses the context variant so a gate honours the pipeline's deadline rather than the client's 180s default, and so a 429 or 503 surfaces as a typed *CliAPIError the caller can decide about instead of an opaque string.

func (*Client) CliJailExempt

CliJailExempt creates or retires a jail exemption.

func (*Client) CliKev

func (c *Client) CliKev(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

CliKev — POST /v2/cli.kev.

func (*Client) CliLicense

func (c *Client) CliLicense(env CliEnv, req CliSARIFRequest) (*CliResponse[CliSARIFResponse], error)

func (*Client) CliLicenses

func (c *Client) CliLicenses(ctx context.Context, env CliEnv, req CliLicensesRequest) (*CliResponse[CliLicensesData], error)

CliLicenses asks for the licences earlier scans resolved (POST /v2/cli.licenses).

func (*Client) CliMSRC

func (c *Client) CliMSRC(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

CliMSRC, CliNuclei, CliSnortRules, CliYaraRules, CliAttackTechniques, CliIOCs, CliSightings, CliAdvisories, CliWorkarounds, CliAffected all share the { ids: [...] } shape on the wire.

func (*Client) CliMalscan

func (c *Client) CliMalscan(env CliEnv, req CliMalscanRequest) (*CliResponse[CliMalscanResponse], error)

CliMalscan — POST /v2/cli.malscan. Persists a malware ScannerRun + snapshot + Finding/Triage/OpenVEX + MalwareIoc rows (with S3-stored samples).

func (*Client) CliMalwareCurationGet

func (c *Client) CliMalwareCurationGet(env CliEnv) (*CliResponse[map[string]any], error)

CliMalwareCurationGet — POST /v2/cli.malware-curation-get. Read-only: the global malware-curation consensus (fp-cleared packages/IOCs, downgraded/ allowed threat actors), handed to the malscan-engine curation set so a local scan honours community false-positive feedback before reporting. Org resolved from auth, so the payload is empty.

func (*Client) CliNuclei

func (c *Client) CliNuclei(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliOrgVex added in v4.23.0

func (c *Client) CliOrgVex(env CliEnv, req CliOrgVexRequest) (*CliResponse[CliOrgVexReply], error)

CliOrgVex — POST /v2/cli.vex, read for the organisation's own statements. The server returns at most 500 for one call.

func (*Client) CliPackageFirewallConfig

func (c *Client) CliPackageFirewallConfig(env CliEnv, req CliPackageFirewallConfigRequest) (*CliResponse[map[string]any], error)

func (*Client) CliPackageFirewallGet

func (c *Client) CliPackageFirewallGet(env CliEnv) (*CliResponse[map[string]any], error)

CliPackageFirewallGet — POST /v2/cli.package-firewall-get. Read-only: returns the org's policy ({"config": {...}|null}) plus every mirror across all ecosystems ({"mirrors": [...]}). Org is resolved from the authenticated request, so the payload is empty.

func (*Client) CliPackageFirewallMirror

func (c *Client) CliPackageFirewallMirror(env CliEnv, req CliPackageFirewallMirrorRequest) (*CliResponse[map[string]any], error)

func (*Client) CliPackageInsights

func (*Client) CliQualityGateConfig

func (c *Client) CliQualityGateConfig(env CliEnv, req CliQualityGateConfigRequest) (*CliResponse[map[string]any], error)

CliQualityGateConfig — POST /v2/cli.quality-gate-config. Upserts the org's EOL-severity quality-gate policy. Only changed fields are sent (pointer fields nil otherwise), so an unset severity preserves its current value.

func (*Client) CliQualityGateGet

func (c *Client) CliQualityGateGet(env CliEnv) (*CliResponse[map[string]any], error)

CliQualityGateGet — POST /v2/cli.quality-gate-get. Read-only: returns the org's quality-gate policy ({"config": {...}|null}). Org is resolved from the authenticated request, so the payload is empty.

func (*Client) CliReachability

func (c *Client) CliReachability(env CliEnv, req CliReachabilityRequest) (*CliResponse[map[string]any], error)

CliReachability — POST /v2/cli.reachability. Tier-gated on the server.

func (*Client) CliRemediation

func (c *Client) CliRemediation(env CliEnv, req CliRemediationRequest) (*CliResponse[map[string]any], error)

CliRemediation — POST /v2/cli.remediation.

func (*Client) CliSAST

func (c *Client) CliSAST(env CliEnv, req CliSARIFRequest) (*CliResponse[CliSARIFResponse], error)

SARIF-shaped scan endpoints. Each returns the same persistence response (IngestionSnapshot + Findings + Stats) so the CLI's snapshot-URL output is uniform across kinds.

func (*Client) CliSCA

func (c *Client) CliSCA(env CliEnv, req CliSCARequest) (*CliResponse[CliSCAResponse], error)

CliSCA — POST /v2/cli.sca. The flagship: PURLs + env → CycloneDX 1.6 + reachability + stats in a single round-trip.

func (*Client) CliSCAReachability

CliSCAReachability — POST /v2/cli.sca-reachability. The second leg of the SCA round-trip: send per-CVE local reachability evidence anchored to the IngestionSnapshot.uuid returned from /v2/cli.sca.

func (*Client) CliSCAReachabilityDeferred

func (c *Client) CliSCAReachabilityDeferred(env CliEnv, req CliSCAReachabilityRequest) (*CliResponse[CliSCAReachabilityResponse], error)

CliSCAReachabilityDeferred is CliSCAReachability for a caller that does not read the answer: the API answers at once ({"deferred": true}, no counts or URLs) and records the results after the response. An API that predates deferral answers in full.

func (*Client) CliSCAWithContext

func (c *Client) CliSCAWithContext(ctx context.Context, env CliEnv, req CliSCARequest) (*CliResponse[CliSCAResponse], error)

func (*Client) CliScan

func (c *Client) CliScan(env CliEnv, req CliScanRequest) (*CliResponse[CliSCAResponse], error)

CliScan — POST /v2/cli.scan. Superset of CliSCA with container/IaC inputs.

func (*Client) CliScorecard

func (c *Client) CliScorecard(env CliEnv, purls []string) (*CliResponse[map[string]any], error)

CliScorecard — POST /v2/cli.scorecard.

func (*Client) CliSecrets

func (c *Client) CliSecrets(env CliEnv, req CliSARIFRequest) (*CliResponse[CliSARIFResponse], error)

func (*Client) CliSightings

func (c *Client) CliSightings(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliSnortRules

func (c *Client) CliSnortRules(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliSuppressionsGet

func (c *Client) CliSuppressionsGet(env CliEnv, req CliSuppressionsGetRequest) (*CliResponse[CliSuppressionsListData], error)

CliSuppressionsGet — POST /v2/cli.suppressions-get. Read-only: repo-scoped active suppressions for the authenticated org.

func (*Client) CliSuppressionsSet

func (c *Client) CliSuppressionsSet(env CliEnv, req CliSuppressionSetRequest) (*CliResponse[map[string]any], error)

CliSuppressionsSet — POST /v2/cli.suppressions. Create or deactivate a rule.

func (*Client) CliSurfaceObservations

func (c *Client) CliSurfaceObservations(ctx context.Context, env CliEnv, req CliSurfaceObservationsRequest) (*CliResponse[map[string]any], error)

CliSurfaceObservations — POST /v2/cli.surface-observations. The sightings.

func (*Client) CliSurfaceTargets

func (c *Client) CliSurfaceTargets(ctx context.Context, env CliEnv, repo string) (*CliResponse[CliSurfaceTargetsResponse], error)

CliSurfaceTargets — POST /v2/cli.surface-targets. The elements to check.

func (*Client) CliThirdPartySARIF

func (c *Client) CliThirdPartySARIF(ctx context.Context, env CliEnv, category sarif.Category, req CliSARIFRequest) (*CliResponse[CliSARIFResponse], error)

CliThirdPartySARIF posts a SARIF document produced by a tool other than Vulnetix to POST /v2/cli.<category>-sarif.

The category is part of the URL rather than the payload on purpose: it is the one thing the server will not let a client assert, so IaC misconfigurations cannot be filed as SAST findings. Route names come from the shared module, so the CLI and the server cannot drift apart on them.

func (*Client) CliTrends

func (c *Client) CliTrends(env CliEnv, payload any) (*CliResponse[map[string]any], error)

func (*Client) CliTriage

func (c *Client) CliTriage(env CliEnv, req CliTriageRequest) (*CliResponse[map[string]any], error)

CliTriage — POST /v2/cli.triage.

func (*Client) CliVex

func (c *Client) CliVex(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

CliVex — POST /v2/cli.vex. OpenVEX statements per CVE.

func (*Client) CliVexIngest

CliVexIngest is POST /v2/cli.vex-ingest. It sends VEX documents the CLI read or wrote; the server stores each one and turns its statements into suppression rules. Classification is the server's, so the CLI sends the bytes unchanged.

func (*Client) CliVuln

func (c *Client) CliVuln(env CliEnv, identifier string) (*CliResponse[map[string]any], error)

CliVuln — POST /v2/cli.vuln. Single-vuln envelope + metrics.

func (*Client) CliWorkarounds

func (c *Client) CliWorkarounds(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CliYaraRules

func (c *Client) CliYaraRules(env CliEnv, ids []string) (*CliResponse[map[string]any], error)

func (*Client) CritLookup

func (c *Client) CritLookup(provider, service, resourceType string) (*CritLookupResponse, error)

CritLookup queries the VDB for vulnerabilities matching a CRIT template. The CRIT template is defined by provider (e.g. "aws"), service (e.g. "ec2"), and resourceType (e.g. "instance").

func (*Client) DoRequest

func (c *Client) DoRequest(method, path string, body interface{}) ([]byte, error)

DoRequest performs an authenticated API request with retry for transient errors.

func (*Client) DoRequestCached

func (c *Client) DoRequestCached(method, path string, body interface{}, ttl time.Duration) ([]byte, error)

DoRequestCached performs an authenticated, cached GET request. For non-GET or when cache is disabled, it falls through to DoRequest.

func (*Client) DoRequestGzip

func (c *Client) DoRequestGzip(method, path string, body interface{}) ([]byte, error)

DoRequestGzip is DoRequest with the body compressed.

For an ordinary request this would be pointless ceremony. For one that carries the whole shape of a repository — every node, every metric, one evidence record per thing any metric counted — it is the difference between a request that fits and a request that does not: an analyze report of 12 MB goes over the wire in well under one.

func (*Client) EOLPackageVersion

func (c *Client) EOLPackageVersion(ecosystem, packageName, version string) (*EOLReleaseResponse, error)

EOLPackageVersion retrieves EOL lifecycle data for a specific package version. Returns (nil, nil) when the package/version is not in the VDB EOL database (404). Endpoint: GET /v1/eol/packages/{ecosystem}/{package}/versions/{version}

func (*Client) EOLProduct

func (c *Client) EOLProduct(product string) (*EOLProductResponse, error)

EOLProduct retrieves product metadata and all releases for an EOL product.

func (*Client) EOLRelease

func (c *Client) EOLRelease(product, release string) (*EOLReleaseResponse, error)

EOLRelease retrieves lifecycle data for a specific product release.

func (*Client) GetCVE

func (c *Client) GetCVE(cveID string) (*CVEInfo, error)

GetCVE retrieves full vulnerability data for a specific CVE

func (*Client) GetCVEFixes

func (c *Client) GetCVEFixes(identifier string) (map[string]interface{}, error)

GetCVEFixes retrieves fix data for a specific CVE identifier

func (*Client) GetCVETimeline

func (c *Client) GetCVETimeline(identifier string, params TimelineParams) (map[string]interface{}, error)

GetCVETimeline retrieves the vulnerability timeline from the v1 API.

func (*Client) GetCVEsByDateRange

func (c *Client) GetCVEsByDateRange(start, end string) (map[string]interface{}, error)

GetCVEsByDateRange retrieves paginated CVEs by date range

func (*Client) GetDerivedAPIKey

func (c *Client) GetDerivedAPIKey() (*APIKeyResponse, error)

GetDerivedAPIKey retrieves the static API key derived from SigV4 credentials.

func (*Client) GetEcosystemGroupPackage

func (c *Client) GetEcosystemGroupPackage(ecosystem, group, artifact string) (map[string]interface{}, error)

GetEcosystemGroupPackage retrieves Maven-style group/artifact information in a specific ecosystem

func (*Client) GetEcosystemPackage

func (c *Client) GetEcosystemPackage(ecosystem, pkg string) (map[string]interface{}, error)

GetEcosystemPackage retrieves package information scoped to a specific ecosystem

func (*Client) GetEcosystemPackageVersions

func (c *Client) GetEcosystemPackageVersions(ecosystem, pkg string) (map[string]interface{}, error)

GetEcosystemPackageVersions retrieves version information for a package in a specific ecosystem

func (*Client) GetEcosystems

func (c *Client) GetEcosystems() ([]Ecosystem, error)

GetEcosystems retrieves the list of available ecosystems

func (*Client) GetExploitSources

func (c *Client) GetExploitSources() (map[string]interface{}, error)

GetExploitSources retrieves the list of exploit intelligence sources

func (*Client) GetExploitTypes

func (c *Client) GetExploitTypes() (map[string]interface{}, error)

GetExploitTypes retrieves the list of exploit type classifications

func (*Client) GetExploits

func (c *Client) GetExploits(identifier string, limit, offset int) (map[string]interface{}, error)

GetExploits retrieves exploit intelligence for a specific CVE identifier GetExploits reads one vulnerability's exploit intelligence.

limit/offset page the `exploits` array only. The summary counts describe the whole set regardless of the page, because a count of "how much exploitation exists for this CVE" that changed with your page size would be useless. A limit of 0 leaves the server's default in place.

func (*Client) GetFixDistributions

func (c *Client) GetFixDistributions() (map[string]interface{}, error)

GetFixDistributions retrieves the list of supported Linux distributions for fix advisories

func (*Client) GetGCVEIssuances

func (c *Client) GetGCVEIssuances(year, month, limit, offset int) (*GCVEIssuancesResponse, error)

GetGCVEIssuances retrieves GCVE issuances for a given year/month with pagination

func (*Client) GetHealth

func (c *Client) GetHealth() (map[string]interface{}, error)

GetHealth checks the API health endpoint (unauthenticated, root-level path).

func (*Client) GetIdentifiersByMonth

func (c *Client) GetIdentifiersByMonth(year, month, limit, offset int) (*IdentifiersMonthResponse, error)

GetIdentifiersByMonth retrieves CVE identifiers published in a given year/month

func (*Client) GetMetricTypes

func (c *Client) GetMetricTypes() (map[string]interface{}, error)

GetMetricTypes retrieves the list of vulnerability metric/scoring types

func (*Client) GetOpenAPISpec

func (c *Client) GetOpenAPISpec() (map[string]interface{}, error)

GetOpenAPISpec retrieves the OpenAPI specification

func (*Client) GetPackageVersions

func (c *Client) GetPackageVersions(packageName string) (map[string]interface{}, error)

GetPackageVersions retrieves all known versions for a package across ecosystems

func (*Client) GetPackageVulnerabilities

func (c *Client) GetPackageVulnerabilities(packageName string, limit, offset int) (*VulnerabilitiesResponse, error)

GetPackageVulnerabilities retrieves vulnerabilities for a package

func (*Client) GetProductVersion

func (c *Client) GetProductVersion(productName, version string) (map[string]interface{}, error)

GetProductVersion retrieves information for a specific product version

func (*Client) GetProductVersionEcosystem

func (c *Client) GetProductVersionEcosystem(productName, version, ecosystem string) (map[string]interface{}, error)

GetProductVersionEcosystem retrieves product version information scoped to a specific ecosystem

func (*Client) GetProductVersions

func (c *Client) GetProductVersions(productName string, limit, offset int) (*ProductVersionsResponse, error)

GetProductVersions retrieves all versions for a product with pagination

func (*Client) GetSources

func (c *Client) GetSources() (map[string]interface{}, error)

GetSources retrieves the list of vulnerability data sources

func (*Client) GetSummary

func (c *Client) GetSummary() (map[string]interface{}, error)

GetSummary retrieves global all-time database statistics.

func (*Client) GetToken

func (c *Client) GetToken() (string, error)

GetToken retrieves a valid JWT token (from cache or by requesting a new one)

func (*Client) GetTrafficFilters

func (c *Client) GetTrafficFilters(identifier string, limit, offset int) (map[string]interface{}, error)

GetTrafficFilters retrieves IDS/IPS traffic filter rules (Snort) for a vulnerability.

func (*Client) SearchExploits

func (c *Client) SearchExploits(params ExploitSearchParams) (map[string]interface{}, error)

SearchExploits searches for exploits across CVEs with pagination and filters

func (*Client) SearchIdentifiers

func (c *Client) SearchIdentifiers(prefix string, limit, offset int) (*IdentifiersSearchResponse, error)

SearchIdentifiers retrieves CVE identifiers matching a prefix

func (*Client) SearchPackages

func (c *Client) SearchPackages(query, ecosystem string, limit, offset int) (map[string]interface{}, error)

SearchPackages performs a full-text search across packages

func (*Client) V2Advisories

func (c *Client) V2Advisories(id string) (map[string]interface{}, error)

V2Advisories retrieves advisory data for a vulnerability.

func (*Client) V2Affected

func (c *Client) V2Affected(id string, p V2QueryParams) (map[string]interface{}, error)

V2Affected retrieves affected product/package data for a vulnerability.

func (*Client) V2AffectedBatch

func (c *Client) V2AffectedBatch(ctx context.Context, env CliEnv, lookups []AffectedLookup) []AffectedResult

V2AffectedBatch answers many affected-record lookups: from the local response cache where V2AffectedCached would, and the rest in POST /v2/cli.affected-batch requests, whose items the API serves exactly as the single route. Answers are cached as V2AffectedCached caches them. A batch request that fails gives every item it carried that error, so the caller can ask for each on its own.

func (*Client) V2AffectedCached

func (c *Client) V2AffectedCached(id string, p V2QueryParams) (map[string]interface{}, error)

V2AffectedCached is V2Affected served from the local response cache for up to affectedCacheTTL. A scan asks for the same advisories every run (dozens for a Ruby or Python project), one round trip each.

func (*Client) V2AttackTechniques

func (c *Client) V2AttackTechniques(id string) (map[string]interface{}, error)

V2AttackTechniques retrieves the ATT&CK technique mapping for a single CVE.

func (*Client) V2AttackTechniquesSearch

func (c *Client) V2AttackTechniquesSearch(p AttackTechniquesSearchParams) (map[string]interface{}, error)

V2AttackTechniquesSearch performs a collection-wide search for ATT&CK technique mappings across CVEs.

func (*Client) V2CloudLocators

func (c *Client) V2CloudLocators(vendor, product string) (map[string]interface{}, error)

V2CloudLocators retrieves cloud resource locator templates for a vendor/product pair.

func (*Client) V2CountermeasureSearch

func (c *Client) V2CountermeasureSearch(p DefenceSearchParams) (map[string]interface{}, error)

V2CountermeasureSearch searches the countermeasure catalogue.

func (*Client) V2Countermeasures

func (c *Client) V2Countermeasures(id string) (map[string]interface{}, error)

V2Countermeasures retrieves the detection artifacts linked to one advisory.

func (*Client) V2CweGuidance

func (c *Client) V2CweGuidance(id string) (map[string]interface{}, error)

V2CweGuidance retrieves CWE-based guidance for a vulnerability.

func (*Client) V2DefenceArchive

func (c *Client) V2DefenceArchive(lane, uuid string) ([]byte, error)

V2DefenceArchive downloads one defence rule as the file its tool expects.

Returns the raw bytes, not JSON: the response is a Snort rule, a Sigma document, a STIX bundle or an OpenIOC file depending on the artifact's kind. lane is "virtual-patches" or "countermeasures".

func (*Client) V2DefenceCounts

func (c *Client) V2DefenceCounts(items []DefenceCountsItem) (*DefenceCountsResponse, error)

V2DefenceCounts counts virtual patches and countermeasures for many inputs: counts for every plan, the defences with their console links for Pro. More than DefenceCountsMaxItems items are sent in several requests and the results joined in order.

func (*Client) V2DefenceSearch

func (c *Client) V2DefenceSearch(lane string, p DefenceSearchParams) (map[string]interface{}, error)

V2DefenceSearch searches one lane's catalogue ("virtual-patches" or "countermeasures"). Inputs too long for a query string (a SWID tag, a CEL expression) go as a JSON body to the same route.

func (*Client) V2DistributionPatches

func (c *Client) V2DistributionPatches(id string, p V2QueryParams) (map[string]interface{}, error)

V2DistributionPatches retrieves distribution patch data for a vulnerability.

func (*Client) V2ExploitPoC

func (c *Client) V2ExploitPoC(exploitUUID string) (body []byte, filename, sha256, originalURL string, err error)

V2ExploitPoC — GET /v2/exploits/{exploitUuid}/poc. Returns raw bytes, the original filename (from Content-Disposition), and the SHA-256 hash (from X-Vulnetix-Sha256). The CLI uses these to write a file with a chain-of-custody-friendly name + integrity check.

func (*Client) V2IOCsSearch

func (c *Client) V2IOCsSearch(p IOCSearchParams) ([]byte, string, error)

V2IOCsSearch returns the raw response body so the caller can switch on `format` (the STIX bundle is not JSON-shape compatible).

func (*Client) V2Kev

func (c *Client) V2Kev(id string) (map[string]interface{}, error)

V2Kev retrieves CISA KEV (Known Exploited Vulnerabilities) data.

func (*Client) V2KevSearch

func (c *Client) V2KevSearch(p KevSearchParams) (map[string]interface{}, error)

func (*Client) V2RawArchive

func (c *Client) V2RawArchive(source, cveID string) (body []byte, contentType, sha256, r2Path string, err error)

V2RawArchive — GET /v2/raw/{source}/{cveId}. Returns raw bytes + content-type + sha256.

func (*Client) V2RawSources

func (c *Client) V2RawSources() (map[string]interface{}, error)

V2RawSources — GET /v2/raw/sources.

func (*Client) V2RegistryFixes

func (c *Client) V2RegistryFixes(id string, p V2QueryParams) (map[string]interface{}, error)

V2RegistryFixes retrieves registry-sourced fixes for a vulnerability.

func (*Client) V2RemediationPlan

func (c *Client) V2RemediationPlan(id string, p V2RemediationParams) (map[string]interface{}, error)

V2RemediationPlan retrieves a context-aware remediation plan for a vulnerability.

func (*Client) V2ResolveInputs

func (c *Client) V2ResolveInputs(in Inputs) (*ResolvedInputs, error)

V2ResolveInputs asks the API what the inputs resolve to: the vulnerability ids (aliases included) and how each input was read.

func (*Client) V2Scorecard

func (c *Client) V2Scorecard(id string) (map[string]interface{}, error)

V2Scorecard retrieves the vulnerability scorecard.

func (*Client) V2ScorecardSearch

func (c *Client) V2ScorecardSearch(query string) (map[string]interface{}, error)

V2ScorecardSearch searches scorecards by repository name.

func (*Client) V2SnortRules

func (c *Client) V2SnortRules(id string) (map[string]interface{}, error)

V2SnortRules retrieves a CVE's Snort rules (per-CVE endpoint).

func (*Client) V2SnortRulesSearch

func (c *Client) V2SnortRulesSearch(p SnortSearchParams) (map[string]interface{}, error)

V2SnortRulesSearch performs a collection-wide search for Snort rules with expressive filters.

func (*Client) V2SourceFixes

func (c *Client) V2SourceFixes(id string, p ...V2QueryParams) (map[string]interface{}, error)

V2SourceFixes retrieves upstream source fixes for a vulnerability.

func (*Client) V2Timeline

func (c *Client) V2Timeline(id string, p V2TimelineParams) (map[string]interface{}, error)

V2Timeline retrieves the vulnerability timeline with optional filters.

func (*Client) V2TreeSitterQueries

func (c *Client) V2TreeSitterQueries(id string, p V2TreeSitterParams) (*TreeSitterResponse, error)

V2TreeSitterQueries retrieves tree-sitter S-expression queries derived from the named vulnerability. Returns a typed response (unlike most v2 helpers) because the scanner consumes the result programmatically.

func (*Client) V2Triage

func (c *Client) V2Triage(p TriageParams) (map[string]interface{}, error)

func (*Client) V2VexSearch

func (c *Client) V2VexSearch(p VexSearchParams) (map[string]interface{}, error)

func (*Client) V2VirtualPatchSearch

func (c *Client) V2VirtualPatchSearch(p DefenceSearchParams) (map[string]interface{}, error)

V2VirtualPatchSearch searches the virtual-patch catalogue.

func (*Client) V2VirtualPatches

func (c *Client) V2VirtualPatches(id string) (map[string]interface{}, error)

V2VirtualPatches retrieves the blocking defences linked to one advisory.

func (*Client) V2VulnDefences

func (c *Client) V2VulnDefences(lane, identifier string) (map[string]interface{}, error)

V2VulnDefences retrieves one lane's defences for an identifier: a vulnerability id, or in its place a purl, CPE or TEI.

func (*Client) V2VulnExploits

func (c *Client) V2VulnExploits(id string) (map[string]interface{}, error)

V2VulnExploits — GET /v2/vuln/{id}/exploits.

func (*Client) V2VulnIOCs

func (c *Client) V2VulnIOCs(id string) (map[string]interface{}, error)

func (*Client) V2VulnNuclei

func (c *Client) V2VulnNuclei(id string) (map[string]interface{}, error)

V2VulnNuclei — GET /v2/vuln/{id}/nuclei. The CLI calls without format for the JSON listing, then optionally re-fetches with format=yaml&first=true to print a single template body.

func (*Client) V2VulnNucleiYAML

func (c *Client) V2VulnNucleiYAML(id string, first bool) ([]byte, error)

V2VulnNucleiYAML — GET /v2/vuln/{id}/nuclei?format=yaml. Returns the raw YAML body. With first=true, returns the first template alone.

func (*Client) V2VulnSightings

func (c *Client) V2VulnSightings(id string) (map[string]interface{}, error)

V2VulnSightings — GET /v2/vuln/{id}/sightings.

func (*Client) V2VulnVex

func (c *Client) V2VulnVex(id string) (map[string]interface{}, error)

V2VulnVex — GET /v2/vuln/{id}/vex.

func (*Client) V2Workarounds

func (c *Client) V2Workarounds(id string) (map[string]interface{}, error)

V2Workarounds retrieves workaround information for a vulnerability.

func (*Client) V2YaraRules

func (c *Client) V2YaraRules(id string) (map[string]interface{}, error)

V2YaraRules retrieves a CVE's YARA rules (per-CVE endpoint).

func (*Client) V2YaraRulesSearch

func (c *Client) V2YaraRulesSearch(p YaraSearchParams) (map[string]interface{}, error)

V2YaraRulesSearch performs a collection-wide search for YARA rules.

func (*Client) VerifyAuth

func (c *Client) VerifyAuth() error

VerifyAuth issues a cheap authenticated request to confirm the client's credentials are accepted, populating LastRateLimit as a side effect.

func (*Client) VulnetixKevGet

func (c *Client) VulnetixKevGet(cveID string) (map[string]any, error)

VulnetixKevGet fetches the KEV entry for a CVE.

It searches every catalogue the API folds together, not only Vulnetix's own. Vulnetix's catalogue is deliberately the CVEs that CISA and ENISA do not list, so searching it alone answered "not in the Vulnetix KEV catalogue" for Log4Shell, Heartbleed and Spring4Shell, which reads as "not a known exploited vulnerability". The result names each catalogue that lists the CVE.

The API exposes the catalogues as a paged collection, so this lists and filters client-side. It returns a NotFoundError if no catalogue lists the CVE.

func (*Client) VulnetixKevList

func (c *Client) VulnetixKevList(p VulnetixKevParams) ([]byte, error)

VulnetixKevList fetches the full Vulnetix KEV catalogue. The response bytes are returned verbatim — JSON or CSV per p.Format — so callers can write them straight to stdout or a file.

Forces the V2 API (/v2/vulnetix-kev is V2-only).

type CritLookupExploits

type CritLookupExploits struct {
	Count   int      `json:"count"`
	Sources []string `json:"sources,omitempty"`
}

CritLookupExploits contains exploit intelligence summary.

type CritLookupKev

type CritLookupKev struct {
	DateAdded                  string `json:"dateAdded"`
	DueDate                    string `json:"dueDate,omitempty"`
	KnownRansomwareCampaignUse string `json:"knownRansomwareCampaignUse,omitempty"`
	RequiredAction             string `json:"requiredAction,omitempty"`
}

CritLookupKev contains CISA KEV metadata.

type CritLookupMatch

type CritLookupMatch struct {
	Crit           CritRecord            `json:"crit"`
	VulnID         string                `json:"vuln_id"`
	Aliases        []string              `json:"aliases,omitempty"`
	Kev            *CritLookupKev        `json:"kev,omitempty"`
	ExploitSummary *CritLookupExploits   `json:"exploit_summary,omitempty"`
	SnortRules     []CritLookupSnortRule `json:"snort_rules,omitempty"`
}

CritLookupMatch is a single matched CRIT record with enrichment data.

type CritLookupResponse

type CritLookupResponse struct {
	Count   int               `json:"count"`
	Matches []CritLookupMatch `json:"matches"`
}

CritLookupResponse is the response from POST /v1/crit/lookup.

type CritLookupSnortRule

type CritLookupSnortRule struct {
	SnortID           string `json:"snortId"`
	Msg               string `json:"msg"`
	SignatureSeverity string `json:"signatureSeverity,omitempty"`
	RawText           string `json:"rawText,omitempty"`
}

CritLookupSnortRule contains an IDS detection rule.

type CritRecord

type CritRecord struct {
	VectorString         string `json:"vectorString"`
	VulnID               string `json:"vuln_id"`
	Provider             string `json:"provider"`
	Service              string `json:"service"`
	ResourceType         string `json:"resource_type"`
	VexStatus            string `json:"vex_status"`
	SharedResponsibility string `json:"shared_responsibility"`
}

CritRecord represents a CRIT (Cloud Resource Inventory Template) record.

type DefenceBrief

type DefenceBrief struct {
	UUID              string `json:"uuid"`
	Kind              string `json:"kind"`
	Title             string `json:"title"`
	DeployMode        string `json:"deployMode,omitempty"`
	Confidence        string `json:"confidence,omitempty"`
	FalsePositiveRisk string `json:"falsePositiveRisk,omitempty"`
	MatchedCve        string `json:"matchedCve,omitempty"`
	ConsoleURL        string `json:"consoleUrl"`
}

DefenceBrief is one defence as the counts endpoint lists it.

type DefenceCountsItem

type DefenceCountsItem struct {
	Key string `json:"key,omitempty"`
	Inputs
}

DefenceCountsItem is one input set to count defences for. Key is echoed back on its result.

type DefenceCountsResponse

type DefenceCountsResponse struct {
	SchemaVersion string                `json:"schemaVersion"`
	Tier          string                `json:"tier"`
	Items         []DefenceCountsResult `json:"items"`
	Entitlements  json.RawMessage       `json:"_entitlements,omitempty"`
}

DefenceCountsResponse is the bulk counts answer.

func (*DefenceCountsResponse) Gated

func (r *DefenceCountsResponse) Gated() bool

Gated reports whether the plan withheld the defence lists.

type DefenceCountsResult

type DefenceCountsResult struct {
	Key             string             `json:"key,omitempty"`
	Resolved        *ResolvedInputs    `json:"resolved,omitempty"`
	VirtualPatches  *DefenceLaneCounts `json:"virtualPatches,omitempty"`
	Countermeasures *DefenceLaneCounts `json:"countermeasures,omitempty"`
	Error           *DefenceItemError  `json:"error,omitempty"`
}

DefenceCountsResult is one item's answer.

type DefenceItemError

type DefenceItemError struct {
	Field   string `json:"field"`
	Message string `json:"message"`
	Status  int    `json:"status"`
}

DefenceItemError is an item's inputs the caller must fix; the other items are still answered.

func (*DefenceItemError) Error

func (e *DefenceItemError) Error() string

type DefenceLaneCounts

type DefenceLaneCounts struct {
	Total    int            `json:"total"`
	ByKind   map[string]int `json:"byKind"`
	HasMore  bool           `json:"hasMore"`
	Defences []DefenceBrief `json:"defences"`
}

DefenceLaneCounts is one lane's answer for one item. Defences is nil when the caller's plan does not include them (the counts are still there).

type DefenceSearchParams

type DefenceSearchParams struct {
	Inputs        Inputs   // what to find defences for, in any input kind
	Kinds         []string // output format (SNORT, SIGMA, STIX, …)
	CveIDs        []string // kept for callers that predate Inputs; sent as vulnId
	Confidence    string   // HIGH | MEDIUM | LOW
	DeployMode    string   // log | block (virtual patches only)
	ExploitSource string   // source slug of the originating exploit
	Q             string   // free text over title, description and rule body
	Limit         int
	Offset        int
}

DefenceSearchParams carries the filters for the virtual-patch and countermeasure catalogue searches. All fields are optional.

type EOLLatest

type EOLLatest struct {
	Name *string `json:"name,omitempty"`
	Date *string `json:"date,omitempty"`
	Link *string `json:"link,omitempty"`
}

EOLLatest is the newest release the feed knows of for a lifecycle entry.

type EOLProductDetail

type EOLProductDetail struct {
	Name           string             `json:"name"`
	Label          string             `json:"label"`
	Category       string             `json:"category"`
	Tags           []string           `json:"tags"`
	Aliases        []string           `json:"aliases,omitempty"`
	VersionCommand *string            `json:"versionCommand,omitempty"`
	Releases       []EOLReleaseDetail `json:"releases"`
}

EOLProductDetail contains product metadata and every release the EOL database tracks for it.

Releases is nested here, not at the top level of the response: the server returns {"product": {..., "releases": [...]}}, and a top-level Releases field decoded to nil on every product without any error surfacing.

type EOLProductResponse

type EOLProductResponse struct {
	Timestamp int64            `json:"timestamp"`
	Product   EOLProductDetail `json:"product"`
}

EOLProductResponse is the response from GET /v1/eol/products/{product}.

type EOLReleaseDetail

type EOLReleaseDetail struct {
	Name             string  `json:"name"`
	Codename         *string `json:"codename,omitempty"`
	Label            string  `json:"label"`
	ReleaseDate      *string `json:"releaseDate,omitempty"`
	IsLts            bool    `json:"isLts"`
	LtsFrom          *string `json:"ltsFrom,omitempty"`
	IsEoas           bool    `json:"isEoas"`
	EoasFrom         *string `json:"eoasFrom,omitempty"`
	IsEol            bool    `json:"isEol"`
	EolFrom          *string `json:"eolFrom,omitempty"`
	IsEoes           *bool   `json:"isEoes,omitempty"`
	EoesFrom         *string `json:"eoesFrom,omitempty"`
	IsDiscontinued   *bool   `json:"isDiscontinued,omitempty"`
	DiscontinuedFrom *string `json:"discontinuedFrom,omitempty"`
	IsMaintained     bool    `json:"isMaintained"`
	// Latest is an object on the wire — {"name","date","link"} — not the flat
	// latestVersion/latestDate pair this type used to declare, which never
	// decoded to anything.
	Latest *EOLLatest `json:"latest,omitempty"`
}

EOLReleaseDetail contains lifecycle data for a single release.

func (EOLReleaseDetail) LatestDate

func (r EOLReleaseDetail) LatestDate() *string

LatestDate returns the newest known release date, or nil when the feed has none.

func (EOLReleaseDetail) LatestVersion

func (r EOLReleaseDetail) LatestVersion() *string

LatestVersion returns the newest known version, or nil when the feed has none.

type EOLReleaseResponse

type EOLReleaseResponse struct {
	Timestamp   int64            `json:"timestamp"`
	ProductName string           `json:"productName"`
	Release     EOLReleaseDetail `json:"release"`
}

EOLReleaseResponse is the response from GET /v1/eol/products/{product}/releases/{release}.

type Ecosystem

type Ecosystem struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

Ecosystem represents a single ecosystem entry

type EcosystemsResponse

type EcosystemsResponse struct {
	Timestamp  int64       `json:"timestamp"`
	Ecosystems []Ecosystem `json:"ecosystems"`
}

EcosystemsResponse represents the ecosystems list response

type ErrorResponse

type ErrorResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
	Details string `json:"details,omitempty"`
}

ErrorResponse represents an API error response

type ExploitSearchParams

type ExploitSearchParams struct {
	Limit     int
	Offset    int
	Ecosystem string
	Source    string
	Severity  string
	Sort      string
	Query     string
	InKev     string
	MinEpss   string
}

type GCVEIssuanceIdentifier

type GCVEIssuanceIdentifier struct {
	GcveID        string `json:"gcveId"`
	CveID         string `json:"cveId"`
	DatePublished int64  `json:"datePublished"`
}

GCVEIssuanceIdentifier represents a single GCVE issuance record

type GCVEIssuancesResponse

type GCVEIssuancesResponse struct {
	Timestamp   int64                    `json:"timestamp"`
	Year        int                      `json:"year"`
	Month       int                      `json:"month"`
	Total       int                      `json:"total"`
	Limit       int                      `json:"limit"`
	Offset      int                      `json:"offset"`
	HasMore     bool                     `json:"hasMore"`
	Identifiers []GCVEIssuanceIdentifier `json:"identifiers"`
}

GCVEIssuancesResponse represents the paginated GCVE issuances response

type IOCSearchParams

type IOCSearchParams struct {
	CveIDs     []string
	Countries  []string
	ASNs       []int
	Behavior   string
	Reputation string
	Since      string
	Limit      int
	Offset     int
	Format     string // json | stix
}

IOCSearchParams ─ GET /v2/iocs.

type IdentifiersMonthResponse

type IdentifiersMonthResponse struct {
	Timestamp   int64    `json:"timestamp"`
	Year        int      `json:"year"`
	Month       int      `json:"month"`
	Total       int      `json:"total"`
	Limit       int      `json:"limit"`
	Offset      int      `json:"offset"`
	HasMore     bool     `json:"hasMore"`
	Identifiers []string `json:"identifiers"`
}

IdentifiersMonthResponse represents the paginated CVE identifiers response by month

type IdentifiersSearchResponse

type IdentifiersSearchResponse struct {
	Timestamp   int64    `json:"timestamp"`
	Prefix      string   `json:"prefix"`
	Total       int      `json:"total"`
	Limit       int      `json:"limit"`
	Offset      int      `json:"offset"`
	HasMore     bool     `json:"hasMore"`
	Identifiers []string `json:"identifiers"`
}

IdentifiersSearchResponse represents the paginated CVE identifiers search response

type Inputs

type Inputs struct {
	VulnIDs   []string `json:"vulnIds,omitempty"`
	Package   string   `json:"package,omitempty"`
	Ecosystem string   `json:"ecosystem,omitempty"`
	Version   string   `json:"version,omitempty"`
	Vendor    string   `json:"vendor,omitempty"`
	Product   string   `json:"product,omitempty"`
	CPE       string   `json:"cpe,omitempty"`
	PURL      string   `json:"purl,omitempty"`
	SWID      string   `json:"swid,omitempty"`
	TEI       string   `json:"tei,omitempty"`
	CEL       string   `json:"cel,omitempty"`
}

Inputs names a vulnerability or software in any of the forms the API accepts. Every field is optional.

func (Inputs) Empty

func (in Inputs) Empty() bool

Empty reports whether no input kind is set.

func (Inputs) Encode

func (in Inputs) Encode(q url.Values)

Encode adds the inputs to a query string under the API's parameter names.

func (Inputs) Kinds

func (in Inputs) Kinds() []string

Kinds lists the input kinds set, in a fixed order, for display.

func (Inputs) Label

func (in Inputs) Label() string

Label is a short description of the inputs, for output and analytics.

func (Inputs) NeedsBody

func (in Inputs) NeedsBody() bool

NeedsBody reports whether the inputs belong in a JSON body rather than a query string: a SWID tag or a CEL expression, or anything long.

type KevSearchParams

type KevSearchParams struct {
	CveIDs    []string
	Sources   []string // CISA | vulnetix | enisa | vulncheck (repeat for OR; default = all four)
	Reason    string
	Since     string
	Until     string
	DueBefore string
	DueAfter  string
	Vendor    string
	Product   string
	Sort      string // due | added | cve
	Limit     int
	Offset    int
}

KevSearchParams ─ GET /v2/kev (the 4-source merged collection).

type NotFoundError

type NotFoundError struct {
	Message string
}

NotFoundError is returned when the API responds with 404.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

type PlanLockedError

type PlanLockedError struct {
	Feature      string
	RequiredPlan string
	// Addon is the add-on kind the server says is missing ("package_firewall" or
	// "soc_intelligence"), read from `_entitlements.addon`. Empty when the lock is
	// a plan tier.
	Addon string
}

PlanLockedError is returned when the server declined a write because the organisation's subscription does not include the feature. It is a distinct type so a caller can tell "your plan does not cover this" from "the request was wrong" and say so precisely.

func (*PlanLockedError) Error

func (e *PlanLockedError) Error() string

type ProductVersionsResponse

type ProductVersionsResponse struct {
	PackageName string          `json:"packageName"`
	Timestamp   int64           `json:"timestamp"`
	Total       int             `json:"total"`
	Limit       int             `json:"limit"`
	Offset      int             `json:"offset"`
	HasMore     bool            `json:"hasMore"`
	Versions    []VersionRecord `json:"versions"`
}

ProductVersionsResponse represents product versions with pagination

type RateLimitInfo

type RateLimitInfo struct {
	DayLimit   int    // RateLimit-DayLimit  (0 = unlimited)
	Remaining  int    // RateLimit-Remaining (-1 = unlimited)
	Reset      int    // RateLimit-Reset     (Unix epoch seconds)
	Plan       string // X-VDB-Plan          (community/pro/teams/enterprise)
	SoftLimits bool   // X-Softlimits        (true = advisory only, never blocked)
	Present    bool
}

RateLimitInfo holds rate limit data returned in API response headers. Headers are informational — the CLI never enforces limits based on them; only actual HTTP 429 responses trigger retry/backoff.

type ResolvedInputs

type ResolvedInputs struct {
	Kinds        []string `json:"kinds"`
	VulnIDs      []string `json:"vulnIds"`
	Truncated    bool     `json:"truncated,omitempty"`
	Versionless  bool     `json:"versionless,omitempty"`
	AnyEcosystem bool     `json:"anyEcosystem,omitempty"`
	Packages     []struct {
		Ecosystem string `json:"ecosystem,omitempty"`
		Name      string `json:"name"`
		Version   string `json:"version,omitempty"`
	} `json:"packages,omitempty"`
	Products []struct {
		Vendor  string `json:"vendor,omitempty"`
		Product string `json:"product"`
		Version string `json:"version,omitempty"`
	} `json:"products,omitempty"`
}

ResolvedInputs is what the API read the inputs as.

type SnortSearchParams

type SnortSearchParams struct {
	CveIDs           []string
	Sources          []string
	Techniques       []string // MITRE ATT&CK T-id (any of)
	Tactics          []string // MITRE ATT&CK TA-id (any of)
	Classtype        string
	Severity         string
	Protocol         string
	Action           string
	DstPort          string
	SrcPort          string
	Disabled         string // "true" / "false" / ""
	Q                string // free-text on msg + rawText
	AffectedProducts []string
	Tags             []string
	Since            string // RFC3339
	Until            string // RFC3339
	Sort             string // recent | severity | id
	Limit            int
	Offset           int
}

SnortSearchParams carries the optional filter knobs for V2SnortRulesSearch. All fields are optional; zero-valued slices and strings are skipped.

type TimelineParams

type TimelineParams struct {
	Include     string // comma-separated event types to include
	Exclude     string // comma-separated event types to exclude
	Dates       string // comma-separated CVE date fields: published,modified,reserved
	ScoresLimit int    // max score-change events (default 30, max 365)
}

ExploitSearchParams holds parameters for the exploit search endpoint TimelineParams holds filter parameters for the /vuln/{id}/timeline endpoint.

type TokenCache

type TokenCache struct {
	Token     string
	ExpiresAt time.Time
}

TokenCache stores the JWT token and its expiration

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
	Iss   string `json:"iss"`
	Sub   string `json:"sub"`
	Exp   int64  `json:"exp"`
}

TokenResponse represents the JWT token response

type TreeSitterCapture

type TreeSitterCapture struct {
	Name string `json:"name"`
	Kind string `json:"kind,omitempty"`
}

TreeSitterCapture describes a named capture inside a tree-sitter query.

type TreeSitterFilters

type TreeSitterFilters struct {
	Language  string `json:"language,omitempty"`
	Ecosystem string `json:"ecosystem,omitempty"`
	VulnID    string `json:"vulnId,omitempty"`
}

TreeSitterFilters echoes the filter parameters back on the response.

type TreeSitterPredicate

type TreeSitterPredicate struct {
	Kind    string   `json:"kind"`
	Name    string   `json:"name"`
	Negated bool     `json:"negated"`
	Args    []string `json:"args"`
}

TreeSitterPredicate describes a predicate or directive attached to a query (e.g. #eq?, #match?, #set!).

type TreeSitterQuery

type TreeSitterQuery struct {
	VulnID      string                `json:"vulnId,omitempty"`
	Source      string                `json:"source,omitempty"`
	Ecosystems  []string              `json:"ecosystems,omitempty"`
	Language    string                `json:"language"`
	Name        string                `json:"name"`
	Description string                `json:"description,omitempty"`
	QueryText   string                `json:"queryText"`
	QueryHash   string                `json:"queryHash,omitempty"`
	DerivedBy   string                `json:"derivedBy,omitempty"`
	CreatedAt   int64                 `json:"createdAt,omitempty"`
	Captures    []TreeSitterCapture   `json:"captures,omitempty"`
	Predicates  []TreeSitterPredicate `json:"predicates,omitempty"`
	Directives  []TreeSitterPredicate `json:"directives,omitempty"`
}

TreeSitterQuery is a single S-expression query derived from CVE/OSV data by vdb-manager. The CLI runs these against source files to determine reachability of a vulnerable pattern.

type TreeSitterResponse

type TreeSitterResponse struct {
	Identifier string            `json:"identifier"`
	Filters    TreeSitterFilters `json:"filters"`
	Queries    []TreeSitterQuery `json:"queries"`
}

TreeSitterResponse is the body of GET /vuln/{id}/tree-sitter.

type TriageParams

type TriageParams struct {
	MinEpss           *float64
	MinEpssPercentile *float64
	MinCess           *float64
	MinCvss           *float64
	Severity          string
	InKev             string // "true" / "false" / ""
	KevSources        []string
	CWEs              []string
	Vendor            string
	Product           string
	Since             string
	WindowDays        int // 0 = unset; 1..30
	Sort              string
	Limit             int
	Offset            int
}

TriageParams ─ GET /v2/triage.

type V2QueryParams

type V2QueryParams struct {
	Ecosystem   string
	PackageName string
	Vendor      string
	Product     string
	Distro      string
	Purl        string
	Limit       int
	Offset      int
}

V2QueryParams holds common context-filter query parameters for V2 endpoints.

type V2RemediationParams

type V2RemediationParams struct {
	V2QueryParams
	CurrentVersion           string
	PackageManager           string
	ContainerImage           string
	OS                       string
	Registry                 string
	IncludeGuidance          bool
	IncludeVerificationSteps bool
}

V2RemediationParams extends V2QueryParams with remediation-plan-specific parameters.

type V2TimelineParams

type V2TimelineParams struct {
	Include     string // comma-separated event types to include
	Exclude     string // comma-separated event types to exclude
	Dates       string // comma-separated CVE date fields: published,modified,reserved
	ScoresLimit int    // max score-change events (default 30, max 365)
}

V2TimelineParams holds filter parameters for the v2 timeline endpoint.

type V2TreeSitterParams

type V2TreeSitterParams struct {
	Language  string
	Ecosystem string
}

V2TreeSitterParams filters the tree-sitter query endpoint.

type VersionRecord

type VersionRecord struct {
	Version   string          `json:"version"`
	Ecosystem string          `json:"ecosystem"`
	Sources   []VersionSource `json:"sources"`
	CVEIDs    []string        `json:"cveIds,omitempty"`
}

VersionRecord represents a single version entry with ecosystem and sources

type VersionSource

type VersionSource struct {
	SourceTable string                 `json:"sourceTable"`
	SourceID    string                 `json:"sourceId"`
	Metadata    map[string]interface{} `json:"metadata,omitempty"`
}

VersionSource represents a data source entry for a product version

func (*VersionSource) UnmarshalJSON

func (s *VersionSource) UnmarshalJSON(data []byte) error

UnmarshalJSON tolerates both shapes the API uses for a version "source": the structured object ({"sourceTable":..,"sourceId":..}) emitted by /product, and the bare string (e.g. "nvd", "GHSA") emitted by /vulns. A bare string is stored as SourceTable so callers see a non-empty source either way.

type VexSearchParams

type VexSearchParams struct {
	CveIDs   []string
	Status   string
	Supplier string
	Since    string
	Limit    int
	Offset   int
}

VexSearchParams ─ GET /v2/vex.

type VulnerabilitiesResponse

type VulnerabilitiesResponse struct {
	PackageName     string          `json:"packageName"`
	Timestamp       int64           `json:"timestamp"`
	TotalCVEs       int             `json:"totalCVEs"`
	Total           int             `json:"total"`
	Limit           int             `json:"limit"`
	Offset          int             `json:"offset"`
	HasMore         bool            `json:"hasMore"`
	Versions        []VersionRecord `json:"versions"`
	Vulnerabilities []VersionRecord `json:"vulnerabilities"` // alternative key used by some API paths
	RawData         interface{}     `json:"-"`               // full parsed response for fallback display
}

VulnerabilitiesResponse represents vulnerabilities for a package

type VulnetixKevParams

type VulnetixKevParams struct {
	Format            string   // "json" | "csv"
	Reasons           []string // filter by VulnetixKevReason enum values
	FilterMode        string   // "any" | "all" (default: any)
	Limit             int      // JSON pagination
	Offset            int      // JSON pagination
	IncludeReferences bool     // JSON-only; adds the `references` bucket per item
	// Include appends authority catalogues as their own rows: "cisa", "enisa".
	// Every row carries `source`. VulnCheck is not an option; it is a vendor
	// superset of CISA, not an authority.
	Include []string
}

VulnetixKevParams holds filter options for GET /v2/vulnetix-kev.

type YaraSearchParams

type YaraSearchParams struct {
	CveIDs      []string
	Sources     []string
	RuleName    string
	Tags        []string
	Imports     []string
	Author      string
	Q           string
	MatchString string
	MatchMeta   string
	Since       string
	Until       string
	Sort        string // recent | name
	Limit       int
	Offset      int
}

YaraSearchParams carries the optional filter knobs for V2YaraRulesSearch.

Jump to

Keyboard shortcuts

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