types

package
v1.12.4 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 7

Documentation

Index

Constants

View Source
const (
	Image      ScanType = 1
	Tarball    ScanType = 2
	Filesystem ScanType = 3

	JSON          OutputFormat = "json"
	Table         OutputFormat = "table"
	CycloneDXJSON OutputFormat = "cdx-json"
	CycloneDXXML  OutputFormat = "cdx-xml"
	SPDXJSON      OutputFormat = "spdx-json"
	SPDXXML       OutputFormat = "spdx-xml"
	SPDXTag       OutputFormat = "spdx-tag"
	SnapshotJSON  OutputFormat = "snapshot-json"
)
View Source
const ConfigVersion string = "1.0"
View Source
const SchemaVersion = "1.0"

Variables

This section is empty.

Functions

func GetAllOutputFormat

func GetAllOutputFormat() string

func IsValidOutputFormat

func IsValidOutputFormat(format string) bool

func MakeNid

func MakeNid() string

Types

type Address added in v1.12.4

type Address urn.URN

func NewAddress added in v1.12.4

func NewAddress(input string) (Address, error)

func (Address) ToString added in v1.12.4

func (a Address) ToString() string

type AttestationConfig

type AttestationConfig struct {
	Key      string `yaml:"key"`
	Pub      string `yaml:"pub"`
	Password string `yaml:"password"`
}

AttestationConfig model

type AttestationOptions

type AttestationOptions struct {
	Key        string
	Pub        string
	AttestType string
	Predicate  string
	Password   string
	OutputFile string
	OutputType string
}

AttestationOptions model

type Component

type Component struct {
	ID              string        `json:"id"`
	Name            string        `json:"name"`
	Version         string        `json:"version"`
	Type            string        `json:"type"`
	PURL            string        `json:"purl,omitempty"`
	Description     string        `json:"description,omitempty"`
	Origin          string        `json:"origin,omitempty"`
	Licenses        []string      `json:"licenses,omitempty"`
	CPEs            []string      `json:"cpes,omitempty"`
	Metadata        interface{}   `json:"metadata,omitempty"`
	Vulnerabilities []interface{} `json:"vulnerabilities,omitempty"`
}

func NewComponent

func NewComponent(name, version, category, origin, desc string, metadata ...interface{}) Component

func (Component) ToJSON

func (c Component) ToJSON() string

type Config

type Config struct {
	Version      string            `json:"version" yaml:"version"`
	MaxFileSize  int64             `json:"max_file_size" yaml:"max_file_size"`
	Registry     RegistryConfig    `json:"registry" yaml:"registry"`
	Attestation  AttestationConfig `json:"attestation" yaml:"attestation"`
	SecretConfig SecretConfig      `json:"secret_config" yaml:"secret_config"`
}

type GoBinary added in v1.10.0

type GoBinary struct {
	File      string
	Path      string
	BuildInfo *debug.BuildInfo
}

type ImageInfo

type ImageInfo struct {
	Digest     v1.Hash         `json:"digest,omitempty"`
	MediaType  types.MediaType `json:"mediatype,omitempty"`
	Size       int64           `json:"size,omitempty"`
	Manifest   v1.Manifest     `json:"manifest,omitempty"`
	ConfigFile v1.ConfigFile   `json:"config_file,omitempty"`
	Layers     []Layer         `json:"layers,omitempty"`
}

type Layer

type Layer struct {
	Digest    v1.Hash         `json:"digest,omitempty"`
	DiffID    v1.Hash         `json:"diff_id,omitempty"`
	Size      int64           `json:"size,omitempty"`
	MediaType types.MediaType `json:"media_type,omitempty"`
}

type ManifestFile

type ManifestFile struct {
	Content []byte
	Size    int64
	Path    string
	Layer   string
}

func (*ManifestFile) ReadArchiveFileContent

func (m *ManifestFile) ReadArchiveFileContent(file *zip.File) error

func (*ManifestFile) ReadContent

func (m *ManifestFile) ReadContent(file *os.File) error

type Metadata

type Metadata struct {
	Author    string    `json:"author"`
	Timestamp time.Time `json:"timestamp"`
	Tool      string    `json:"tool"`
}

type OSRelease added in v1.10.0

type OSRelease struct {
	File    string                 `json:"file,omitempty"`
	Release map[string]interface{} `json:"release,omitempty"`
}

type OutputFormat

type OutputFormat string

func (OutputFormat) String

func (o OutputFormat) String() string

