Symfony DevSecOps Template

Pipeline DevSecOps automatisée avec scanner de sécurité OWASP Top 10 + CWE Top 25, SAST/DAST, audit de dépendances et déploiement sécurisé.

OWASP Top 10

Protection A01-A10 automatisée

CWE Top 25

Détection XSS, SQLi, CSRF, RCE

CI/CD GitLab

12 jobs automatisés

Pipeline DevSecOps Automatisée
🔬 SAST - Analyse Statique
  • PHPStan niveau 9 (null pointer, type safety)
  • Psalm Taint Analysis (XSS, SQLi, RCE)
  • PHP CS Fixer (PSR-12 compliance)
  • PHP Copy/Paste Detector
📦 SCA - Audit Dépendances
  • Composer Audit (CVE détection)
  • Symfony Security Checker
  • Trivy Filesystem Scanner
  • NPM Audit (dépendances JS)
🔑 Secret Scanning
  • Gitleaks (API keys, tokens, passwords)
  • Trivy Secret Scanner
  • Regex pattern matching
  • Historique Git scanné
✅ Tests & QA
  • PHPUnit avec couverture >80%
  • Tests de sécurité dédiés
  • Lint Twig/YAML/Container
  • Validation schéma Doctrine
Sécurité Applicative
🔐 Authentification Renforcée
  • Hachage bcrypt (cost 12)
  • Rate limiting (5 tentatives/min)
  • Verrouillage de compte automatique
  • Sessions sécurisées (HttpOnly, Secure, SameSite)
  • Rotation de tokens CSRF
🛡️ Headers de Sécurité
  • HSTS (Strict-Transport-Security)
  • CSP (Content-Security-Policy)
  • X-Frame-Options: DENY
  • X-Content-Type-Options: nosniff
  • Referrer-Policy: strict-origin
✅ OWASP Top 10 2021
  • A01: Contrôle d'accès (@IsGranted)
  • A02: Cryptographie (bcrypt, pas de MD5/SHA1)
  • A03: Injection (ORM paramétré)
  • A05: Security Misconfiguration
  • A06: Vulnerable Components (audit)
  • A09: Security Logging & Monitoring
🛡️ CWE/SANS Top 25
  • CWE-79: XSS (Twig auto-escaping)
  • CWE-89: SQLi (Doctrine ORM)
  • CWE-352: CSRF (tokens automatiques)
  • CWE-434: Upload sécurisé (validation MIME)
  • CWE-862: Autorisation (Security voters)
Architecture Pipeline CI/CD
Dependencies
Composer + NPM
Security Scan
OWASP + CWE
SAST
PHPStan + Psalm
Tests
PHPUnit 80%
Quality
CS Fixer + Lint
Build
Docker multi-stage
🚀 Déploiement automatique sur main/develop
Makefile DevSecOps

Commandes Makefile automatisées pour le développement local :

🛡️ Sécurité
  • make security-scan - Scan complet automatisé
  • make scan-dependencies - Audit CVE
  • make scan-secrets - Détection secrets
  • make scan-sast - Analyse statique
  • make scan-owasp-top10 - Vérif OWASP
  • make scan-cwe-top25 - Vérif CWE
✅ Qualité
  • make code-check - Vérif complètes
  • make qa-phpstan - Analyse statique
  • make qa-cs-fixer - Standards PSR-12
  • make tests - Tests PHPUnit
  • make phpdoc-generate - Documentation API
  • make install-git-hooks - Hooks pre-commit
Rapport HTML consolidé généré dans : var/security-scan/report.html
Monitoring & Logging
📊 Logs Structurés
  • Format JSON avec contexte
  • Audit trail complet (qui/quand/quoi)
  • Événements de sécurité horodatés
  • IP, User-Agent, Session ID
🔔 Alertes Automatiques
  • Notification Slack/Teams (vulnérabilités)
  • Rapport consolidé (.post stage)
  • Health checks automatiques
  • Badges pipeline status
Template Open Source RNCP7

Template de référence Cybersécurité avec pipeline DevSecOps complète (OWASP Top 10 + CWE Top 25 + ANSSI).