misconf

package
v0.62.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPathExists added in v0.61.0

func CheckPathExists(path string) (fs.FileInfo, string, error)

func CreateDataFS added in v0.44.0

func CreateDataFS(dataPaths []string, opts ...string) (fs.FS, []string, error)

func CreatePolicyFS added in v0.44.0

func CreatePolicyFS(policyPaths []string) (fs.FS, []string, error)

func InitRegoScanner added in v0.62.0

func InitRegoScanner(opt ScannerOption) (*rego.Scanner, error)

func NewCauseWithCode

func NewCauseWithCode(underlying scan.Result, flat scan.FlatResult) types.CauseMetadata

func ResultsToMisconf

func ResultsToMisconf(configType types.ConfigType, scannerName string, results scan.Results) []types.Misconfiguration

ResultsToMisconf is exported for trivy-plugin-aqua purposes only

Types

type ConfigFileSchema added in v0.55.0

type ConfigFileSchema struct {
	// contains filtered or unexported fields
}

func LoadConfigSchemas added in v0.55.0

func LoadConfigSchemas(paths []string) ([]*ConfigFileSchema, error)

type DisabledCheck added in v0.57.0

type DisabledCheck struct {
	ID      string
	Scanner string // For logging
	Reason  string // For logging
}

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(t detection.FileType, opt ScannerOption) (*Scanner, error)

func (*Scanner) Scan

func (s *Scanner) Scan(ctx context.Context, fsys fs.FS) ([]types.Misconfiguration, error)

type ScannerOption added in v0.41.0

type ScannerOption struct {
	Trace                    bool
	Namespaces               []string
	PolicyPaths              []string
	DataPaths                []string
	DisableEmbeddedPolicies  bool
	DisableEmbeddedLibraries bool
	IncludeDeprecatedChecks  bool

	HelmValues              []string
	HelmValueFiles          []string
	HelmFileValues          []string
	HelmStringValues        []string
	HelmAPIVersions         []string
	HelmKubeVersion         string
	TerraformTFVars         []string
	CloudFormationParamVars []string
	TfExcludeDownloaded     bool
	K8sVersion              string

	FilePatterns      []string
	ConfigFileSchemas []*ConfigFileSchema

	DisabledChecks []DisabledCheck
	SkipFiles      []string
	SkipDirs       []string

	RegoScanner *rego.Scanner
}

func (*ScannerOption) Sort added in v0.41.0

func (o *ScannerOption) Sort()

Jump to

Keyboard shortcuts

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