| `trivy-image` / `S2I_TRIVY_IMAGE` | The docker image used to scan images with Trivy | `docker.io/aquasec/trivy:latest`<br/>[](https://to-be-continuous.gitlab.io/doc/secu/trivy-S2I_TRIVY_IMAGE)|
| `trivy-disabled` / `S2I_TRIVY_DISABLED` | Set to `true` to disable Trivy analysis | _(none)_ |
Other Trivy parameters shall be configured using [Trivy environment variables](https://aquasecurity.github.io/trivy/latest/docs/references/configuration/cli/trivy_image/#options).
Examples:
*`TRIVY_SEVERITY`: severities of security issues to be displayed (comma separated values: `UNKNOWN`, `LOW`, `MEDIUM`, `HIGH`, `CRITICAL`)
*`TRIVY_SERVER`: server address (enables client/server mode)
*`TRIVY_DB_REPOSITORY`: OCI repository to retrieve Trivy Database from
*`TRIVY_JAVA_DB_REPOSITORY`: OCI repository to retrieve Trivy Java Database from
It's possible to ignore some CVE by adding a `.trivyignore` file at the root of the project (see [official documentation](https://trivy.dev/latest/docs/configuration/filtering/#trivyignore) for syntax).
In addition to a textual report in the console, this job produces the following reports, kept for one day and only available for download by users with the Developer role or higher:
| `reports/s2i-trivy-*.native.json` | Native Trivy report format (json) | [DefectDojo integration](https://docs.defectdojo.com/en/connecting_your_tools/parsers/file/trivy/)<br/>_This report is generated only if DefectDojo template is detected_ |
| `reports/s2i-trivy-*.gitlab.json` | [Trivy report format for GitLab Container Security](https://aquasecurity.github.io/trivy/latest/tutorials/integrations/gitlab-ci/) format | [GitLab Container Security](https://docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscontainer_scanning) |
| `reports/s2i-trivy-*.gitlab-codequality.json` | [Trivy report format for GitLab Code Quality](https://aquasecurity.github.io/trivy/latest/tutorials/integrations/gitlab-ci/) format | [GitLab Code Quality](https://docs.gitlab.com/ci/yaml/artifacts_reports/#artifactsreportscodequality) |
### `s2i-publish` job
This job pushes (_promotes_) the built image as the _release_ image using [skopeo](https://github.com/containers/skopeo).
basename=$(echo "${S2I_SNAPSHOT_IMAGE}" | sed 's|[/:]|_|g')
mkdir -p ./reports
if [[ -z "$TRIVY_SERVER" ]]; then
log_warn "\\e[93mYou are using Trivy in standalone mode. To get faster scans, consider setting the TRIVY_SERVER variable to the address of a Trivy server. More info here: https://aquasecurity.github.io/trivy/latest/docs/references/modes/client-server/\\e[0m"
fi
# Generate the native JSON report that can later be converted to other formats