Skip to content

Instantly share code, notes, and snippets.

@karthikjeeyar
Last active November 7, 2023 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karthikjeeyar/d9fe4d12fbbc1d01273c8540b5504d87 to your computer and use it in GitHub Desktop.
Save karthikjeeyar/d9fe4d12fbbc1d01273c8540b5504d87 to your computer and use it in GitHub Desktop.
Sample CVE task result format
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