From 2131a6ee447fbe1a38ec9d47a9e2ee2a93518f8c Mon Sep 17 00:00:00 2001 From: Arne Baeumler Date: Sun, 18 Jan 2026 12:07:46 +0100 Subject: [PATCH] fix: trivy workflow --- .gitea/workflows/publish-docker.yml | 38 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.gitea/workflows/publish-docker.yml b/.gitea/workflows/publish-docker.yml index 5d28208..6272d2c 100644 --- a/.gitea/workflows/publish-docker.yml +++ b/.gitea/workflows/publish-docker.yml @@ -41,25 +41,25 @@ jobs: load: true # This loads the image into the local docker daemon for Trivy to find tags: local_scan_target:${{ github.sha }} -# # Step 2: Scan the local image with Trivy -# - name: Run Trivy vulnerability scanner -# uses: aquasecurity/trivy-action@master -# with: -# image-ref: 'local_scan_target:${{ github.sha }}' -# format: 'table' -# exit-code: '1' # This will fail the pipeline if vulnerabilities are found -# ignore-unfixed: true -# vuln-type: 'os,library' -# severity: 'CRITICAL,HIGH' -# github-pat: "" -# env: -# - TRIVY_USERNAME: ${{ secrets.PACKAGE_USER }} -# - TRIVY_PASSWORD: ${{ secrets.PACKAGE_TOKEN }} + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: 'local_scan_target:${{ github.sha }}' + format: 'table' + exit-code: '1' # This will fail the pipeline if vulnerabilities are found + ignore-unfixed: true + vuln-type: 'os,library' + severity: 'CRITICAL,HIGH' + server-url: 'http://trivy-server:8080' + env: + - DOCKER_HOST: unix:///var/run/docker.sock + - TRIVY_USERNAME: ${{ secrets.PACKAGE_USER }} + - TRIVY_PASSWORD: ${{ secrets.PACKAGE_TOKEN }} - - name: Run Trivy scanner (Binary Mode) - run: | - curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin - trivy image --exit-code 1 --severity CRITICAL,HIGH --ignore-unfixed local_scan_target:${{ github.sha }} +# - name: Run Trivy scanner (Binary Mode) +# run: | +# curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin +# trivy image --exit-code 1 --severity CRITICAL,HIGH --ignore-unfixed local_scan_target:${{ github.sha }} # Step 3: If scan passes, Build and Push to Registry - name: Build and push Docker image @@ -68,4 +68,4 @@ jobs: context: . push: true tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }}