Documentation
¶
Index ¶
- Constants
- func AnalyzeLibrary(ctx context.Context, path string, contents []byte, filemode os.FileMode, ...) ([]models.LibraryScanner, error)
- func DetectKBsFromKernelVersion(release, kernelVersion string) (models.WindowsKB, error)
- func EnsureResultDir(resultsDir string, scannedAt time.Time) (currentDir string, err error)
- func ParseInstalledPkgs(distro config.Distro, kernel models.Kernel, pkgList string, ...) (models.Packages, models.SrcPackages, error)
- func ViaHTTP(header http.Header, body string, toLocalFile bool) (models.ScanResult, error)
- type DetectedCveID
- type ParseOption
- type Scanner
Constants ¶
const WindowsUninstallRegistryCmd = `` /* 322-byte string literal not displayed */
WindowsUninstallRegistryCmd is the PowerShell command that the scanner runs to read DisplayName and Publisher from the registry Uninstall keys. Pass its output to WithWindowsUninstallRegistry.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeLibrary ¶ added in v0.21.1
func AnalyzeLibrary(ctx context.Context, path string, contents []byte, filemode os.FileMode, isOffline bool) ([]models.LibraryScanner, error)
AnalyzeLibrary detects libraries defined in lockfiles or artifacts such as JAR files. It calls Trivy’s dependency parsers directly, bypassing the fanal analyzer framework to avoid pulling in unnecessary IaC/misconf dependencies.
func DetectKBsFromKernelVersion ¶ added in v0.23.4
DetectKBsFromKernelVersion detects the KBs from the kernel version
func EnsureResultDir ¶
EnsureResultDir ensures the directory for scan results
func ParseInstalledPkgs ¶ added in v0.15.11
func ParseInstalledPkgs(distro config.Distro, kernel models.Kernel, pkgList string, opts ...ParseOption) (models.Packages, models.SrcPackages, error)
ParseInstalledPkgs parses installed pkgs line Additional inputs for specific OS families can be passed via opts (e.g. WithWindowsUninstallRegistry).
Types ¶
type DetectedCveID ¶
type DetectedCveID struct {
CveID string
Confidence models.Confidence
}
DetectedCveID has CveID, Confidence and DetectionMethod fields LenientMatching will be true if this vulnerability is not detected by accurate version matching. see https://github.com/future-architect/vuls/pull/328
type ParseOption ¶ added in v0.43.0
type ParseOption func(*parseOptions)
ParseOption is an option for ParseInstalledPkgs.
func WithWindowsUninstallRegistry ¶ added in v0.43.0
func WithWindowsUninstallRegistry(stdout string) ParseOption
WithWindowsUninstallRegistry passes the output of WindowsUninstallRegistryCmd. It is ignored for OS families other than Windows.
type Scanner ¶
type Scanner struct {
ResultsDir string
TimeoutSec int
ScanTimeoutSec int
CacheDBPath string
Debug bool
LogToFile bool
LogDir string
Quiet bool
DetectIPS bool
Targets map[string]config.ServerInfo
}
Scanner has functions for scan
func (Scanner) Configtest ¶
Configtest checks if the server is scannable.