model

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// JSON Output Type
	JSON Output = "json"
	// Table Output Type (Default)
	Table = "table"
	// CycloneDXXML Output Type
	CycloneDXXML = "cyclonedx-xml"
	// CycloneDXJSON Output Type
	CycloneDXJSON = "cyclonedx-json"
	// SPDXJSON Output Type
	SPDXJSON = "spdx-json"
	// SPDXTagValue Output Type
	SPDXTagValue = "spdx-tag-value"
	// SPDXYML Output Type
	SPDXYML = "spdx-yml"
	// GithubJSON Output Type
	GithubJSON = "github-json"
)

Variables

View Source
var (
	// OutputTypes - All Supported Output Types
	OutputTypes = map[string]string{
		JSON.ToOutput(): JSON.ToOutput(),
		Table:           Table,
		CycloneDXXML:    CycloneDXXML,
		CycloneDXJSON:   CycloneDXJSON,
		SPDXJSON:        SPDXJSON,
		SPDXTagValue:    SPDXTagValue,
		SPDXYML:         SPDXYML,
		GithubJSON:      GithubJSON,
	}

	// OutputList - List of supported output types
	OutputList = []string{
		JSON.ToOutput(),
		Table,
		CycloneDXXML,
		CycloneDXJSON,
		SPDXJSON,
		SPDXTagValue,
		SPDXYML,
		GithubJSON}
)
View Source
var DefaultSecretExtensions = []string{"env", "h", "so", "sec", "pem", "properties", "xml", "yml", "yaml", "json", "py", "js", "ts", "PHP"}

DefaultSecretExtensions contains a list of common file extensions containing secrets. Additional Reference: https://blog.gitguardian.com/top-10-file-extensions/

Functions

func NewRegistryAuth added in v1.3.1

func NewRegistryAuth(arguments *Arguments) *types.AuthConfig

NewRegistryAuth returns a new types.AuthConfig struct with the values set from the given model.Arguments struct.

Types

type Arguments

type Arguments struct {
	Image               *string
	Output              *Output
	Quiet               *bool
	OutputFile          *string
	EnabledParsers      *[]string
	DisableFileListing  *bool
	DisablePullTimeout  *bool
	SecretContentRegex  *string
	DisableSecretSearch *bool
	SecretMaxFileSize   int64
	RegistryURI         *string
	RegistryUsername    *string
	RegistryPassword    *string
	RegistryToken       *string
	Dir                 *string
	Tar                 *string
	ExcludedFilenames   *[]string
	SecretExtensions    *[]string
	Provenance          *string
}

Arguments - CLI Arguments

func NewArguments added in v1.3.1

func NewArguments() *Arguments

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
	BomArgs    *Arguments
	Provenance *string
}

AttestationOptions model

type Config

type Config struct {
	Env         []string    `json:"Env"`
	Entrypoint  []string    `json:"Entrypoint"`
	Cmd         []string    `json:"Cmd"`
	Workdir     string      `json:"WorkingDir"`
	ArgsEscaped bool        `json:"ArgsEscaped"`
	OnBuild     interface{} `json:"OnBuild"`
}

Config of DockerConfig

type Configuration

type Configuration struct {
	SecretConfig       SecretConfig      `yaml:"secret-config"`
	EnabledParsers     []string          `yaml:"enabled-parsers"`
	DisableFileListing bool              `yaml:"disable-file-listing"`
	DisablePullTimeout bool              `yaml:"disable-pull-timeout"`
	Quiet              bool              `yaml:"quiet"`
	OutputFile         string            `yaml:"output-file"`
	Output             *[]string         `yaml:"output"`
	Registry           Registry          `yaml:"registry"`
	AttestationConfig  AttestationConfig `yaml:"attestation"`
}

Configuration YAML file config

type Distro

type Distro 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"`
	DistribID          string   `json:"distribID,omitempty"`
	DistribDescription string   `json:"distribDescription,omitempty"`
	DistribCodename    string   `json:"versionCodename,omitempty"`
	HomeURL            string   `json:"homeURL,omitempty"`
	SupportURL         string   `json:"supportURL,omitempty"`
	BugReportURL       string   `json:"bugReportURL,omitempty"`
	PrivacyPolicyURL   string   `json:"privacyPolicyURL,omitempty"`
}

Distro docker image distro

type DockerConfig

