Files
AiSOC/plugins/auth0
Beenu Arora 4600e9982f feat: ship WS6 universal capture + WS7 tenant lake API + connector breadth
Implements two of the largest workstreams in the AI Stack & Data Integration
Plan v2 plus the connector breadth expansion that depends on them.

WS6 — universal capture
-----------------------
Every tenant now has a same-day path to AiSOC even when the source isn't
on the connector menu. Three capture surfaces:

  - email inbox: per-tenant `*@inbox.tryaisoc.com` aliases for forwarding
    detection emails. Inbox tokens are minted via /v1/inbox/tokens, the
    receiver classifies vendor templates (Defender, Sentinel, Crowdstrike,
    Wiz, GitHub Security Advisories, etc.), and the normalizer materializes
    them into OCSF.
  - generic webhook: signed `/v1/inbox/webhook/<token>` endpoint with HMAC
    verification, replay protection, and a YAML-based normalizer template
    library covering Splunk HEC, PagerDuty, Opsgenie, Cloudflare Logpush,
    AWS EventBridge/SNS, CEF over syslog, and 5 other shapes.
  - ITSM webhook: `/v1/inbox/itsm` accepts ServiceNow/Jira/Linear payloads
    so existing case state can flow in before WS8 closes the loop.

Web UI gets an Onboarding workspace that renders the inbox token, webhook
URL, and signing secret with copy-to-clipboard, plus an InboxTokensPanel
on the Connectors page for ongoing rotation.

WS7 — tenant lake API
---------------------
Self-service ad-hoc query surface backed by ClickHouse warm storage,
gated through a security-conscious SQL rewriter:

  - POST /v1/lake/sql parses every query with sqlglot, classifies the
    root expression, rejects DML/DDL/KILL and any non-SELECT shape,
    enforces the per-tenant table allowlist, injects a tenant_id
    predicate into every FROM table reference, and clamps LIMIT.
  - GET /v1/lake/schema exposes the same allowlist as a structured
    catalog so the MCP and UI can autocomplete safely.
  - LakeRateLimiter implements per-tenant token-bucket throttling with
    lazy refill (asyncio.Lock-protected), Retry-After headers, and
    monotonic-clock seeding so refill math survives clock jitter.
  - 69 unit tests across test_lake_sql.py (44) and test_lake_rate_limit.py
    (25) lock down rewriter behavior, including KILL, qualified table
    refs, garbage input, burst drains, and refill caps.

The lake is also surfaced through the MCP server (services/mcp/src/tools/
lake.ts + 637 lines of tests) so agents can run audited queries through
the same allowlist-and-tenant-predicate path.

Connector breadth
-----------------
13 new marketplace plugins (Auth0, Carbon Black, Chronicle, Cisco
Umbrella, Cortex XSIAM, Datadog Cloud SIEM, Email Inbox, Lacework,
Mimecast, Rapid7 InsightIDR, Salesforce, Slack Audit, Sumo Logic,
Tenable.io, Trend Vision One) plus an `email-inbox` plugin that wraps
the WS6 capture path. P0 manifests are generated via
scripts/generate_p0_manifests.py and synced into apps/web/public/
marketplace/index.json.

Plumbing
--------
  - services/api/app/api/v1/router.py registers /lake, /inbox, /oauth,
    and /agents routers.
  - new endpoints: agents.py, inbox.py, lake.py, oauth.py.
  - services/ingest grows an inbox/template engine (template.go +
    template_test.go, 374 lines) and 11 vendor template YAMLs.
  - apps/docs adds connectors/universal-capture.md and the sidebar
    routes to it.
  - Touched: main.py, models/__init__.py, models/connector.py,
    core/config.py, core/security.py to wire the new feature flags
    (AISOC_INBOX_*, AISOC_LAKE_*, AISOC_OAUTH_*).

Validated:
  - 69/69 lake unit tests pass (sqlglot rewriter + token-bucket
    limiter)
  - services/ingest inbox/template_test.go passes
  - services/mcp lake.test.ts passes (637 lines of tool surface tests)
  - Marketplace JSON validated by `pnpm marketplace:sync`
  - python -m py_compile on all touched API modules

Plan refs: WS6, WS7 of ai-stack-data-integration-plan.
2026-05-08 22:39:13 -07:00
..