fix(waf): Add missing /health endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-04-30 14:30:55 +02:00
parent 0bfa7ea659
commit 2b073a527f

View File

@ -253,6 +253,20 @@ def _get_threat_stats() -> dict:
# === Public Endpoints ===
@app.get("/health")
async def health():
"""WAF health check (public)."""
cfg = _cfg()
total_rules = sum(len(p) for p in _compiled_patterns.values())
return {
"status": "ok" if cfg["enabled"] else "disabled",
"module": "waf",
"version": "1.0.0",
"rules_loaded": total_rules,
"autoban": cfg["autoban_enabled"],
}
@app.get("/status")
async def status():
"""WAF status (public)."""