Skip to content

Trivy Scan

Trivy Scan #9

Workflow file for this run

name: Trivy Scan
on:
workflow_run:
workflows: ["Build and Push"]
types:
- completed
workflow_dispatch:
jobs:
trivy-scan:
runs-on: ubuntu-latest
steps:
# Para o backend
- name: Run Trivy Backend Docker Image
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/python-peoples-crud-backend:latest'
format: 'table'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
output: 'trivy-backend-report.json'
- name: Upload Trivy report as artifact
uses: actions/upload-artifact@v4
with:
name: trivy-backend-report
path: trivy-backend-report.json
# Para o frontend
- name: Run Trivy Frontend Docker Image
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: '${{ secrets.DOCKERHUB_USERNAME }}/python-peoples-crud-frontend:latest'
format: 'table'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
output: 'trivy-frontend-report.json'
- name: Upload Trivy report as artifact
uses: actions/upload-artifact@v4
with:
name: trivy-frontend-report
path: trivy-frontend-report.json