feature/devsecops-linting-rules #1
|
|
@ -1,9 +1,4 @@
|
||||||
name: DevSecOps Pipeline - V1 Infrastructure
|
lint-and-format:
|
||||||
|
|
||||||
on: [push, pull_request]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint-and-format:
|
|
||||||
name: Code & Config Linting (Yamllint & Hadolint)
|
name: Code & Config Linting (Yamllint & Hadolint)
|
||||||
runs-on: host
|
runs-on: host
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -13,40 +8,13 @@ jobs:
|
||||||
- name: Run Yamllint
|
- name: Run Yamllint
|
||||||
run: |
|
run: |
|
||||||
echo "🧹 Verification de la syntaxe YAML..."
|
echo "🧹 Verification de la syntaxe YAML..."
|
||||||
podman run --rm -v "$PWD":/data:z cytopia/yamllint -d "{extends: relaxed, rules: {line-length: disable}}" .
|
podman run --rm -v "$PWD":/data:z docker.io/cytopia/yamllint -d "{extends: relaxed, rules: {line-length: disable}}" .
|
||||||
|
|
||||||
- name: Run Hadolint (Dockerfiles)
|
- name: Run Hadolint (Dockerfiles)
|
||||||
run: |
|
run: |
|
||||||
echo "🐳 Analyse des Dockerfiles..."
|
echo "🐳 Analyse des Dockerfiles..."
|
||||||
# Ne s'execute que si des Dockerfiles existent dans le repo
|
|
||||||
if [ -n "$(find . -maxdepth 3 -name 'Dockerfile*')" ]; then
|
if [ -n "$(find . -maxdepth 3 -name 'Dockerfile*')" ]; then
|
||||||
podman run --rm -i docker.io/hadolint/hadolint < Dockerfile
|
podman run --rm -i docker.io/hadolint/hadolint < Dockerfile
|
||||||
else
|
else
|
||||||
echo "Aucun Dockerfile détecté, étape ignorée."
|
echo "Aucun Dockerfile détecté, étape ignorée."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
gitleaks-scan:
|
|
||||||
name: Secret Detection (Gitleaks)
|
|
||||||
runs-on: host
|
|
||||||
needs: lint-and-format
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run Gitleaks via Podman
|
|
||||||
run: |
|
|
||||||
echo "🔍 Lancement du scan Gitleaks..."
|
|
||||||
podman run --rm -v "$PWD":/path:z docker.io/zricethezav/gitleaks:v8.18.2 detect --source="/path" -v
|
|
||||||
|
|
||||||
trivy-iac-scan:
|
|
||||||
name: IaC Security & Vulnerability Scan (Trivy)
|
|
||||||
runs-on: host
|
|
||||||
needs: gitleaks-scan
|
|
||||||
steps:
|
|
||||||
- name: Checkout Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Run Trivy IaC Scan
|
|
||||||
run: |
|
|
||||||
echo "🛡️ Analyse des configurations d'infrastructure..."
|
|
||||||
podman run --rm -v "$PWD":/path:z docker.io/aquasec/trivy:0.49.1 config /path
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue