Documentation ¶
Index ¶
- func DeletePackagesByNameExceptTags(db *gorm.DB, name string, excludeTags []string) error
- type CVSS
- type CVSSData
- type Config
- type CweIDs
- type DataSource
- type ExposedPorts
- type History
- type HistoryArray
- type ImageConfig
- type JSONStringArray
- type Layer
- type Metadata
- type OS
- type Package
- type PkgIdentifier
- type References
- type Report
- type RootFS
- type Scan
- type VendorSeverity
- type Vulnerability
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CVSS ¶
CVSS is a struct that represents the CVSS score.
type Config ¶
type Config struct { ExposedPorts ExposedPorts `json:"ExposedPorts" gorm:"type:jsonb"` User string `json:"User"` WorkingDir string `json:"WorkingDir"` Entrypoint []string `json:"Entrypoint" gorm:"type:text[]"` Env []string `json:"Env" gorm:"type:text[]"` }
Config represents the configuration of the container.
type CweIDs ¶
type CweIDs []string
CweIDs is a slice of strings that represents the CWE IDs.
type DataSource ¶
type DataSource struct { ID string `json:"ID" gorm:"primaryKey"` Name string `json:"Name" gorm:"primaryKey"` URL string `json:"URL" gorm:"primaryKey"` }
DataSource is a struct that represents a data source for vulnerability.
func (*DataSource) Scan ¶
func (d *DataSource) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database deserialization.
type ExposedPorts ¶
type ExposedPorts map[string]interface{}
ExposedPorts represents the exposed ports of the container.
type History ¶
type History struct { Author string `json:"author,omitempty"` Created string `json:"created"` CreatedBy string `json:"created_by"` Comment string `json:"comment"` EmptyLayer bool `json:"empty_layer,omitempty"` }
History represents the history of the image.
type HistoryArray ¶ added in v0.0.8
type HistoryArray []History
HistoryArray is a custom type for handling JSON serialization of History arrays.
type ImageConfig ¶
type ImageConfig struct { Config Config `json:"config" gorm:"embedded"` Architecture string `json:"architecture"` Author string `json:"author"` Created string `json:"created"` OS string `json:"os"` RootFS RootFS `json:"rootfs" gorm:"embedded"` History HistoryArray `json:"history" gorm:"type:jsonb"` }
ImageConfig contains the configuration details of the container image.
type JSONStringArray ¶
type JSONStringArray []string
JSONStringArray custom type for handling JSON serialization of string arrays.
type Metadata ¶
type Metadata struct { ImageConfig ImageConfig `json:"ImageConfig" gorm:"embedded"` OS OS `json:"OS" gorm:"embedded"` ImageID string `json:"ImageID"` DiffIDs JSONStringArray `json:"DiffIDs" gorm:"type:text"` RepoTags JSONStringArray `json:"RepoTags" gorm:"type:text"` RepoDigests JSONStringArray `json:"RepoDigests" gorm:"type:text"` }
Metadata contains additional information about the scanned artifact.
type Package ¶ added in v0.0.8
type Package struct { CreatedAt time.Time `json:"CreatedAt" gorm:"autoCreateTime"` UpdatedAt time.Time `json:"UpdatedAt" gorm:"autoUpdateTime"` Name string `json:"Name"` Repository string `json:"Repository"` Tag string `json:"Tag"` Scans []Scan `json:"Scans" gorm:"foreignKey:PackageID;constraint:OnDelete:CASCADE"` ID uint `json:"ID" gorm:"primaryKey;autoIncrement"` }
Package represents a collection of scans.
type PkgIdentifier ¶
type PkgIdentifier struct { PURL string `json:"PURL" gorm:"primaryKey"` UID string `json:"UID" gorm:"primaryKey"` }
PkgIdentifier is a struct that represents a package identifier pURL.
func (*PkgIdentifier) Scan ¶
func (p *PkgIdentifier) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database deserialization.
type References ¶
type References []string
References is a slice of strings that represents the references.
func (*References) Scan ¶
func (r *References) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database deserialization.
type Report ¶ added in v0.0.10
type Report struct { CreatedAt time.Time `json:"CreatedAt" gorm:"autoCreateTime"` PackageName string `json:"PackageName" gorm:"not null" index:"idx_package_name"` Tag string `json:"Tag" gorm:"not null" index:"idx_tag"` SBOM json.RawMessage `json:"SBOM"` ID uint `json:"ID" gorm:"primaryKey;autoIncrement"` Critical int `json:"Critical"` High int `json:"High"` Medium int `json:"Medium"` Low int `json:"Low"` Info int `json:"Info"` Total int `json:"Total"` }
Report represents a report of a scan.
type RootFS ¶
type RootFS struct { Type string `json:"type"` DiffIDs []string `json:"diff_ids" gorm:"type:text[]"` }
RootFS represents the root filesystem of the image.
type Scan ¶
type Scan struct { CreatedAt time.Time `json:"CreatedAt" gorm:"autoCreateTime"` UpdatedAt time.Time `json:"UpdatedAt" gorm:"autoUpdateTime"` ArtifactName string `json:"ArtifactName"` ArtifactType string `json:"ArtifactType"` Metadata json.RawMessage `json:"Metadata" gorm:"type:jsonb"` Vulnerabilities []Vulnerability `json:"Vulnerabilities" gorm:"foreignKey:ScanID;constraint:OnDelete:CASCADE"` Entrypoint json.RawMessage `json:"Entrypoint" gorm:"type:jsonb"` ID uint `json:"ID" gorm:"primaryKey;autoIncrement"` SchemaVersion int `json:"SchemaVersion"` PackageID uint `json:"PackageID" gorm:"foreignKey:ID;references:ID;constraint:OnDelete:CASCADE"` //nolint:lll }
Scan represents the result of a vulnerability scan.
type VendorSeverity ¶
VendorSeverity is a struct that represents the vendor severity.
func (*VendorSeverity) Scan ¶
func (v *VendorSeverity) Scan(value interface{}) error
Scan implements the sql.Scanner interface for database deserialization.
type Vulnerability ¶
type Vulnerability struct { CreatedAt time.Time `json:"CreatedAt" gorm:"autoCreateTime"` LastModifiedDate time.Time `json:"LastModifiedDate" gorm:"type:timestamp"` PublishedDate time.Time `json:"PublishedDate" gorm:"type:timestamp"` UpdatedAt time.Time `json:"UpdatedAt" gorm:"autoUpdateTime"` CVSS CVSS `json:"CVSS" gorm:"type:jsonb"` VendorSeverity VendorSeverity `json:"VendorSeverity" gorm:"type:jsonb"` DataSource DataSource `json:"DataSource" gorm:"foreignKey:ID,URL;references:ID,URL"` Layer Layer `json:"Layer" gorm:"embedded"` PkgIdentifier PkgIdentifier `json:"PkgIdentifier" gorm:"foreignKey:PURL,UID;references:PURL,UID"` Description string `json:"Description"` FixedVersion string `json:"FixedVersion"` InstalledVersion string `json:"InstalledVersion"` PkgName string `json:"PkgName"` PkgPath string `json:"PkgPath"` PrimaryURL string `json:"PrimaryURL"` Severity string `json:"Severity"` SeveritySource string `json:"SeveritySource"` Status string `json:"Status"` Title string `json:"Title"` VulnerabilityID string `json:"VulnerabilityID"` Target string `json:"Target"` Class string `json:"Class"` Type string `json:"Type"` CweIDs CweIDs `json:"CweIDs" gorm:"type:jsonb"` References References `json:"References" gorm:"type:jsonb"` ScanID uint `json:"ScanID" gorm:"index"` ID uint `gorm:"primaryKey;autoIncrement"` }
Vulnerability is a struct that represents a vulnerability.