types

package
v0.0.0-...-20848b4 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArtifactJSONSchemaVersion = 1
	BlobJSONSchemaVersion     = 1
)
View Source
const (
	// Programming language dependencies
	Bundler  = "bundler"
	Cargo    = "cargo"
	Composer = "composer"
	Npm      = "npm"
	NuGet    = "nuget"
	Pipenv   = "pipenv"
	Poetry   = "poetry"
	Yarn     = "yarn"
	Jar      = "jar"
	GoBinary = "gobinary"
	GoMod    = "gomod"

	// Config files
	YAML           = "yaml"
	JSON           = "json"
	TOML           = "toml"
	Dockerfile     = "dockerfile"
	HCL            = "hcl"
	Kubernetes     = "kubernetes"
	CloudFormation = "cloudformation"
	Ansible        = "ansible"
)

Variables

View Source
var (
	InvalidURLPattern = xerrors.New("invalid url pattern")
	ErrNoRpmCmd       = xerrors.New("no rpm command")
)

Functions

This section is empty.

Types

type Application

type Application struct {
	Type      string
	FilePath  string
	Libraries []LibraryInfo
}

type ArtifactDetail

type ArtifactDetail struct {
	OS                *OS                `json:",omitempty"`
	Packages          []Package          `json:",omitempty"`
	Applications      []Application      `json:",omitempty"`
	Misconfigurations []Misconfiguration `json:",omitempty"`
	Size              int                `json:",omitempty"`

	// HistoryPackages are packages extracted from RUN instructions
	HistoryPackages []Package `json:",omitempty"`
}

ArtifactDetail is generated by applying blobs

type ArtifactInfo

type ArtifactInfo struct {
	SchemaVersion int
	Architecture  string
	Created       time.Time
	DockerVersion string
	OS            string

	// HistoryPackages are packages extracted from RUN instructions
	HistoryPackages []Package `json:",omitempty"`
}

ArtifactInfo is stored in cache

type ArtifactReference

type ArtifactReference struct {
	Name        string // image name, tar file name, directory or repository name
	ID          string
	BlobIDs     []string
	RepoTags    []string
	RepoDigests []string
}

ArtifactReference represents a reference of container image, local filesystem and repository

type BlobInfo

type BlobInfo struct {
	SchemaVersion     int
	Digest            string             `json:",omitempty"`
	DiffID            string             `json:",omitempty"`
	OS                *OS                `json:",omitempty"`
	PackageInfos      []PackageInfo      `json:",omitempty"`
	Applications      []Application      `json:",omitempty"`
	Misconfigurations []Misconfiguration `json:",omitempty"`
	OpaqueDirs        []string           `json:",omitempty"`
	WhiteoutFiles     []string           `json:",omitempty"`
	Size              int                `json:",omitempty"`
}

BlobInfo is stored in cache

type Config

type Config struct {
	Type     string
	FilePath string
	Content  interface{}
}

type DockerOption

type DockerOption struct {
	// Auth
	UserName string
	Password string

	// RegistryToken is a bearer token to be sent to a registry
	RegistryToken string

	// ECR
	AwsAccessKey    string
	AwsSecretKey    string
	AwsSessionToken string
	AwsRegion       string

	// GCP
	GcpCredPath string

	InsecureSkipTLSVerify bool
	NonSSL                bool
	SkipPing              bool // this is ignored now
	Timeout               time.Duration
}

type Layer

type Layer struct {
	Digest string `json:",omitempty"`
	DiffID string `json:",omitempty"`
}

type LibraryInfo

type LibraryInfo struct {
	Library godeptypes.Library `json:",omitempty"`
	Layer   Layer              `json:",omitempty"`
}

type MisconfResult

type MisconfResult struct {
	Namespace      string `json:",omitempty"`
	Message        string `json:",omitempty"`
	PolicyMetadata `json:",omitempty"`
}

type MisconfResults

type MisconfResults []MisconfResult

func (MisconfResults) Len

func (r MisconfResults) Len() int

func (MisconfResults) Less

func (r MisconfResults) Less(i, j int) bool

func (MisconfResults) Swap

func (r MisconfResults) Swap(i, j int)

type Misconfiguration

type Misconfiguration struct {
	FileType   string         `json:",omitempty"`
	FilePath   string         `json:",omitempty"`
	Successes  MisconfResults `json:",omitempty"`
	Warnings   MisconfResults `json:",omitempty"`
	Failures   MisconfResults `json:",omitempty"`
	Exceptions MisconfResults `json:",omitempty"`
	Layer      Layer          `json:",omitempty"`
}

type OS

type OS struct {
	Family string
	Name   string
}

type Package

type Package struct {
	Name            string `json:",omitempty"`
	Version         string `json:",omitempty"`
	Release         string `json:",omitempty"`
	Epoch           int    `json:",omitempty"`
	Arch            string `json:",omitempty"`
	SrcName         string `json:",omitempty"`
	SrcVersion      string `json:",omitempty"`
	SrcRelease      string `json:",omitempty"`
	SrcEpoch        int    `json:",omitempty"`
	Modularitylabel string `json:",omitempty"`
	Layer           Layer  `json:",omitempty"`
}

type PackageInfo

type PackageInfo struct {
	FilePath string
	Packages []Package
}

type PolicyInputOption

type PolicyInputOption struct {
	Combine  bool
	Selector PolicyInputSelector
}

type PolicyInputSelector

type PolicyInputSelector struct {
	Types []string
}

type PolicyMetadata

type PolicyMetadata struct {
	ID       string `json:",omitempty"`
	Type     string `json:",omitempty"`
	Title    string `json:",omitempty"`
	Severity string `json:",omitempty"`
}

type SrcPackage

type SrcPackage struct {
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	BinaryNames []string `json:"binaryNames"`
}

Jump to

Keyboard shortcuts

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