Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Trivy

Trivy #575

Workflow file for this run

name: "Trivy"
on:
push:
branches:
- main
- dev
paths:
- 'src/**'
- 'pom.xml'
- 'Dockerfile'
# pull_request:
# The branches below must be a subset of the branches above
# branches: [ main ]
# paths-ignore:
# - "**/*.md"
# - "**/*.txt"
schedule:
# Once a day
- cron: "0 0 * * *"
workflow_dispatch:
# Trigger manually
jobs:
analyze-config:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: "config"
hide-progress: false
format: "sarif"
output: "trivy-results1.sarif"
vuln-type: "os,library"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
if: always()
with:
sarif_file: "trivy-results1.sarif"
analyze-product-value-added-service:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# It's also possible to scan your private registry with Trivy's built-in image scan.
# All you have to do is set ENV vars.
# Docker Hub needs TRIVY_USERNAME and TRIVY_PASSWORD.
# You don't need to set ENV vars when downloading from a public repository.
# For public images, no ENV vars must be set.
- name: Run Trivy vulnerability scanner
if: always()
uses: aquasecurity/[email protected]
with:
# Path to Docker image
image-ref: "tractusx/vas-country-risk-backend:latest"
format: "sarif"
output: "trivy-results3.sarif"
# exit-code: "1"
# severity: "CRITICAL,HIGH"
# timeout: "60m"
vuln-type: "os,library"
- name: Upload Trivy scan results to GitHub Security tab
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results3.sarif"