sec(ci): add Yamllint and Hadolint stages to pipeline
DevSecOps Pipeline - V1 Infrastructure / Code & Config Linting (Yamllint & Hadolint) (push) Failing after 3s Details
DevSecOps Pipeline - V1 Infrastructure / Secret Detection (Gitleaks) (push) Has been skipped Details
DevSecOps Pipeline - V1 Infrastructure / IaC Security & Vulnerability Scan (Trivy) (push) Has been skipped Details

Integrate linting for YAML and Dockerfiles alongside Gitleaks and Trivy to enforce full DevSecOps compliance.
This commit is contained in:
Marc Lasserre 2026-08-07 01:36:44 +02:00
parent 8f692bce96
commit caf1a19432
Signed by: M7s
GPG Key ID: F74837410959661B
1 changed files with 21 additions and 8 deletions

View File

@ -1,21 +1,34 @@
name: DevSecOps Pipeline - V1 Infrastructure name: DevSecOps Pipeline - V1 Infrastructure
on: [push] on: [push, pull_request]
jobs: jobs:
health-check: lint-and-format:
name: System & Environment Check name: Code & Config Linting (Yamllint & Hadolint)
runs-on: host runs-on: host
steps: steps:
- name: System Check - name: Checkout Code
uses: actions/checkout@v4
- name: Run Yamllint
run: | run: |
echo "Pipeline CI/CD opérationnel sur le VPS RYM !" echo "🧹 Verification de la syntaxe YAML..."
uname -a podman run --rm -v "$PWD":/data:z cytopia/yamllint -d "{extends: relaxed, rules: {line-length: disable}}" .
podman --version
- name: Run Hadolint (Dockerfiles)
run: |
echo "🐳 Analyse des Dockerfiles..."
# Ne s'execute que si des Dockerfiles existent dans le repo
if [ -n "$(find . -maxdepth 3 -name 'Dockerfile*')" ]; then
podman run --rm -i docker.io/hadolint/hadolint < Dockerfile
else
echo "Aucun Dockerfile détecté, étape ignorée."
fi
gitleaks-scan: gitleaks-scan:
name: Secret Detection (Gitleaks) name: Secret Detection (Gitleaks)
runs-on: host runs-on: host
needs: lint-and-format
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -35,5 +48,5 @@ jobs:
- name: Run Trivy IaC Scan - name: Run Trivy IaC Scan
run: | run: |
echo "🛡️ Analyse des fichiers d'infrastructure et des vulnérabilités..." echo "🛡️ Analyse des configurations d'infrastructure..."
podman run --rm -v "$PWD":/path:z docker.io/aquasec/trivy:0.49.1 config /path podman run --rm -v "$PWD":/path:z docker.io/aquasec/trivy:0.49.1 config /path