mirror of
https://github.com/CyberMind-FR/secubox-deb.git
synced 2026-07-30 05:06:05 +00:00
fix(waf): Add missing /health endpoint
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
0bfa7ea659
commit
2b073a527f
|
|
@ -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)."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user