AISOCin‑a‑box

Console Guide

The Unified Portal (§4 of the spec) is one Next.js application serving two audiences: external customers (client_exec, client_it) and internal Concierge staff (concierge_analyst, concierge_lead, concierge_admin). The view switcher changes navigation, widget set, and information density — it can never widen data scope, because redaction happens server-side in FastAPI before serialization. A client user never "sees the internal view and loses buttons"; internal fields are not in the response at all.

The Phase C portal implements the modules below as a fully interactive Next.js application over the control-plane API: every list, console, and decision surface is live, working state lives in the URL (shareable), and every widget carries an Explain popover so operators can read why a number is the number it is.

Module map

Module Route Who Purpose
M1 Investigations & Tickets /investigations all alerts → cases → containment, AI summary first
M2 Observation Pipeline /pipeline all (density differs) boxes, tunnels, EPS, connectors
M3 Posture & Assistant /overview exec landing risk score, findings, RAG assistant drawer
M4 Security Journey /journey client_exec + concierge shared roadmap + compliance evidence
M5 Executive & Audit Reporting /reports all MTTD/MTTR, scheduled exports, audit browser
Admin /admin concierge_* only tenants, policy packs, agent-run inspector
ES|QL console /console (global), /investigations/{id}/esql (case-scoped) concierge only (cases:esql) live query console over the §3.5 tenant index allow-list: mapping-driven autocomplete, sample-value inserter, table⇄chart, shareable ?esql= URL state
Scenario lab /scenarios view: posture:read (all roles); run/stop: cases:update configure and run synthetic drills through the real ingest path — noise to the edge Vector sink, attacks to POST /v1/alerts — producing real cases, real HITL gates, real audit entries
System health /system pipeline:read live telemetry: cloud healthz, Vector metrics, ES cluster/nodes/indices, scenario-engine drop + latency stats, anomaly flags with the evidence behind each flag; 5 s poll

M1 — Investigations

  • Queue list. Internal default ?queue=my_book&state=open. Severity, state, assignee, free-text and time filters map to GET /v1/cases.
  • AI executive summary card. The primary artifact per case: narrative, confidence, MITRE techniques, run id, generation time. Client view gets the customer-safe variant; regenerate is internal-only.
  • Kill-chain timeline. Merged from GET /v1/cases/{id}/events — telemetry / enrichment / agent_decision / human_action / containment nodes. Evidence links appear only with cases:read:evidence.
  • Expandable queue rows. Each row expands in place to the raw alert JSON, a kill-chain strip, and entity pivot chips (host / user / process / IP). Evidence-capable roles pivot into the console pre-filtered (/console?esql=…); everyone else pivots into a text-filtered queue view — the role never sees raw ES|QL. Filters (state, sev, mitre, q) are URL state, so any view is a shareable link.
  • HITL approval queue. Decisions are made from the queue row or the case page, with a mandatory justification and MFA attestation on approvals. The UI is optimistic: the row flips to an in-flight badge immediately, and the undo toast aborts the request while in flight only — after the decision commits, the audit chain is append-only (§3.4) and a re-decision 409s by design.
  • Containment approval. The action card shows the requested action, blast radius, and the OPA decision preview before you decide. Approve/Reject posts with an idempotency key; the approval must bind to the open request_id, and (D-V1) an approval counts only when the session carries MFA attestation.
  • ES|QL runner — global console /console (concierge-only, 404 — not 403 — to clients) and the case-scoped /investigations/{id}/esql; both run the same component. Autocomplete serves field names from the tenant index's Elasticsearch mapping (server-probed via GET /api/esql/fields), with sample values from probed docs powering a click-to-insert; when a mapping probe 404s (index not created yet) the catalog falls back to fields derived from sample documents. Results render as table or chart (group + sum), export to CSV, and the query is URL state (?esql=) so a run is shareable. The reference path executes through the control-plane read-through with the §3.5 tenant index allow-list; production swaps the BFF target for POST /v1/esql/federate → tunnel gateway without touching the UI.

M2 — Observation Pipeline

  • Box health cards. tunnel up (heartbeat ≤ 90 s), disk/index watermark, local retention days, agent version vs target channel (drift is visible).
  • EPS chart. 1-minute rollups per source with the license-cap headroom line.
  • Connector wizard (M365/Entra, CrowdStrike, Defender, Palo Alto, AWS). OAuth device-code/admin-consent or API-key/cross-account-IAM per type. Credentials are written at creation only, sealed with the tenant KMS key; no GET ever returns secret material. :test dry-runs credential + scope.
  • Staleness budget per connector: last success, error class, retry countdown; >3 consecutive failures auto-opens an internal ops case.

