diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 0000000..1057691
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,26 @@
+name: Scan image
+on:
+ workflow_dispatch:
+jobs:
+ build-and-push-image:
+ runs-on: ubuntu-latest
+ # These permissions are needed to interact with GitHub's OIDC Token endpoint.
+ permissions:
+ id-token: write
+ contents: read
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Vulnerability scan (fixed and non-fixed)
+ uses: aquasecurity/trivy-action@0.25.0
+ env:
+ TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
+ with:
+ image-ref: 'alpine:3.20.0'
+ format: 'template'
+ # Manually downloaded the template from the Trivy GitHub repo since it is somehow not found by default
+ template: '@/github/workspace/.github/workflows/trivy_html_template.tpl'
+ output: 'report.html'
+ severity: 'HIGH,CRITICAL'
+ timeout: '12m'
diff --git a/.github/workflows/trivy_markdown_template.tpl b/.github/workflows/trivy_markdown_template.tpl
new file mode 100644
index 0000000..ca3978c
--- /dev/null
+++ b/.github/workflows/trivy_markdown_template.tpl
@@ -0,0 +1,77 @@
+{{- if . }}
+{{- range . }}
+
Target {{ escapeXML .Target }}
+{{- if (and (eq (len .Vulnerabilities) 0) (eq (len .Misconfigurations) 0) (eq (len .Secrets) 0)) }}
+Nothing found
+{{- else }}
+{{- if (gt (len .Vulnerabilities) 0) }}
+Vulnerabilities ({{ len .Vulnerabilities }})
+
+
+ Package |
+ ID |
+ Severity |
+ Installed Version |
+ Fixed Version |
+
+ {{- range .Vulnerabilities }}
+
+ {{ escapeXML .PkgName }} |
+ {{ escapeXML .VulnerabilityID }} |
+ {{ escapeXML .Severity }} |
+ {{ escapeXML .InstalledVersion }} |
+ {{ escapeXML .FixedVersion }} |
+
+ {{- end }}
+
+{{- end }}
+{{- if (gt (len .Misconfigurations ) 0) }}
+Misconfigurations ({{ len .Misconfigurations }})
+
+
+ Type |
+ ID |
+ Check |
+ Severity |
+ Message |
+
+ {{- range .Misconfigurations }}
+
+ {{ escapeXML .Type }} |
+ {{ escapeXML .ID }} |
+ {{ escapeXML .Title }} |
+ {{ escapeXML .Severity }} |
+
+ {{ escapeXML .Message }}
+ {{ escapeXML .PrimaryURL }}
+ |
+
+ {{- end }}
+
+{{- end }}
+{{- if (gt (len .Secrets ) 0) }}
+Secrets ({{ len .Secrets }})
+
+
+ Type |
+ ID |
+ Severity |
+ Lines |
+ Match |
+
+ {{- range .Secrets }}
+
+ {{ escapeXML (toString .Category) }} |
+ {{ escapeXML .RuleID }} |
+ {{ escapeXML .Severity }} |
+ {{ escapeXML (toString .StartLine) }}-{{ escapeXML (toString .EndLine) }} |
+ {{ escapeXML .Match }} |
+
+ {{- end }}
+
+{{- end }}
+{{- end }}
+{{- end }}
+{{- else }}
+Trivy Returned Empty Report
+{{- end }}