ops: scans vuln Trivy (Actions) — dormants en attente d'activation #1
No files matched your search
@@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
# Trivy — scan image conteneur publiée sur le registre Gitea (git.ccado.fr)
|
||||||
|
# Déclencheur : package (type container) publié / lié au dépôt.
|
||||||
|
# NB Gitea 1.27 : l'événement registry_package ne supporte QUE `published`
|
||||||
|
# (le type `updated` n'existe pas — cf. modules/actions/workflows.go).
|
||||||
|
name: trivy-registry-image
|
||||||
|
on:
|
||||||
|
registry_package:
|
||||||
|
types: [published]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: trivy-image-${{ gitea.ref_name }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scan-image:
|
||||||
|
# Ne scanner que les images conteneur du registre lié à ce dépôt
|
||||||
|
if: gitea.event.package.type == 'container'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Scan Trivy — image publiée (auth registre via GITEA_TOKEN)
|
||||||
|
uses: aquasecurity/trivy-action@v0.36.0
|
||||||
|
with:
|
||||||
|
image-ref: git.ccado.fr/${{ gitea.event.package.name }}:${{ gitea.event.package.version }}
|
||||||
|
format: table
|
||||||
|
exit-code: 1 # échoue sur HIGH/CRITICAL
|
||||||
|
severity: HIGH,CRITICAL
|
||||||
|
ignore-unfixed: true # vulns sans fix dispo = bruit
|
||||||
|
timeout: 15m
|
||||||
|
env:
|
||||||
|
TRIVY_CACHE_DIR: /tmp/.trivy
|
||||||
|
TRIVY_USERNAME: ${{ github.actor }}
|
||||||
|
TRIVY_PASSWORD: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Résultat
|
||||||
|
if: failure()
|
||||||
|
run: echo "::warning::Vulnérabilités HIGH/CRITICAL détectées sur l'image ${{ gitea.event.package.name }}:${{ gitea.event.package.version }}"
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
# Trivy — scan hebdomadaire du dépôt (lockfiles : package-lock.json, go.sum,
|
||||||
|
# requirements*.txt, Gemfile.lock, ...). Lundi 06:00 + dispatch manuel.
|
||||||
|
name: trivy-repo-weekly
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 6 * * 1' # lundi 06:00 Europe/Paris (fuseau runner)
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: trivy-repo-weekly
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
scan-fs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Scan Trivy — lockfiles du dépôt
|
||||||
|
uses: aquasecurity/trivy-action@v0.36.0
|
||||||
|
with:
|
||||||
|
scan-type: fs
|
||||||
|
scan-ref: .
|
||||||
|
format: table
|
||||||
|
exit-code: 1 # échoue sur HIGH/CRITICAL
|
||||||
|
severity: HIGH,CRITICAL
|
||||||
|
ignore-unfixed: true
|
||||||
|
timeout: 15m
|
||||||
|
env:
|
||||||
|
TRIVY_CACHE_DIR: /tmp/.trivy
|
||||||
|
|
||||||
|
- name: Résultat
|
||||||
|
if: failure()
|
||||||
|
run: echo "::warning::Vulnérabilités HIGH/CRITICAL dans les dépendances du dépôt (voir logs ci-dessus)"
|
||||||
Reference in new issue
Block a user