Skip to main content

This component executes Trivy vulnerability and misconfiguration scans against container images or filesystem paths and produces machine-readable reports.

Variables

NamerequiredHints
TRIVY_TIMEOUTnoGlobal variable to set a custom scan timeout for long running scans

Usage

Scan the filesystem

  • Create a new pipeline file
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/tivy@stable
inputs:
name: project
path: .

Scan a container image

  • Create a new pipeline file
include:
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/common@stable
- component: $CI_SERVER_FQDN/xrow-public/ci-tools/tivy@stable
inputs:
name: image
image: registry.gitlab.com/xrow-public/ci-tools/test-insecure-java-app:latest

Inputs

NameDescriptionDefaultType
------------
dependenciesThe dependencies that this job depends on.[]array
imageUrl to the image.string
nameName for the pipeline jobs and the container.$CI_PROJECT_NAMEstring
needsThe jobs that this job depends on.[]array
package-typesPackage types to scan["os","library"]array
pathPath to the sources..string
rulesThe jobs that this job depends on.[{"if":"$CI_PIPELINE_SOURCE == \"schedule\"","when":"never"},{"if":"$CI_PIPELINE_SOURCE == \"merge_request_event\"","when":"on_success"},{"when":"on_success"}]array
scannersScanners to use. none, vuln, license, secret, misconfig["vuln","secret","license","misconfig"]array
scanning-allow-failureShould the pipeline fail if scanning the built container image fails?trueboolean
scanning-severityWhat level of severity should cause scanning of the built container to fail?CRITICALstring
scanning-timeoutHow long should the scanning process be allowed to run before timing out? Use format e.g. 5m0sstring
stageThe pipeline stage that the jobs belongs to.buildstring
tagsThe runners that this job depends on.[]array