ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.
Python active-directorycloud-securitydefensive-validationfastapigood-first-issuemitre-attackopsecreactred-teamreportingsecurity
fix: ignore blank webhook notifier config
Mafifrizi5babf6ccadc1
diff --git a/ares/core/notifier.py b/ares/core/notifier.pyindex 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 Nonesev_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.pyindex cefcc62..3189b28 100644--- a/tests/unit/test_engine.py+++ b/tests/unit/test_engine.py@@ -16,6 +16,7 @@ import pytestfrom ares.core.campaign import Campaign, NoiseProfile, ScopeEntryfrom ares.core.config import AresSettingsfrom 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.asyncioasync def test_run_module_not_found(self, settings: AresSettings, campaign: Campaign