type Parameters

type Parameters struct {
	ScanType     ScanType     `json:"-"`
	Input        string       `json:"input"`
	OutputFormat OutputFormat `json:"output-format"`
	SaveToFile   string       `json:"save-to-file"`
	Quiet        bool         `json:"quiet"`
	Scanners     []string     `json:"scanners"`
	Provenance   string       `json:"provenance"`
}

func DefaultParameters

func DefaultParameters() Parameters

func (*Parameters) GetScanType

func (p *Parameters) GetScanType() error

type Payload added in v1.12.4

type Payload struct {
	Address Address
	Body    interface{}
}

type RegistryConfig

type RegistryConfig struct {
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

type Release added in v1.10.0

type Release struct {
	PrettyName              string   `json:"prettyName,omitempty"`
	Name                    string   `json:"name,omitempty"`
	ID                      string   `json:"id,omitempty"`
	IDLike                  []string `json:"idLike,omitempty"`
	Version                 string   `json:"version,omitempty"`
	VersionID               string   `json:"versionID,omitempty"`
	VersionCodename         string   `json:"versionCodename,omitempty"`
	BuildID                 string   `json:"buildID,omitempty"`
	ImageID                 string   `json:"imageID,omitempty"`
	ImageVersion            string   `json:"imageVersion,omitempty"`
	Variant                 string   `json:"variant,omitempty"`
	VariantID               string   `json:"variantID,omitempty"`
	DistributionID          string   `json:"distributionID,omitempty"`
	DistributionDescription string   `json:"distributionDescription,omitempty"`
	DistributionCodename    string   `json:"distributionCodename,omitempty"`
	HomeURL                 string   `json:"homeURL,omitempty"`
	DocumentationURL        string   `json:"documentationURL,omitempty"`
	SupportURL              string   `json:"supportURL,omitempty"`
	BugReportURL            string   `json:"bugReportURL,omitempty"`
	PrivacyPolicyURL        string   `json:"privacyPolicyURL,omitempty"`
	CPEName                 string   `json:"cpeName,omitempty"`
	SupportEndDate          string   `json:"supportEndDate,omitempty"`
}

Linux operating system information from /etc/os-release based on the https://www.freedesktop.org/software/systemd/man/latest/os-release.html

type RpmDB

type RpmDB struct {
	Path         string
	Layer        string
	PackageInfos []rpmdb.PackageInfo
}

func (*RpmDB) ReadDBFile

func (r *RpmDB) ReadDBFile(file string) error

type Rule

type Rule struct {
	ID          string   `json:"id" yaml:"id"`
	Description string   `json:"description" yaml:"description"`
	Pattern     string   `json:"pattern" yaml:"pattern"`
	Keywords    []string `json:"keywords" yaml:"keywords"`
}

type SBOM

type SBOM struct {
	Schema     string `json:"schema"`
	Version    string `json:"version"`
	Serial     string `json:"serial"`
	Metadata   `json:"metadata"`
	Total      int         `json:"total"`
	Components []Component `json:"components"`
}

func NewSBOM

func NewSBOM() SBOM

func (SBOM) ToJSON

func (s SBOM) ToJSON() string

type SLSA

type SLSA struct {
	Provenance map[string]interface{} `json:"provenance,omitempty"`
}

type ScanType

type ScanType int

type Secret

type Secret struct {
	Match       string `json:"match"`
	Description string `json:"description"`
	File        string `json:"file"`
	Content     string `json:"content"`
	Line        int    `json:"line"`
}

Secret model

type SecretConfig

type SecretConfig struct {
	Whitelist Whitelist `json:"whitelist" yaml:"whitelist"`
	Rules     []Rule    `json:"rules" yaml:"rules"`
}

type SoftwareManifest

type SoftwareManifest struct {
	SBOM       interface{} `json:"sbom"`
	OS         []OSRelease `json:"os,omitempty"`
	ImageInfo  ImageInfo   `json:"image_info,omitempty"`
	Secrets    []Secret    `json:"secrets,omitempty"`
	Files      []string    `json:"files,omitempty"`
	Parameters Parameters  `json:"parameters"`
	SLSA       SLSA        `json:"slsa,omitempty"`
	Duration   float64     `json:"duration"`
}

type Whitelist

type Whitelist struct {
	Patterns []string `json:"patterns" yaml:"patterns"`
	Keywords []string `json:"keywords" yaml:"keywords"`
}

Jump to

Keyboard shortcuts

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