Automates security audits with SAST, SCA, DAST, and CI/CD integration. Covers Semgrep, CodeQL, Trivy, Gitleaks, OWASP ZAP, and remediation tracking.
Ships in claude-skills-collection. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Avant tout outil, cartographier précisément :
| Asset | Outils recommandés | Priorité |
|---|---|---|
| Code source | Semgrep, CodeQL, SonarQube | Haute |
| Dépendances (SCA) | Trivy, Snyk, Grype | Haute |
| Images Docker | Trivy, Anchore, Grype | Haute |
| Infrastructure as Code | Checkov, tfsec, kics | Moyenne |
| APIs / Web apps (DAST) | OWASP ZAP, Nuclei, Burp Suite | Moyenne |
| Secrets dans le code | Gitleaks, TruffleHog | Critique |
Référentiels de vulnérabilités cibles : OWASP Top 10 (2021), CWE Top 25, NIST NVD (CVE).
# Installation
pip install semgrep
# Scan avec ruleset OWASP
semgrep scan --config "p/owasp-top-ten" --sarif -o semgrep.sarif ./src
# Règle custom (ex: interdire MD5)
# fichier: rules/no-md5.yaml
# rules:
# - id: no-md5
# pattern: hashlib.md5(...)
# message: "MD5 interdit, utiliser SHA-256"
# languages: [python]
# severity: ERROR
semgrep scan --config rules/ ./src
# .github/workflows/codeql.yml
- uses: github/codeql-action/init@v3
with:
languages: javascript, python
queries: security-extended
- uses: github/codeql-action/analyze@v3
with:
output: codeql-results.sarif
sonar-scanner \
-Dsonar.projectKey=mon-projet \
-Dsonar.sources=./src \
-Dsonar.qualitygate.wait=true \ # bloque le pipeline si gate KO
-Dsonar.host.url=$SONAR_URL \
-Dsonar.token=$SONAR_TOKEN
# Dépendances du projet
trivy fs --severity HIGH,CRITICAL --exit-code 1 .
# Image Docker
trivy image --severity HIGH,CRITICAL --exit-code 1 mon-app:latest
# IaC (Terraform, Helm, Kubernetes)
trivy config --exit-code 1 ./infra/
# Sortie SARIF pour intégration GitHub/Azure DevOps
trivy fs --format sarif -o trivy.sarif .
Critère de décision --exit-code : mettre 1 uniquement pour les sévérités HIGH et CRITICAL sur les pipelines de production. Sur les branches feature, logguer sans bloquer.
# Scanner tout l'historique
gitleaks detect --source . --log-opts="HEAD~50..HEAD" --report-format sarif --report-path gitleaks.sarif
# Pre-commit hook (`.pre-commit-config.yaml`)
# - repo: https://github.com/gitleaks/gitleaks
# rev: v8.20.0
# hooks:
# - id: gitleaks
# Scan baseline (passif, sans authentification)
docker run --rm ghcr.io/zaproxy/zaproxy:stable \
zap-baseline.py -t https://staging.monapp.com -r zap-report.html
# Scan complet authentifié
docker run --rm ghcr.io/zaproxy/zaproxy:stable \
zap-full-scan.py \
-t https://staging.monapp.com \
-z "-config replacer.full_list(0).description=auth \
-config replacer.full_list(0).enabled=true \
-config replacer.full_list(0).matchtype=REQ_HEADER \
-config replacer.full_list(0).matchstr=Authorization \
-config replacer.full_list(0).replacement=Bearer $TOKEN"
Règle impérative : ne jamais pointer ZAP sur un environnement de production.
# Mise à jour des templates et scan
nuclei -update-templates
nuclei -u https://staging.monapp.com \
-severity high,critical \
-t cves/ -t misconfigurations/ \
-o nuclei-findings.json -json
name: Security Audit
on: [push, pull_request]
jobs:
security:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- name: SAST — Semgrep
run: semgrep scan --config "p/owasp-top-ten" --sarif -o semgrep.sarif ./src
- name: SCA + IaC — Trivy
run: trivy fs --severity HIGH,CRITICAL --format sarif -o trivy.sarif .
- name: Secrets — Gitleaks
run: gitleaks detect --source . --report-format sarif --report-path gitleaks.sarif
- name: Upload SARIF (Code Scanning)
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep.sarif
- name: Quality gate bloquant
run: |
trivy fs --severity CRITICAL --exit-code 1 .
semgrep scan --config "p/owasp-top-ten" --error ./src
- task: CmdLine@2
displayName: 'Trivy SCA scan'
inputs:
script: |
trivy fs --severity HIGH,CRITICAL --exit-code 1 --format table .
continueOnError: false # bloque le pipeline
SLAs de remédiation à encoder dans les quality gates :
| Sévérité | Blocage pipeline | SLA correction |
|---|---|---|
| CRITICAL | Immédiat (exit 1) | 48h |
| HIGH | Immédiat (exit 1) | 7 jours |
| MEDIUM | Warning seulement | 30 jours |
| LOW | Log uniquement | 90 jours |
# Importer un rapport Trivy dans DefectDojo via API
curl -X POST "$DEFECTDOJO_URL/api/v2/import-scan/" \
-H "Authorization: Token $DEFECTDOJO_TOKEN" \
-F "scan_type=Trivy Scan" \
-F "[email protected]" \
-F "product_name=mon-projet" \
-F "engagement_name=Sprint-42" \
-F "auto_create_context=true"
Workflow finding : New → Accepted Risk / False Positive / Active → In Review → Mitigated → Closed
Toute suppression de finding doit inclure : justification documentée, approbation RSSI, date d'expiration de l'exception.
# Rapport HTML Trivy
trivy fs --format template \
--template "@contrib/html.tpl" \
-o security-report.html .
# Agrégation multi-outils avec jq
jq -s '{ total: (map(.Results[]?.Vulnerabilities // [] | length) | add),
critical: (map(.Results[]?.Vulnerabilities[]? | select(.Severity=="CRITICAL")) | length) }' \
trivy.json > summary.json
Planifier l'envoi hebdomadaire du résumé exécutif (tendances MTTR, dette de sécurité, top 5 CVE) aux stakeholders via webhook ou email automatisé.
Ne pas faire :
Pièges courants :
--exit-code 1 sur MEDIUM peut bloquer inutilement des MRs pour des vulnérabilités non exploitables dans le contexte.**/test/** et **/fixtures/** dans la config.Bonnes pratiques 2026 :
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/claude-skills-collection:security-security-audit-automationfrom claude-skills-collection
npx claudepluginhub vantaflow/claude-skills-collection --plugin claude-skills-collection348 skills in this plugin
/agent-a2a-protocol-guideGuide du protocole Agent-to-Agent (A2A) de Google pour l'interopérabilité entre agents IA — découverte, communication et collaboration inter-agents, avec exemples de code, critères de décision et pièges à éviter. Se déclenche avec "A2A", "agent-to-agent", "protocole A2A", "Google A2A", "interopérabilité agents". Also triggers on "agent-to-agent protocol", "agent interoperability", "connect two agents"./agent-agent-observabilityInstrumentation technique d'un agent IA — tracing distribué des appels LLM et outils, spans, métriques custom, corrélation de logs et dashboards de supervision. Pour les alertes et garde-fous de production, voir agent-monitoring-setup. Se déclenche avec "observabilité agent", "tracing agent", "LangSmith", "Langfuse", "OpenTelemetry agent", "spans LLM", "corréler les logs agent". Also triggers on "trace my agent", "LLM tracing", "agent spans"./agent-api-caller-subagentSous-agent spécialisé dans les appels API REST/GraphQL avec retry, auth et transformation de données. Se déclenche avec "sous-agent API", "API caller agent", "agent qui appelle une API", "REST agent", "HTTP agent", "API integration subagent", "external API agent". Also triggers on "subagent that calls an API", "API calling agent", "agent HTTP requests".Other plugins' skills for the same job