Last active
November 7, 2023 14:12
-
-
Save karthikjeeyar/d9fe4d12fbbc1d01273c8540b5504d87 to your computer and use it in GitHub Desktop.
Sample CVE task result format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: tekton.dev/v1 | |
kind: Task | |
metadata: | |
name: scan-task | |
annotations: | |
task.output.location: results | |
task.results.format: application/json | |
task.results.key: SCAN_OUTPUT | |
spec: | |
results: | |
- name: SCAN_OUTPUT | |
description: The common vulnerabilities and exposures (CVE) result format | |
steps: | |
- name: print-cve-results | |
image: bash:latest | |
script: | | |
#!/usr/bin/env bash | |
echo '{"vulnerabilities":{ | |
"critical": 13, | |
"high": 29, | |
"medium": 32, | |
"low": 3, | |
"unknown": 0}, | |
"unpatched_vulnerabilities": { | |
"critical": 0, | |
"high": 1, | |
"medium": 0, | |
"low":1} | |
}' | tee $(results.SCAN_OUTPUT.path) | |
--- | |
apiVersion: tekton.dev/v1 | |
kind: PipelineRun | |
metadata: | |
name: pipelinerun-with-scan-task | |
spec: | |
pipelineSpec: | |
tasks: | |
- name: scan-task | |
taskRef: | |
name: scan-task | |
results: | |
- name: SCAN_OUTPUT | |
description: The common vulnerabilities and exposures (CVE) result | |
value: $(tasks.scan-task.results.SCAN_OUTPUT) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment