Trivy Scan #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |