schemas

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzeResult

type AnalyzeResult struct {
	// Artifact is the analyzed image reference
	Artifact ArtifactReference `json:"artifact" yaml:"artifact"`

	// ScanTime is when the scan was performed
	ScanTime time.Time `json:"scanTime" yaml:"scanTime"`

	// Vulnerabilities is the list of found vulnerabilities
	Vulnerabilities []Vulnerability `json:"vulnerabilities" yaml:"vulnerabilities"`

	// Summary provides aggregated statistics
	Summary VulnerabilitySummary `json:"summary" yaml:"summary"`
}

AnalyzeResult contains the analysis results

type ArtifactReference

type ArtifactReference struct {
	Host         string  `json:"host"`             // e.g., region-docker.pkg.dev
	ProjectID    string  `json:"projectID"`        // e.g., my-project-id
	RepositoryID string  `json:"repositoryID"`     // e.g., my-app-repo
	ImageName    string  `json:"imageName"`        // e.g., my-service/worker
	Tag          *string `json:"tag,omitempty"`    // e.g., v1.0.0 (nil if not present)
	Digest       *string `json:"digest,omitempty"` // e.g., sha256:e3b0... (nil if not present)
}

ArtifactReference represents the parsed components of a Google Artifact Registry URI.

func (ArtifactReference) MarshalJSON

func (a ArtifactReference) MarshalJSON() ([]byte, error)

MarshalJSON customizes JSON output to include both structured fields and a URI string

func (ArtifactReference) String

func (a ArtifactReference) String() string

String returns a human-readable string representation

func (ArtifactReference) ToResourceURL

func (a ArtifactReference) ToResourceURL(location string) string

ToResourceURL generates the resource URL for Container Analysis API

type Severity

type Severity string

Severity represents the severity level

const (
	SeverityUnspecified Severity = "UNSPECIFIED"
	SeverityMinimal     Severity = "MINIMAL"
	SeverityLow         Severity = "LOW"
	SeverityMedium      Severity = "MEDIUM"
	SeverityHigh        Severity = "HIGH"
	SeverityCritical    Severity = "CRITICAL"
)

type Vulnerability

type Vulnerability struct {
	// ID is the CVE identifier
	ID string `json:"id" yaml:"id"`

	// Severity is the vulnerability severity level
	Severity Severity `json:"severity" yaml:"severity"`

	// PackageName is the affected package
	PackageName string `json:"packageName" yaml:"packageName"`

	// InstalledVersion is the currently installed version
	InstalledVersion string `json:"installedVersion" yaml:"installedVersion"`

	// FixedVersion is the version that fixes the vulnerability (if available)
	FixedVersion string `json:"fixedVersion,omitempty" yaml:"fixedVersion,omitempty"`

	// PackageType indicates the type/category of the vulnerability
	PackageType string `json:"packageType" yaml:"packageType"`

	// Description provides details about the vulnerability
	Description string `json:"description" yaml:"description"`

	// CVSSScore is the CVSS score
	CVSSScore float32 `json:"cvssScore" yaml:"cvssScore"`

	// URLs contains reference links
	URLs []string `json:"urls,omitempty" yaml:"urls,omitempty"`
}

Vulnerability represents a single vulnerability finding

type VulnerabilitySummary

type VulnerabilitySummary struct {
	// TotalCount is the total number of vulnerabilities
	TotalCount int `json:"totalCount" yaml:"totalCount"`

	// CountBySeverity maps severity levels to counts
	CountBySeverity map[Severity]int `json:"countBySeverity" yaml:"countBySeverity"`

	// FixableCount is the number of vulnerabilities with fixes available
	FixableCount int `json:"fixableCount" yaml:"fixableCount"`
}

VulnerabilitySummary provides aggregated statistics

Jump to

Keyboard shortcuts

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