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.

Merge PR #1331: depth 8.1 — a11y on case list and case workspace

beenuar681e8114aa6b
diff --cc apps/docs/docs/compliance/evidence-pack.md
index c5c6fd122,514f30d38..e62514f1f
--- a/apps/docs/docs/compliance/evidence-pack.md
+++ b/apps/docs/docs/compliance/evidence-pack.md
@@@ -33,10 -33,8 +33,10 @@@ and says so
| Prompt-injection resistance | Three adversarial corpora: 32 payloads scanned in isolation and 71 incident pairs whose payloads are placed in attacker-controllable fields, both against a clean twin with a recall floor and a false-positive ceiling, plus 34 held-out pairs authored after the guard was frozen and carrying no floor at all, on which the guard measures 7.1% | `services/agents/tests/adversarial/` |
| Claim-to-gate traceability | Every product claim mapped to the CI job that fails when it stops being true | `docs/audit/CLAIM_TO_GATE_MATRIX.md` |
- The last row is the one worth reading first. It is the honest index: 301 rows
+ The last row is the one worth reading first. It is the honest index: 269 rows
`GATED`, 2 `PARTIAL`, and a ratchet that refuses to let a row sit at
+
+`GATED`, 3 `PARTIAL`, and a ratchet that refuses to let a row sit at
`NO GATE`. Re-read the figure from the table rather than from here — a count
copied into prose goes stale in silence, which is why
`scripts/readme_gates.py` cross-checks this sentence against the matrix.
diff --cc apps/web/src/components/cases/CaseWorkspace.tsx
index 7e44f4f1f,f775154e2..e0e4bcc2d
--- a/apps/web/src/components/cases/CaseWorkspace.tsx
+++ b/apps/web/src/components/cases/CaseWorkspace.tsx
@@@ -17,37 -17,44 +17,45 @@@
* a fabricated incident on screen under the id the analyst had opened.
*/
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
- import Link from 'next/link';
- import { useSearchParams } from 'next/navigation';
- import useSWR from 'swr';
- import { clsx } from 'clsx';
- import { format, formatDistanceToNow } from 'date-fns';
- import toast from 'react-hot-toast';
- import { apiFetch, type AttackChainTimeline, type AttackChainWindow, type Case, type CaseAttackPath, casesApi, type CaseSeverity, type CaseStatus, type CaseTask, type CaseTimelineEvent, graphApi, realtimeApi } from '@/lib/api';
- import { Skeleton } from '@/components/ui/Skeleton';
- import { ErrorState } from '@/components/ui/ErrorState';
- import { EmptyState } from '@/components/ui/EmptyState';
- import { InvestigationLedger } from './InvestigationLedger';
- import { WarRoomPanel } from './WarRoomPanel';
- import { ContextualActions } from '@/components/copilot/ContextualActions';
- import { canUseDemoData } from '@/lib/demoFallback';
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
+ import Link from "next/link";
+ import { useSearchParams } from "next/navigation";
+ import useSWR from "swr";
+ import { clsx } from "clsx";
+ import { format, formatDistanceToNow } from "date-fns";
+ import toast from "react-hot-toast";
+ import {
+ apiFetch,
+ type AttackChainTimeline,
+ type AttackChainWindow,
+ type Case,
+ type CaseAttackPath,
+ casesApi,
+ type CaseSeverity,
+ type CaseStatus,
+ type CaseTask,
+ type CaseTimelineEvent,
+ graphApi,
+ realtimeApi,
+ } from "@/lib/api";
+ import { Skeleton } from "@/components/ui/Skeleton";
+ import { ErrorState } from "@/components/ui/ErrorState";
+ import { EmptyState } from "@/components/ui/EmptyState";
+ import { InvestigationLedger } from "./InvestigationLedger";
++import { WarRoomPanel } from "./WarRoomPanel";
+ import { ContextualActions } from "@/components/copilot/ContextualActions";
+ import { canUseDemoData } from "@/lib/demoFallback";
type WorkspaceTab =
- | 'overview'
- | 'investigation'
- | 'attack-path'
- | 'attack-chain'
- | 'ledger'
- | 'report';
+ "overview" | "investigation" | "attack-path" | "attack-chain" | "ledger" | "report";
const VALID_TABS: readonly WorkspaceTab[] = [
- 'overview',
- 'investigation',
- 'attack-path',
- 'attack-chain',
- 'ledger',
- 'report',
+ "overview",
+ "investigation",
+ "attack-path",
+ "attack-chain",
+ "ledger",
+ "report",
];
function isWorkspaceTab(value: string | null): value is WorkspaceTab {
@@@ -966,169 -992,167 +993,172 @@@ export function CaseWorkspace({ caseId
LLM has grounding without ballooning token usage. Backed by
`services/agents` `/api/v1/contextual` endpoints.
*/}
- <ContextualActions
- page="cases"
- entityId={caseRecord.id}
- caseId={caseRecord.id}
- entity={{
- title: caseRecord.title,
- description: caseRecord.description,
- severity: caseRecord.severity,
- status: caseRecord.status,
- assignee: caseRecord.assignee,
- mitre: caseRecord.mitre,
- tags: caseRecord.tags,
- alert_ids: caseRecord.alertIds,
- alert_count: caseRecord.alertCount,
- created_at: caseRecord.createdAt,
- updated_at: caseRecord.updatedAt,
- due_at: caseRecord.dueAt,
- }}
- eyebrow="Ask AiSOC about this case"
- />
-
- {/* Depth 9.4 — one action opens a Slack or Teams channel for this case
- and mirrors its timeline into it. Above the three columns because
- it is an action on the case, not a facet of it. */}
- <WarRoomPanel caseId={caseId} />
-
- <div className="grid grid-cols-1 gap-4 lg:grid-cols-12">
- {/* Left: Linked alerts + IOCs */}
- <aside className="lg:col-span-3 space-y-4">
- <Panel title={`Linked alerts (${caseRecord.alertIds?.length ?? 0})`}>
- {(caseRecord.alertIds ?? []).length === 0 ? (
- <EmptyState
- title="No alerts linked"
- description="Link alerts from the alerts feed."
- />
- ) : (
- <ul className="space-y-1.5">
- {(caseRecord.alertIds ?? []).map((id) => (
- <li key={id}>
- <Link
- href={`/alerts?focus=${encodeURIComponent(id)}`}
- className="flex items-center justify-between rounded-md border border-slate-800/80 bg-slate-900/40 px-2.5 py-1.5 text-xs text-slate-300 transition-colors hover:border-slate-700 hover:bg-slate-800/40"
- >
- <span className="font-mono">{id}</span>
- <span className="text-[10px] uppercase tracking-wide text-slate-500">open</span>
- </Link>
- </li>
- ))}
- </ul>
- )}
- </Panel>
+ <ContextualActions
+ page="cases"
+ entityId={caseRecord.id}
+ caseId={caseRecord.id}
+ entity={{
+ title: caseRecord.title,
+ description: caseRecord.description,
+ severity: caseRecord.severity,
+ status: caseRecord.status,
+ assignee: caseRecord.assignee,
+ mitre: caseRecord.mitre,
+ tags: caseRecord.tags,
+ alert_ids: caseRecord.alertIds,
+ alert_count: caseRecord.alertCount,
+ created_at: caseRecord.createdAt,
+ updated_at: caseRecord.updatedAt,
+ due_at: caseRecord.dueAt,
+ }}
+ eyebrow="Ask AiSOC about this case"
+ />
- <Panel title="Tasks">
- <div className="mb-2 flex items-center gap-2 text-[11px] text-slate-400">
- <div className="h-1.5 flex-1 overflow-hidden rounded-full bg-slate-800">
- <div
- className="h-full rounded-full bg-emerald-500 transition-all"
- style={{ width: `${tasksProgress}%` }}
- />
- </div>
- <span>
- {tasksDone}/{tasks.length}
- </span>
- </div>
- {tasks.length === 0 ? (
- <EmptyState title="No tasks yet" description="Add the first one below." />
- ) : (
- <ul className="space-y-1.5">
- {tasks.map((t) => (
- <TaskRow
- key={t.id}
- task={t}
- onChangeStatus={(s) => void updateTaskStatus(t.id, s)}
++ {/* Depth 9.4 — one action opens a Slack or Teams channel for this case
++ and mirrors its timeline into it. Above the three columns because
++ it is an action on the case, not a facet of it. */}
++ <WarRoomPanel caseId={caseId} />
++
+ <div className="grid grid-cols-1 gap-4 lg:grid-cols-12">
+ {/* Left: Linked alerts + IOCs */}
+ {/* Two <aside> landmarks sit side by side here. Unnamed they
+ are indistinguishable in a landmark list, which is the one
+ place a screen-reader user navigates this page from. */}
+ <aside aria-label="Linked alerts" className="lg:col-span-3 space-y-4">
+ <Panel title={`Linked alerts (${caseRecord.alertIds?.length ?? 0})`}>
+ {(caseRecord.alertIds ?? []).length === 0 ? (
+ <EmptyState
+ title="No alerts linked"
+ description="Link alerts from the alerts feed."
/>
- ))}
- </ul>
- )}
- <div className="mt-2 flex items-center gap-2">
- <input
- value={newTask}
- onChange={(e) => setNewTask(e.target.value)}
- onKeyDown={(e) => {
- if (e.key === 'Enter') void addTask();
- }}
- placeholder="Add task and press ↵"
- className="flex-1 rounded-md border border-slate-700/70 bg-slate-900/40 px-2 py-1.5 text-xs text-slate-100 placeholder-slate-600 focus:border-emerald-500/40 focus:outline-none"
- />
- <button
- onClick={() => void addTask()}
- className="rounded-md bg-emerald-500 px-2.5 py-1.5 text-xs font-semibold text-emerald-950 transition-colors hover:bg-emerald-400 disabled:cursor-not-allowed disabled:bg-slate-800 disabled:text-slate-500"
- disabled={!newTask.trim()}
+ ) : (
+ <ul className="space-y-1.5">
+ {(caseRecord.alertIds ?? []).map((id) => (
+ <li key={id}>
+ <Link
+ href={`/alerts?focus=${encodeURIComponent(id)}`}
+ className="flex items-center justify-between rounded-md border border-slate-800/80 bg-slate-900/40 px-2.5 py-1.5 text-xs text-slate-300 transition-colors hover:border-slate-700 hover:bg-slate-800/40"
+ >
+ <span className="font-mono">{id}</span>
+ <span className="text-[10px] uppercase tracking-wide text-slate-500">
+ open
+ </span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ )}
+ </Panel>
+
+ <Panel title="Tasks">
+ <div className="mb-2 flex items-center gap-2 text-[11px] text-slate-400">
+ <div className="h-1.5 flex-1 overflow-hidden rounded-full bg-slate-800">
+ <div
+ className="h-full rounded-full bg-emerald-500 transition-all"
+ style={{ width: `${tasksProgress}%` }}
+ />
+ </div>
+ <span>
+ {tasksDone}/{tasks.length}
+ </span>
+ </div>
+ {tasks.length === 0 ? (
+ <EmptyState title="No tasks yet" description="Add the first one below." />
+ ) : (
+ <ul className="space-y-1.5">
+ {tasks.map((t) => (
+ <TaskRow
+ key={t.id}
+ task={t}
+ onChangeStatus={(s) => void updateTaskStatus(t.id, s)}
+ />
+ ))}
+ </ul>
+ )}
+ <div className="mt-2 flex items-center gap-2">
+ <input
+ value={newTask}
+ onChange={(e) => setNewTask(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") void addTask();
+ }}
+ placeholder="Add task and press ↵"
+ className="flex-1 rounded-md border border-slate-700/70 bg-slate-900/40 px-2 py-1.5 text-xs text-slate-100 placeholder-slate-600 focus:border-emerald-500/40 focus:outline-none"
+ />
+ <button
+ onClick={() => void addTask()}
+ className="rounded-md bg-emerald-500 px-2.5 py-1.5 text-xs font-semibold text-emerald-950 transition-colors hover:bg-emerald-400 disabled:cursor-not-allowed disabled:bg-slate-800 disabled:text-slate-500"
+ disabled={!newTask.trim()}
+ >
+ Add
+ </button>
+ </div>
+ </Panel>
+ </aside>
+
+ {/* Center: Timeline */}
+ <section className="lg:col-span-6">
+ <Panel
+ title="Timeline"
+ actions={
+ <span className="text-[11px] text-slate-500">{sortedTimeline.length} events</span>
+ }
>
- Add
- </button>
- </div>
- </Panel>
- </aside>
-
- {/* Center: Timeline */}
- <section className="lg:col-span-6">
- <Panel
- title="Timeline"
- actions={
- <span className="text-[11px] text-slate-500">
- {sortedTimeline.length} events
- </span>
- }
- >
- {sortedTimeline.length === 0 ? (
- <EmptyState
- title="Quiet so far"
- description="Activity, comments, and agent runs will appear here."
- />
- ) : (
- <ol className="relative space-y-3 before:absolute before:left-3.5 before:top-2 before:bottom-2 before:w-px before:bg-slate-800/80">
- {sortedTimeline.map((e) => (
- <TimelineItem key={e.id} event={e} />
- ))}
- </ol>
- )}
- </Panel>
- </section>
-
- {/* Right: Notes / activity composer */}
- <aside className="lg:col-span-3 space-y-4">
- <Panel title="Notes & comments">
- <div className="space-y-2">
- <textarea
- value={newComment}
- onChange={(e) => setNewComment(e.target.value)}
- rows={4}
- placeholder="Drop your findings, IOCs, or next steps…"
- className="w-full resize-none rounded-md border border-slate-700/70 bg-slate-900/40 px-2 py-1.5 text-xs text-slate-100 placeholder-slate-600 focus:border-emerald-500/40 focus:outline-none"
- />
- <div className="flex items-center justify-end gap-2">
- <button
- onClick={() => setNewComment('')}
- className="rounded-md border border-slate-700/70 px-2.5 py-1.5 text-xs text-slate-300 hover:border-slate-600"
- >
- Clear
- </button>
- <button
- onClick={() => void addComment()}
- disabled={!newComment.trim()}
- className="rounded-md bg-emerald-500 px-2.5 py-1.5 text-xs font-semibold text-emerald-950 transition-colors hover:bg-emerald-400 disabled:cursor-not-allowed disabled:bg-slate-800 disabled:text-slate-500"
- >
- Post
- </button>
- </div>
- </div>
- </Panel>
-
- <Panel title="Resolution">
- <textarea
- defaultValue={caseRecord.resolution ?? ''}
- rows={5}
- placeholder="Final summary, root cause, remediation…"
- className="w-full resize-none rounded-md border border-slate-700/70 bg-slate-900/40 px-2 py-1.5 text-xs text-slate-100 placeholder-slate-600 focus:border-emerald-500/40 focus:outline-none"
- />
- </Panel>
- </aside>
- </div>
- </div>
+ {sortedTimeline.length === 0 ? (
+ <EmptyState
+ title="Quiet so far"
+ description="Activity, comments, and agent runs will appear here."
+ />
+ ) : (
+ <ol className="relative space-y-3 before:absolute before:left-3.5 before:top-2 before:bottom-2 before:w-px before:bg-slate-800/80">
+ {sortedTimeline.map((e) => (
+ <TimelineItem key={e.id} event={e} />
+ ))}
+ </ol>
+ )}
+ </Panel>
+ </section>
+
+ {/* Right: Notes / activity composer */}
+ <aside aria-label="Notes and comments" className="lg:col-span-3 space-y-4">
+ <Panel title="Notes & comments">
+ <div className="space-y-2">
+ <textarea
+ value={newComment}
+ onChange={(e) => setNewComment(e.target.value)}
+ rows={4}
+ placeholder="Drop your findings, IOCs, or next steps…"
+ className="w-full resize-none rounded-md border border-slate-700/70 bg-slate-900/40 px-2 py-1.5 text-xs text-slate-100 placeholder-slate-600 focus:border-emerald-500/40 focus:outline-none"
+ />
+ <div className="flex items-center justify-end gap-2">
+ <button
+ onClick={() => setNewComment("")}
+ className="rounded-md border border-slate-700/70 px-2.5 py-1.5 text-xs text-slate-300 hover:border-slate-600"
+ >
+ Clear
+ </button>
+ <button
+ onClick={() => void addComment()}
+ disabled={!newComment.trim()}
+ className="rounded-md bg-emerald-500 px-2.5 py-1.5 text-xs font-semibold text-emerald-950 transition-colors hover:bg-emerald-400 disabled:cursor-not-allowed disabled:bg-slate-800 disabled:text-slate-500"
+ >
+ Post
+ </button>
+ </div>
+ </div>
+ </Panel>
+
+ <Panel title="Resolution">
+ <textarea
+ defaultValue={caseRecord.resolution ?? ""}
+ rows={5}
+ placeholder="Final summary, root cause, remediation…"
+ className="w-full resize-none rounded-md border border-slate-700/70 bg-slate-900/40 px-2 py-1.5 text-xs text-slate-100 placeholder-slate-600 focus:border-emerald-500/40 focus:outline-none"
+ />
+ </Panel>
+ </aside>
+ </div>
+ </div>
)}
</div>
);