From a2bfaaec8f39979eac4abb8676946293ead1cdfe Mon Sep 17 00:00:00 2001 From: Thore Cimbal Date: Sat, 1 Aug 2026 12:00:00 +0000 Subject: [PATCH] ci: woechentlicher Trivy-CVE-Scan des Prod-Web-Images (gitops#31) Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01PKhFj1S3UdD6xL2fbWPeYj --- .gitlab-ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2fd2b6e2b..961805433 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,12 +43,43 @@ stop_windows_vm: script: - docker stop windows-runner +# CVE-Scan des eigenen Prod-Images (gitops#31): woechentlich per Schedule und +# manuell triggerbar. Bricht bewusst nicht hart ab (allow_failure) - Funde landen +# als Artifact + Job-Log, die Bewertung bleibt menschlich. Lab-interne Images +# (desktop-build, windows-vm) brauchen erst CA-Trust im Trivy-Container - notiert +# in gitops#31 als Ausbaustufe. +trivy_scan: + stage: build + image: + name: aquasec/trivy:0.58.2 + entrypoint: [""] + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" + allow_failure: true + - if: $CI_COMMIT_BRANCH == "main" + when: manual + allow_failure: true + variables: + GIT_STRATEGY: none + TRIVY_NO_PROGRESS: "true" + script: + - trivy image --severity HIGH,CRITICAL --format table --output trivy-web.txt rohana.axion1337.de/sorb/threadnet-web:latest-ci + - grep -E "Total|CRITICAL|HIGH" trivy-web.txt | head -20 || true + artifacts: + paths: + - trivy-web.txt + expire_in: 30 days + when: always + web: stage: build image: node:24-bullseye rules: # Release-Tags bauen immer (docker_web/desktop_* brauchen web als needs) - if: $CI_COMMIT_TAG =~ /^v/ + # Scheduled Pipelines gehoeren dem trivy_scan - kein wochentlicher Leerbuild + - if: $CI_PIPELINE_SOURCE == "schedule" + when: never # Pushes nur, wenn build-relevante Pfade betroffen sind - Doku-Commits kosten nichts - if: $CI_COMMIT_BRANCH changes: