ddtrivy

package module
v0.0.0-...-e50f951 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

README

ddtrivy

Datadog wrapper for the Trivy library.

This library includes shared code that is used by the datadog agent, but also by the agentless-scanner. The goal is to make sure the code is in-sync between those two components.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasLinuxPackageFiles

func HasLinuxPackageFiles(rootFS string) (string, bool)

HasLinuxPackageFiles returns true when the target root file system contains a directory supported by Trivy's operating system packages analyzers.

func InitJavaDB

func InitJavaDB(trivyCacheDir string)

func ScanImage

func ScanImage(ctx context.Context, artifactOpts trivyartifact.Option, trivyCache trivycache.Cache, image ftypes.Image) (*trivytypes.Report, error)

ScanImage launches a trivy scan on an image.

func ScanOverlays

func ScanOverlays(ctx context.Context, artifactOpts trivyartifact.Option, trivyCache trivycache.Cache, ctr ftypes.Container) (*trivytypes.Report, error)

ScanOverlays launches a trivy scan on a local filesystem represened by a set of overlays.

func ScanRootFS

func ScanRootFS(ctx context.Context, artifactOpts artifact.Option, trivyCache trivycache.Cache, rootFS string, artifactType ftypes.ArtifactType) (*trivytypes.Report, error)

ScanRootFS launches a trivy scan on a root filesystems.

func TrivyOptionsAll

func TrivyOptionsAll(parallel int) trivyartifact.Option

TrivyOptionsAll returns the default options for trivy to scan application and OS packages.

func TrivyOptionsAllForHosts

func TrivyOptionsAllForHosts(parallel int) trivyartifact.Option

TrivyOptionsAllForHosts returns the default options for trivy to scan applications on possibly big hosts root filesystems. Because TypeIndividualPkgs and TypeExecutable do not implement StaticPathAnalyzer, Trivy falls back to full filesystem traversal. OnlyDirs is required here to restrict the walker's scope: without it the walker would traverse the entire filesystem. osPkgDirs must be included so that the OS analyzers' directories are visited during the full traversal.

func TrivyOptionsOS

func TrivyOptionsOS(parallel int) trivyartifact.Option

TrivyOptionsOS returns the default options for trivy to scan OS packages. See the comment in getArtifactOption for why OnlyDirs is not set.

func UpdateJavaDB

func UpdateJavaDB() error

Types

This section is empty.

Directories

Path Synopsis
Package walker holds the trivy walkers
Package walker holds the trivy walkers

Jump to

Keyboard shortcuts

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