Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

fix: ignore blank webhook notifier config

Mafifrizi5babf6ccadc1
diff --git a/ares/core/notifier.py b/ares/core/notifier.py
index 95d7966..595196f 100644
--- a/ares/core/notifier.py
+++ b/ares/core/notifier.py
@@ -287,7 +287,7 @@ def build_notifier_from_settings(settings: Any) -> WebhookNotifier | None:
Build a WebhookNotifier from AresSettings.
Returns None if ARES_WEBHOOK_URL is not configured.
"""
- url = getattr(settings, "ares_webhook_url", "") or ""
+ url = (getattr(settings, "ares_webhook_url", "") or "").strip()
if not url:
return None
sev_str = getattr(settings, "ares_webhook_on_severity", "critical,high") or "critical,high"
diff --git a/tests/unit/test_engine.py b/tests/unit/test_engine.py
index cefcc62..3189b28 100644
--- a/tests/unit/test_engine.py
+++ b/tests/unit/test_engine.py
@@ -16,6 +16,7 @@ import pytest
from ares.core.campaign import Campaign, NoiseProfile, ScopeEntry
from ares.core.config import AresSettings
from ares.core.engine import AresEngine, ExecutionPlan, ModuleStatus
+from ares.core.notifier import build_notifier_from_settings
# ── Fixtures ──────────────────────────────────────────────────────────────────
@@ -51,6 +52,17 @@ def _fast_run(**kwargs: Any):
class TestAsyncEngine:
+ def test_blank_webhook_url_disables_notifier(self, settings: AresSettings) -> None:
+ """Blank/whitespace webhook config is disabled, not validated as a URL."""
+ settings.ares_webhook_url = " "
+ assert build_notifier_from_settings(settings) is None
+
+ def test_http_webhook_url_still_rejected(self, settings: AresSettings) -> None:
+ """SSRF protection remains strict for configured non-HTTPS webhooks."""
+ settings.ares_webhook_url = "http://example.com/webhook"
+ with pytest.raises(ValueError, match="must use https"):
+ build_notifier_from_settings(settings)
+
@pytest.mark.asyncio
async def test_run_module_not_found(
self, settings: AresSettings, campaign: Campaign