Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AllCommands = []struct { Value Command TSName string }{ {CommandConfig, "CONFIG"}, {CommandFilesystem, "FILESYSTEM"}, {CommandImage, "IMAGE"}, {CommandKubernetes, "KUBERNETES"}, {CommandRepo, "REPOSITORY"}, {CommandRootfs, "ROOTFS"}, {CommandSBOM, "SBOM"}, }
View Source
var AllScanners = []struct { Value Scanner TSName string }{ {ScannerVuln, "VULN"}, {ScannerMisconfig, "MISCONFIG"}, {ScannerSecret, "SECRET"}, {ScannerLicense, "LICENSE"}, }
Functions ¶
func RunTrivyScan ¶
func RunTrivyScan( command Command, target string, opts ScanOptions, ) (map[string]interface{}, error)
Wraps the trivy command to run a scan TODO: convert to plugin
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages terminal sessions, allowing creation, attachment, and more.
func NewManager ¶
func NewManager(log *zap.SugaredLogger) *Manager
NewManager initializes a new Manager instance, which allows managing reports and scanning.
func (*Manager) Scan ¶
func (m *Manager) Scan( command Command, target string, opts ScanOptions, ) (ScanResult, error)
Scan runs a trivy scan with the given command, target, and options.
type ScanOptions ¶
type ScanOptions struct { FilePatterns []string `json:"filePatterns" yaml:"filePatterns"` SkipDirs []string `json:"skipDirs" yaml:"skipDirs"` SkipFiles []string `json:"skipFiles" yaml:"skipFiles"` Scanners []Scanner `json:"scanners" yaml:"scanners"` }
func (ScanOptions) String ¶
func (o ScanOptions) String() string
func (ScanOptions) ToArgs ¶
func (o ScanOptions) ToArgs() []string
func (ScanOptions) Validate ¶
func (o ScanOptions) Validate() error
type ScanResult ¶
Click to show internal directories.
Click to hide internal directories.