Added trivy-nightly-scan for coredns images (#5810)

* Added trivy-nightly-scan for coredns images

Signed-off-by: Yash Singh <yashsingh1774@gmail.com>
Signed-off-by: Yash Singh <syash@vmware.com>

* Updated the changes

Signed-off-by: Yash Singh <syash@vmware.com>

Signed-off-by: Yash Singh <yashsingh1774@gmail.com>
Signed-off-by: Yash Singh <syash@vmware.com>
This commit is contained in:
Yash Singh 2022-12-16 20:17:52 +05:30 committed by GitHub
parent 3b81fc8d8c
commit 1d55217ea8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

34
.github/workflows/trivy-scan.yaml vendored Normal file
View file

@ -0,0 +1,34 @@
name: Trivy Nightly Scan
on:
schedule:
- cron: '0 2 * * 5' #Run at 2AM UTC on every Friday
permissions: read-all
jobs:
nightly-scan:
name: Trivy Scan nightly
strategy:
fail-fast: false
matrix:
# It will test for only the latest version as older version is not maintained
versions: [latest]
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5 # master
with:
image-ref: 'docker.io/coredns/coredns:${{ matrix.versions }}'
severity: 'CRITICAL,HIGH'
format: 'template'
template: '@/contrib/sarif.tpl'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@a669cc5936cc5e1b6a362ec1ff9e410dc570d190 # v2.1.36
with:
sarif_file: 'trivy-results.sarif'