2023-11-05 17:00:24 +03:00
|
|
|
name: trivy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
schedule:
|
|
|
|
- cron: '00 12 * * *'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
trivy-scan:
|
|
|
|
name: Check
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
timeout-minutes: 30
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
security-events: write
|
|
|
|
actions: read
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
|
|
|
|
|
|
|
|
- name: Run Trivy vulnerability scanner
|
2024-01-26 22:19:53 +03:00
|
|
|
uses: aquasecurity/trivy-action@d43c1f16c00cfd3978dde6c07f4bbcf9eb6993ca # v0.16.1
|
2023-11-05 17:00:24 +03:00
|
|
|
with:
|
|
|
|
scan-type: repo
|
|
|
|
ignore-unfixed: true
|
|
|
|
format: sarif
|
|
|
|
output: trivy-results.sarif
|
|
|
|
severity: CRITICAL,HIGH
|
|
|
|
|
|
|
|
- name: Upload Trivy scan results to GitHub Security tab
|
2024-01-26 22:19:53 +03:00
|
|
|
uses: github/codeql-action/upload-sarif@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
|
2023-11-05 17:00:24 +03:00
|
|
|
with:
|
|
|
|
sarif_file: 'trivy-results.sarif'
|