Scenario lab & system health (operability)

  • Scenario lab (/scenarios) is the configurability fabric: four named drill presets (Quiet Tuesday, Ransomware drill, APT29 emulation, Noisy neighbor stress) plus free-form sliders — EPS, attack cadence, noise ratio, fleet size, injected tunnel latency, verdict mix. A run drives the real ingest path: noisy telemetry to the edge Vector sink (soc-box-ecs-*) and attack alerts through POST /v1/alerts into live triage. The page shows live throughput and undelivered events while the scenario engine (a process singleton in the portal BFF, 64-concurrency pool) delivers. Config is URL state — a shareable link reproduces the exact run.
  • Honest stub-LLM documentation. The reference stub LLM has exactly two deterministic verdict lanes: HIGHBLAST-shaped alerts suspend at the HITL gate (awaiting_approval), default-shaped alerts auto-remediate. verdict_mix_pct sets the share of attack alerts taking the HITL lane — and the page says so, instead of pretending the stub produces false positives.
  • System health (/system) is the diagnosability surface: cloud healthz, Vector component metrics (received/sent/discarded, buffer gauges, adaptive-concurrency backpressure), ES cluster health + per-node stats + per-index table, scenario-engine drop rate and round-trip latency (with the injected-latency baseline drawn on the graph), and anomaly flags. Every flag shows its evidence in the Explain popover — e.g. "214 of 4200 noise events undelivered in their 1 s window". Thresholds are deliberately conservative for a single-node reference stack.

M3 — Posture & Assistant

  • Live 0–100 risk score with exposure/hygiene/response/coverage components and 30-day trend; findings table filterable by severity, source, tactic, asset tag; "open related case" where detection already covers a finding.
  • AI Security Assistant drawer. Tenant-scoped RAG with citations, SSE streaming, and a read-only tool set (posture.findings.search, cases.summary.read, kb.search). It can never trigger containment. Every prompt/response goes to the §3 audit schema.

M4 — Security Journey

  • Roadmap board by domain (Identity/Endpoint/Network/Cloud/Response), states proposed → accepted → in_progress → validated → done. The customer accepts/rejects; the analyst manages the rest — same records, split verbs.
  • Compliance tracker (ISO 27001 / SOC 2 / Essential Eight): control coverage % with evidence provenance; where the platform can gather evidence from its own telemetry ("EDR coverage ≥95% hosts"), it is machine-evidenced, not typed.

M5 — Reporting & Audit

  • Metrics pages read nightly metric_snapshots (report pages never scan hot tables): MTTD, MTTR, mean time to acknowledge, containment counts by type/outcome, coverage %.
  • Scheduled exports: monthly exec pack, quarterly compliance pack with §3 audit-trail slices.
  • Audit browser: query by actor/case/action/time; export includes hash-chain verification so an auditor can prove non-tampering independently.

URL contract rules you can test

  • No tenant UUIDs in client-visible paths — tenancy comes from the session.
  • ?view=internal on a shared route, requested without the entitlement, is silently downgraded (302 strip), never a 403 that confirms the view exists.
  • Gated routes (/admin/*, esql) 404 to non-concierge roles.

Portal walkthrough (Phase C, against the reference stack)

  1. http://127.0.0.1:3000/ → login ([email protected], soc-demo-analyst, MFA 777777) → lands on the investigations queue.
  2. ⌘K / Ctrl-K anywhere → command palette: navigation, cases, and quick actions (seed, reset-to-baseline, copy current view URL). Keyboard-only: ↑/↓, Enter, Esc restores focus.
  3. /scenarios → pick a preset (or tune the sliders), Run → real ingest: noise into Vector, attacks through triage; live throughput + drops on the page, backpressure visible on /system.
  4. /investigations → the queue now holds real cases. Expand a row (raw alert JSON, kill-chain strip, entity pivots); the HITL rows at the top approve (MFA + justification) or deny (justification) — optimistic flip with an undo toast while in flight.
  5. /console → write an ES|QL query; autocomplete completes field names from the tenant's ES mapping; run; read the table or chart; export CSV; copy the ?esql= link.
  6. Open a case → scrub the timeline window, expand the verdict card into the evidence chain (cited audit refs), and follow a raw-doc link into /audit?focus={seq} — the chain browser expands, scrolls to, and highlights that event.
  7. /system → live health: cloud, Vector, ES widgets; anomaly flags with evidence; scenario-engine stats.
  8. /audit → verify the whole chain, re-derive any segment client-side (same canonical form + SHA-256), export WORM-ready CSV.