Skip to main content

Trivy

The trivy scraper uses Trivy to scan for security vulnerabilities & misconfigurations in your configuration. At the moment, there's only support for scanning Kubernetes objects.

trivy:
- version: "0.40.0"
kubernetes:
namespace: production

Unlike other scrapers, this one does not scape new configs but rather look for security vulnerabilities in the existing configs. This scrapper, if configured to scan a kubernetes cluster, will map all the found vulnerabilities to the corresponding config item.

Config Insights generated by Trivy Scraper Fig: Config Insights generated by Trivy Scraper

Config Insights generated by Trivy Scraper Fig: A detailed view of the analysis on the postgres container

Scraper

FieldDescriptionSchemeRequired
logLevelSpecify the level of logging.stringfalse
scheduleSpecify the interval to scrape in cron format. Defaults to every 60 minutes.stringfalse
fullSet to true to extract changes from scraped configurations. Defaults to false.boolfalse
retentionSettings for retaining changes, analysis and scraped itemsRetention
trivySpecifies the list of Trivy configurations to scrape.[]Trivyfalse

Trivy

FieldDescriptionSchemeRequired
idA static value or JSONPath expression to use as the ID for the resource.stringtrue
nameA static value or JSONPath expression to use as the Name for the resource. Default value is the id.stringfalse
itemsA JSONPath expression to use to extract individual items from the resourcestringfalse
typeA static value or JSONPath expression to use as the type for the resource.stringtrue
transformSpecify field to transform result.Transformfalse
formatFormat of config item, defaults to JSON, available options are JSON.stringfalse
timestampFormatTimestampFormat is a Go time format string used to parse timestamps in createFields and DeletedFields. If not specified, the default is RFC3339.stringfalse
versionSpecify the Trivy version to use. (default 0.40.0)stringfalse
compliancecompliance report to generate(k8s-nsa, k8s-cis, k8s-pss-baseline, k8s-pss-restricted).stringfalse
ignoredLicensesspecify a list of license to ignore.[]stringfalse
ignoreUnfixeddisplay only fixed vulnerabilities.boolfalse
licenseFulleagerly look for licenses in source code headers and license files.boolfalse
severityseverities of security issues to be displayed (comma separated)(default "UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL").stringfalse
vulnTypecomma-separated list of vulnerability types (comma separated)(default "os,library").stringfalse
kubernetesSpecify the trivy option to scan kubernetes objects.K8sOptionstrue

K8sOptions

Trivy Options consist of selected few flags that are passed on to trivy.

FieldDescriptionSchemeRequired
componentsSpecify which components to scan*(default workload, infra).*[]stringfalse
kubeconfigSpecify the kubeconfig file path to use as a static value or as a JSONPath expression.stringfalse
namespaceSpecify a namespace to scan.stringtrue
contextSpecify a context to scan.stringfalse