Gitlab report template fails because it gets outdated. #4935
Closed
mgaspereyra
started this conversation in
Bugs
Replies: 1 comment 2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Description
The template /contrib/gitlab.tpl it's outdated and, when you use it on gitlab saas, the security tab, on pipelines, throws the following information:
[Schema] Version 14.0.6 for report type container_scanning is unsupported, supported versions for this report type are: 15.0.0, 15.0.1, 15.0.2, 15.0.4, 15.0.5, 15.0.6. GitLab will attempt to validate this report against the earliest supported versions of this report type, to show all the errors but will not ingest the report
[Schema] root is missing required keys: scan
[Schema] property '/vulnerabilities/4/location/image' does not match pattern: ^[^:]+(:\d+[^:]*)?:[^:]+(:[^:]+)?$
Desired Behavior
The desired behavior is the report being correctly parsed by GitLab.
Actual Behavior
The report cannot be parsed due the outdated schema.
Reproduction Steps
1. Run trivy scan, using the template flag as follows: script: - docker build -f .docker/Dockerfile -t "$AZURE_CR"/pythonprojgitlab:"$CI_COMMIT_SHORT_SHA" . - > docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd):/app -e AZURE_CLIENT_ID=${AZURE_CLIENT_ID} -e AZURE_CLIENT_SECRET=${AZURE_CLIENT_SECRET} -e AZURE_TENANT_ID=${AZURE_TENANT_ID} aquasec/trivy -d -f template -t "@contrib/gitlab.tpl" -o /app/gl-container-scanning-report.json image "$AZURE_CR"/pythonprojgitlab:"$CI_COMMIT_SHORT_SHA" - docker push "$AZURE_CR"/pythonprojgitlab:"$CI_COMMIT_SHORT_SHA" artifacts: reports: container_scanning: gl-container-scanning-report.json 2. When pipeline finishes, check de pipeline reume page, and open the "security tab" 3. Check for the errors on the related report. ...Target
Container Image
Scanner
Vulnerability
Output Format
Template
Mode
Standalone
Debug Output
Operating System
It runs on official docker image, executed by a gitlab saas runner.
Version
Checklist
trivy image --resetAll reactions