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

Commit

Permalink
Merge pull request #49 from catenax-ng/main
Browse files Browse the repository at this point in the history
fix(DockerFile): Fix trivy scan
  • Loading branch information
almadigabor authored Nov 24, 2023
2 parents 0aa977a + 2675017 commit 7f676f6
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 4 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/trivy-test-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Trivy Docker Image Analysis

on:
push:
branches:
- main
# Trigger manually
workflow_dispatch:

permissions:
security-events: write # To upload sarif files

jobs:
build-and-scan:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Helm
uses: azure/setup-helm@v3
with:
version: '3.6.3'

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: '3.7'

# Workaround: https://github.com/docker/build-push-action/issues/461
- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: ./Dockerfile
push: false
tags: backend:latest
load: true # Load the image into Docker's local image store


- name: Run Trivy Table
uses: aquasecurity/[email protected]
with:
scan-type: 'image'
image-ref: 'backend:latest'
severity: 'MEDIUM,HIGH,CRITICAL'
format: 'table'

9 changes: 5 additions & 4 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ jobs:
# For public images, no ENV vars must be set.
- name: Run Trivy vulnerability scanner
if: always()
uses: aquasecurity/trivy-action@master
uses: aquasecurity/trivy-action@0.14.0
with:
# Path to Docker image
image-ref: "ghcr.io/catenax-ng/tx-vas-country-risk-backend:latest"
format: "sarif"
output: "trivy-results3.sarif"
exit-code: "1"
severity: "CRITICAL,HIGH"
timeout: "60m"
# exit-code: "1"
# severity: "CRITICAL,HIGH"
# timeout: "60m"
vuln-type: "os,library"

- name: Upload Trivy scan results to GitHub Security tab
if: always()
Expand Down

0 comments on commit 7f676f6

Please sign in to comment.