options

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attest

type Attest struct {
	// IMPORTANT: do not show the attestation key/password in any YAML/JSON output (sensitive information)
	Key      secret `yaml:"key" json:"key" mapstructure:"key"`
	Password secret `yaml:"password" json:"password" mapstructure:"password"`
}

func (*Attest) AddFlags

func (o *Attest) AddFlags(flags clio.FlagSet)

func (*Attest) DescribeFields added in v1.5.0

func (o *Attest) DescribeFields(descriptions clio.FieldDescriptionSet)

type Cache added in v1.7.0

type Cache struct {
	Dir string `yaml:"dir" mapstructure:"dir"`
	TTL string `yaml:"ttl" mapstructure:"ttl"`
}

Cache provides configuration for the Syft caching behavior

func DefaultCache added in v1.7.0

func DefaultCache() Cache

func (*Cache) DescribeFields added in v1.7.0

func (c *Cache) DescribeFields(descriptions clio.FieldDescriptionSet)

func (*Cache) PostLoad added in v1.7.0

func (c *Cache) PostLoad() error

type Catalog

type Catalog struct {
	// high-level cataloger configuration
	Catalogers        []string            `yaml:"-" json:"catalogers" mapstructure:"catalogers"` // deprecated and not shown in yaml output
	DefaultCatalogers []string            `yaml:"default-catalogers" json:"default-catalogers" mapstructure:"default-catalogers"`
	SelectCatalogers  []string            `yaml:"select-catalogers" json:"select-catalogers" mapstructure:"select-catalogers"`
	Package           packageConfig       `yaml:"package" json:"package" mapstructure:"package"`
	File              fileConfig          `yaml:"file" json:"file" mapstructure:"file"`
	Scope             string              `yaml:"scope" json:"scope" mapstructure:"scope"`
	Parallelism       int                 `yaml:"parallelism" json:"parallelism" mapstructure:"parallelism"` // the number of catalog workers to run in parallel
	Relationships     relationshipsConfig `yaml:"relationships" json:"relationships" mapstructure:"relationships"`
	Compliance        complianceConfig    `yaml:"compliance" json:"compliance" mapstructure:"compliance"`
	Enrich            []string            `yaml:"enrich" json:"enrich" mapstructure:"enrich"`

	// ecosystem-specific cataloger configuration
	Golang      golangConfig      `yaml:"golang" json:"golang" mapstructure:"golang"`
	Java        javaConfig        `yaml:"java" json:"java" mapstructure:"java"`
	JavaScript  javaScriptConfig  `yaml:"javascript" json:"javascript" mapstructure:"javascript"`
	LinuxKernel linuxKernelConfig `yaml:"linux-kernel" json:"linux-kernel" mapstructure:"linux-kernel"`
	Python      pythonConfig      `yaml:"python" json:"python" mapstructure:"python"`

	// configuration for the source (the subject being analyzed)
	Registry   registryConfig `yaml:"registry" json:"registry" mapstructure:"registry"`
	From       []string       `yaml:"from" json:"from" mapstructure:"from"`
	Platform   string         `yaml:"platform" json:"platform" mapstructure:"platform"`
	Source     sourceConfig   `yaml:"source" json:"source" mapstructure:"source"`
	Exclusions []string       `yaml:"exclude" json:"exclude" mapstructure:"exclude"`

	// configuration for inclusion of unknown information within elements
	Unknowns unknownsConfig `yaml:"unknowns" mapstructure:"unknowns"`
}

func DefaultCatalog

func DefaultCatalog() Catalog

func (*Catalog) AddFlags

func (cfg *Catalog) AddFlags(flags clio.FlagSet)

func (*Catalog) DescribeFields

func (cfg *Catalog) DescribeFields(descriptions fangs.FieldDescriptionSet)

func (*Catalog) PostLoad

func (cfg *Catalog) PostLoad() error

func (Catalog) ToComplianceConfig added in v1.13.0

func (cfg Catalog) ToComplianceConfig() cataloging.ComplianceConfig

func (Catalog) ToFilesConfig

func (cfg Catalog) ToFilesConfig() filecataloging.Config

func (Catalog) ToPackagesConfig

func (cfg Catalog) ToPackagesConfig() pkgcataloging.Config

func (Catalog) ToRelationshipsConfig

func (cfg Catalog) ToRelationshipsConfig() cataloging.RelationshipsConfig

func (Catalog) ToSBOMConfig

func (cfg Catalog) ToSBOMConfig(id clio.Identification) *syft.CreateSBOMConfig

func (Catalog) ToSearchConfig

func (cfg Catalog) ToSearchConfig() cataloging.SearchConfig

func (Catalog) ToUnknownsConfig added in v1.14.0

func (cfg Catalog) ToUnknownsConfig() cataloging.UnknownsConfig

type Config

type Config struct {
	ConfigFile string `yaml:"config" json:"config" mapstructure:"config"`
}

Config holds a reference to the specific config file(s) that were used to load application configuration

func (*Config) DescribeFields

func (cfg *Config) DescribeFields(descriptions fangs.FieldDescriptionSet)

type Format

type Format struct {
	Pretty        *bool               `yaml:"pretty" json:"pretty" mapstructure:"pretty"`
	Template      FormatTemplate      `yaml:"template" json:"template" mapstructure:"template" description:"all template format options"`
	SyftJSON      FormatSyftJSON      `yaml:"json" json:"json" mapstructure:"json" description:"all syft-json format options"`
	SPDXJSON      FormatSPDXJSON      `yaml:"spdx-json" json:"spdx-json" mapstructure:"spdx-json" description:"all spdx-json format options"`
	CyclonedxJSON FormatCyclonedxJSON `yaml:"cyclonedx-json" json:"cyclonedx-json" mapstructure:"cyclonedx-json" description:"all cyclonedx-json format options"`
	CyclonedxXML  FormatCyclonedxXML  `yaml:"cyclonedx-xml" json:"cyclonedx-xml" mapstructure:"cyclonedx-xml" description:"all cyclonedx-xml format options"`
}

Format contains all user configuration for output formatting.

func DefaultFormat

func DefaultFormat() Format

func (*Format) DescribeFields added in v1.5.0

func (o *Format) DescribeFields(descriptions clio.FieldDescriptionSet)

func (Format) Encoders

func (o Format) Encoders() ([]sbom.FormatEncoder, error)

func (*Format) PostLoad

func (o *Format) PostLoad() error

type FormatCyclonedxJSON

type FormatCyclonedxJSON struct {
	Pretty *bool `yaml:"pretty" json:"pretty" mapstructure:"pretty"`
}

func DefaultFormatCyclonedxJSON

func DefaultFormatCyclonedxJSON() FormatCyclonedxJSON

type FormatCyclonedxXML

type FormatCyclonedxXML struct {
	Pretty *bool `yaml:"pretty" json:"pretty" mapstructure:"pretty"`
}

func DefaultFormatCyclonedxXML

func DefaultFormatCyclonedxXML() FormatCyclonedxXML

type FormatSPDXJSON

type FormatSPDXJSON struct {
	Pretty *bool `yaml:"pretty" json:"pretty" mapstructure:"pretty"`
}

func DefaultFormatSPDXJSON

func DefaultFormatSPDXJSON() FormatSPDXJSON

type FormatSyftJSON

type FormatSyftJSON struct {
	Legacy bool  `yaml:"legacy" json:"legacy" mapstructure:"legacy"`
	Pretty *bool `yaml:"pretty" json:"pretty" mapstructure:"pretty"`
}

func DefaultFormatJSON

func DefaultFormatJSON() FormatSyftJSON

type FormatTemplate

type FormatTemplate struct {
	Enabled bool   `yaml:"-" json:"-" mapstructure:"-"`
	Path    string `yaml:"path" json:"path" mapstructure:"path"` // -t template file to use for output
	Legacy  bool   `yaml:"legacy" json:"legacy" mapstructure:"legacy"`
}

func DefaultFormatTemplate

func DefaultFormatTemplate() FormatTemplate

func (*FormatTemplate) AddFlags

func (o *FormatTemplate) AddFlags(flags clio.FlagSet)

type Output

type Output struct {
	AllowableOptions     []string `yaml:"-" json:"-" mapstructure:"-"`
	AllowMultipleOutputs bool     `yaml:"-" json:"-" mapstructure:"-"`
	AllowToFile          bool     `yaml:"-" json:"-" mapstructure:"-"`
	Outputs              []string `yaml:"output" json:"output" mapstructure:"output"` // -o, the format to use for output
	OutputFile           `yaml:",inline" json:"" mapstructure:",squash"`
	Format               `yaml:"format" json:"format" mapstructure:"format"`
}

Output has the standard output options syft accepts: multiple -o, --file, --template

func DefaultOutput

func DefaultOutput() Output

func (*Output) AddFlags

func (o *Output) AddFlags(flags clio.FlagSet)

func (*Output) DescribeFields added in v1.5.0

func (o *Output) DescribeFields(descriptions clio.FieldDescriptionSet)

func (Output) OutputNameSet

func (o Output) OutputNameSet() *strset.Set

func (*Output) PostLoad

func (o *Output) PostLoad() error

func (Output) SBOMWriter

func (o Output) SBOMWriter() (sbom.Writer, error)

type OutputFile deprecated

type OutputFile struct {
	Enabled    bool   `yaml:"-" json:"-" mapstructure:"-"`
	LegacyFile string `yaml:"-" json:"-" mapstructure:"legacyFile"`
}

Deprecated: OutputFile supports the --file to write the SBOM output to

func (*OutputFile) AddFlags

func (o *OutputFile) AddFlags(flags clio.FlagSet)

func (*OutputFile) PostLoad

func (o *OutputFile) PostLoad() error

func (*OutputFile) SBOMWriter

func (o *OutputFile) SBOMWriter(f sbom.FormatEncoder) (sbom.Writer, error)

type RegistryCredentials

type RegistryCredentials struct {
	Authority string `yaml:"authority" json:"authority" mapstructure:"authority"`
	// IMPORTANT: do not show any credential information, use secret type to automatically redact the values
	Username secret `yaml:"username" json:"username" mapstructure:"username"`
	Password secret `yaml:"password" json:"password" mapstructure:"password"`
	Token    secret `yaml:"token" json:"token" mapstructure:"token"`

	TLSCert string `yaml:"tls-cert,omitempty" json:"tls-cert,omitempty" mapstructure:"tls-cert"`
	TLSKey  string `yaml:"tls-key,omitempty" json:"tls-key,omitempty" mapstructure:"tls-key"`
}

type UpdateCheck

type UpdateCheck struct {
	CheckForAppUpdate bool `yaml:"check-for-app-update" json:"check-for-app-update" mapstructure:"check-for-app-update"` // whether to check for an application update on start up or not
}

func DefaultUpdateCheck

func DefaultUpdateCheck() UpdateCheck

func (*UpdateCheck) DescribeFields

func (cfg *UpdateCheck) DescribeFields(descriptions fangs.FieldDescriptionSet)

Jump to

Keyboard shortcuts

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