Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(deploy): deliver the SSRF relax knobs to the services that enforce the guard (#1430)

Beenu Arora1a88d0435056
diff --git a/.env.example b/.env.example
index 9abab3cd9..d6f855aa3 100644
--- a/.env.example
+++ b/.env.example
@@ -337,6 +337,22 @@ DOMAINTOOLS_API_KEY=
RISKIQ_USERNAME=
RISKIQ_API_KEY=
+# ─── Outbound egress (SSRF guard) ─────────────────────────────────────────────
+# Connector egress (test, resource reads, scheduled polls), webhook
+# destinations and playbook http_request/notify steps are all validated by the
+# SSRF guard; by default it refuses loopback, private ranges, link-local and
+# the cloud-metadata endpoints. These knobs reach the api, connectors and
+# agents services from this one file.
+#
+# Re-admit on-prem systems on RFC1918 private ranges (never loopback, never
+# cloud metadata):
+AISOC_SSRF_ALLOW_PRIVATE=
+# Re-admit exact hostnames (comma-separated, matched exactly — no wildcards,
+# no CIDR; the cloud-metadata blocklist still applies):
+AISOC_SSRF_ALLOW_HOSTS=
+# Deny additional hosts or IPs on top of the built-in blocklist:
+AISOC_SSRF_EXTRA_BLOCKED_HOSTS=
+
# ─── Connectors ───────────────────────────────────────────────────────────────
# CrowdStrike Falcon
CROWDSTRIKE_CLIENT_ID=
diff --git a/docker-compose.yml b/docker-compose.yml
index 0d179eb3b..5aa758f5b 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -451,6 +451,17 @@ services:
AISOC_SERVICE_TOKEN: ${AISOC_SERVICE_TOKEN:-}
AISOC_API_SERVICE_TOKEN: ${AISOC_API_SERVICE_TOKEN:-}
AISOC_CONNECTORS_SERVICE_TOKEN: ${AISOC_CONNECTORS_SERVICE_TOKEN:-}
+ # The SSRF guard runs in this process too: connector create/update and
+ # webhook destinations are validated here before anything is stored or
+ # delivered. The relax knobs therefore have to reach this container or
+ # an operator setting them in .env changes nothing — exactly how
+ # AISOC_SSRF_ALLOW_PRIVATE shipped reaching only the agents service
+ # while the enforcement that needed it had moved here and to
+ # connectors. ALLOW_HOSTS admits exact hostnames (no wildcards, no
+ # CIDR); neither knob can admit the cloud-metadata endpoints.
+ AISOC_SSRF_ALLOW_PRIVATE: ${AISOC_SSRF_ALLOW_PRIVATE:-}
+ AISOC_SSRF_ALLOW_HOSTS: ${AISOC_SSRF_ALLOW_HOSTS:-}
+ AISOC_SSRF_EXTRA_BLOCKED_HOSTS: ${AISOC_SSRF_EXTRA_BLOCKED_HOSTS:-}
# The agents service's credential, on the verifying side. `alert_writeback
# .service_token_valid` reads this and only this — it does NOT fall back
# to AISOC_SERVICE_TOKEN — so the internal context routes the agents
@@ -793,6 +804,12 @@ services:
AISOC_AIRGAPPED: ${AISOC_AIRGAPPED:-}
AISOC_AIRGAP_ALLOWLIST: ${AISOC_AIRGAP_ALLOWLIST:-}
AISOC_SSRF_ALLOW_PRIVATE: ${AISOC_SSRF_ALLOW_PRIVATE:-}
+ # The exact-host companion to ALLOW_PRIVATE, and the deny-harder list.
+ # One .env value reaches every service that runs the guard (api,
+ # connectors, and here) so the three processes cannot disagree about
+ # what an operator admitted.
+ AISOC_SSRF_ALLOW_HOSTS: ${AISOC_SSRF_ALLOW_HOSTS:-}
+ AISOC_SSRF_EXTRA_BLOCKED_HOSTS: ${AISOC_SSRF_EXTRA_BLOCKED_HOSTS:-}
# The agents service's own service credential, used in both directions:
# presented as `X-AiSOC-Service-Token` on the API's internal context
# routes, and verified by `app.security.tenant_scope` when the API calls
@@ -1146,6 +1163,16 @@ services:
# refused at boot.
AISOC_ALLOW_CLEARTEXT_DB: "1"
AISOC_ALLOW_CLEARTEXT_KAFKA: "1"
+ # Every connector egress path — the stateless test route, resource
+ # reads and scheduled polls — goes through the SSRF guard in this
+ # process (GHSA-cq4g-g6wp-4m2w). An on-prem SIEM on a private range or
+ # a named internal host is re-admitted with these, set once in .env;
+ # without them here the documented knobs reached only the agents
+ # service and a private-range connector was refused with no way to
+ # permit it. The cloud-metadata blocklist holds regardless.
+ AISOC_SSRF_ALLOW_PRIVATE: ${AISOC_SSRF_ALLOW_PRIVATE:-}
+ AISOC_SSRF_ALLOW_HOSTS: ${AISOC_SSRF_ALLOW_HOSTS:-}
+ AISOC_SSRF_EXTRA_BLOCKED_HOSTS: ${AISOC_SSRF_EXTRA_BLOCKED_HOSTS:-}
KAFKA_BOOTSTRAP_SERVERS: kafka:29092
REDIS_URL: redis://:${REDIS_PASSWORD:-redis_dev_secret}@redis:6379/6
DATABASE_URL: postgresql+asyncpg://aisoc_app:${AISOC_APP_DB_PASSWORD:-aisoc_app_dev_secret}@postgres:5432/aisoc