type DockerConfig struct {
	Architecture string         `json:"architecture"`
	Config       Config         `json:"config"`
	Created      string         `json:"created"`
	History      []History      `json:"history"`
	OS           string         `json:"os"`
	RootFS       RootFileSystem `json:"rootFS"`
	Variant      string         `json:"variant"`
}

DockerConfig "Config" object from DockerManifest

type DockerManifest

type DockerManifest struct {
	Config   string      `json:"Config"`
	RepoTags interface{} `json:"RepoTags"`
	Layers   interface{} `json:"Layers"`
}

DockerManifest "manifest.json" from docker image

type File

type File struct {
	Path        string      `json:"path"`
	OwnerUID    string      `json:"ownerUid,omitempty"`
	OwnerGID    string      `json:"ownerGid,omitempty"`
	Permissions string      `json:"permissions,omitempty"`
	Digest      interface{} `json:"digest,omitempty"`
}

File - OS Files

type History

type History struct {
	Created    string `json:"created"`
	CreatedBy  string `json:"created_by"`
	EmptyLayer *bool  `json:"empty_layer,omitempty"`
	Comment    string `json:"comment,omitempty"`
}

History of DockerConfig

type ImageInfo

type ImageInfo struct {
	DockerConfig   DockerConfig
	DockerManifest []DockerManifest
}

ImageInfo image information from Docker

type Location

type Location struct {
	Path      string `json:"path"`
	LayerHash string `json:"layerHash"`
}

Location - Package Location

type Output

type Output string

Output type

func (Output) ToOutput

func (c Output) ToOutput() string

ToOutput - returns the output type as string

type PURL

type PURL string

PURL - Package URL

type Package

type Package struct {
	ID              string                 `json:"id"`
	Name            string                 `json:"name"`
	Type            string                 `json:"type"`
	Version         string                 `json:"version"`
	Path            string                 `json:"path"`
	Locations       []Location             `json:"locations"`
	Description     string                 `json:"description,omitempty"`
	Licenses        []string               `json:"licenses,omitempty"`
	CPEs            []string               `json:"cpes"`
	PURL            PURL                   `json:"purl"`
	Metadata        interface{}            `json:"metadata"`
	Vulnerabilities *[]model.Vulnerability `json:"vulnerabilities,omitempty"`
}

Package actual package found

type Registry

type Registry struct {
	URI      string `yaml:"uri"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Token    string `yaml:"token"`
}

Registry config

type RootFileSystem

type RootFileSystem struct {
	Type         string   `json:"type"`
	DifferentIDS []string `json:"diff_ids"`
}

RootFileSystem root fs of DockerConfig

type SBOM added in v1.3.2

type SBOM struct {
	Packages  *[]Package     `json:"packages"`
	Secret    *SecretResults `json:"secrets,omitempty"`
	ImageInfo ImageInfo      `json:"imageInfo"`
	Distro    *Distro        `json:"distro"`
	SLSA      *SLSA          `json:"slsa,omitempty"`
}

type SLSA added in v1.2.0

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

SLSA - SLSA metadata

type Secret

type Secret struct {
	ContentRegexName string `json:"contentRegexName"`
	FileName         string `json:"fileName"`
	FilePath         string `json:"filePath"`
	LineNumber       string `json:"lineNumber"`
}

Secret model

type SecretConfig

type SecretConfig struct {
	Disabled    bool      `yaml:"disabled" json:"disabled"`
	SecretRegex string    `yaml:"secret-regex" json:"secretRegex"`
	Excludes    *[]string `yaml:"excludes-filenames" json:"excludesFilenames"`
	MaxFileSize int64     `yaml:"max-file-size" json:"maxFileSize"`
	Extensions  *[]string `yaml:"extensions" json:"extensions,omitempty"`
}

SecretConfig model

type SecretResults

type SecretResults struct {
	Configuration SecretConfig `json:"applied-configuration"`
	Secrets       []Secret     `json:"secrets"`
}

SecretResults the final result that will be displayed

type Version

type Version struct {
	// Version
	AppName   string `json:"appName"`
	Version   string `json:"version"`
	BuildDate string `json:"buildDate"`
	// Git
	GitCommit string `json:"gitCommit"`
	GitDesc   string `json:"gitDesc"`
	// Golang
	GoVersion string `json:"goVersion"`
	Compiler  string `json:"compiler"`
	Platform  string `json:"platform"`
}

Version - Build Information

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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