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.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
feat(v7.0): v1.0 buyer-value plan — attribution, digest PDF, BYOK, air-gap, WCAG, ChatOps, analytics
Beenu Arora250de520c370
diff --git a/AGENTS.md b/AGENTS.mdindex c6e47939a..01244849a 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -37,3 +37,11 @@- PRs touching the agent, orchestrator graph, prompts, tools, RAG corpus, or detection content must re-grade against the harness and include before/after deltas in the PR body if any axis regresses.- Project website at `tryaisoc.com`; domain registered through Cloudflare.- Production hosting target is Fly.io for backend services.+- v1.0 buyer-value plan (`aisoc_v1.0_—_buyer-value_plan_c8116970.plan.md`) is fully implemented (all WS-A through WS-H workstreams completed as of May 2026). Key additions:+ - WS-A: Demo seed script at `services/api/app/scripts/seed_demo.py` — 15 realistic incidents, one-click Render deploy (`render.yaml` + README badge).+ - WS-C: 25 named parameterised playbooks (WS-C1), playbook gallery with eval gate (WS-C2/C3).+ - WS-D: Auto-summary at investigation close with PDF export (WS-D2), replayable investigation timeline (WS-D3), rate-limit + real-test hardening (WS-D1).+ - WS-F: Light/dark theme persisted in user profile (WS-F1), WCAG AA axe-core CI gate (WS-F2), saved views on Alerts/Cases/Playbooks + drag-drop dashboard widgets (WS-F3), visual SOAR studio (undo/redo, edge validation, schema-driven forms — WS-F4), empty-state polish + v1.1 deferred badges (WS-F5).+ - WS-G: Slack Bolt service at `services/slack-bot/` with `/aisoc` ChatOps commands (WS-G1); executive digest with auto-generated PDF + weekly scheduler in `services/api/app/services/digest_pdf.py` and `services/api/app/api/v1/endpoints/reports.py` (WS-G2).+ - WS-H: LLM cost dashboard (`services/api/app/services/cost_dashboard.py` + `apps/web/src/app/(admin)/costs/page.tsx` — WS-H1); BYOK per-tenant LLM credentials vault-encrypted via `CredentialVault`, model `TenantLlmCredential`, settings UI in `apps/web/src/components/settings/SettingsView.tsx` (WS-H2); compliance audit export CSV + HTML bundles at `services/api/app/services/audit_export.py` (WS-H3); air-gapped / local-LLM mode via Ollama/LiteLLM overlay + zero-external-call demo seed (WS-H4).+ - Threat actor attribution engine v0 at `services/threatintel/` (rebased, hardened, open as PR #43).diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f3aabd64b..2572d7c7c 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -7,6 +7,71 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## [Unreleased]+### Added — Threat Actor Attribution Engine (v0)++- **`services/threatintel/app/actors/attribution.py`** — New+ `ThreatActorAttributionEngine` scores observed IOCs, MITRE ATT&CK+ techniques, tools, and target sectors against an in-memory catalog of+ three seed actor profiles (APT28, APT29, Lazarus). Scoring is the+ weighted sum of TTP (0.4) / Tool (0.3) / Target (0.2) / IOC (0.1)+ components, multiplied by the actor profile's baseline confidence,+ then thresholded.+- **`services/threatintel/app/api/actor_attribution.py`** — New router+ mounted at `/api/v1/actors` with `POST /attribute`, `GET /profiles`,+ and `GET /profiles/{actor_id}`. Constructs the engine once via+ FastAPI lifespan and passes it through `Depends(get_attribution_engine)`.+- **`services/agents/app/agents/investigation_agent.py`** — Investigation+ agent now calls the attribution API after triage/enrichment and+ records the result on `state.threat_intel["attribution"]`. Failure is+ soft and surfaces a `[medium]` finding rather than aborting the+ investigation.+- **`docs/threat-actor-attribution.md`** — Full operator-facing docs,+ including scoring model, API surface, observability, env vars, v0+ caveats, and instructions for adding custom profiles.++### Configuration++- `AISOC_ATTRIBUTION_THRESHOLD` — Override the default confidence+ threshold (`0.30`). Clamped to `[0.0, 1.0]`; invalid values fall back+ to the default and emit a warning.+- `AISOC_THREATINTEL_URL` — Base URL the agent uses to reach the+ `threatintel` service. Default: `http://threatintel:8083`.+- `AISOC_ATTRIBUTION_TIMEOUT_SECONDS` — HTTP timeout the agent uses for+ attribution calls. Default: `10`.++### Observability++- New Prometheus series exported by `threatintel`:+ - `threatintel_attribution_requests_total{result="matched|unknown|error"}`+ - `threatintel_attribution_score{actor_id}` (histogram)++### Engine internals++- Tool matching uses an alphanumeric-only boundary regex+ (`(?<![a-zA-Z0-9])tool(?![a-zA-Z0-9])`) instead of Python's `\b`.+ Python's `\b` treats `_` as a word character, which broke common+ malware-filename patterns like `miniduke_v3.dll`. The new boundary+ treats `_`, `-`, `.`, and `/` as delimiters while still rejecting+ alphanumeric neighbours (so `x-agent` does not match `x-agentic`).+- Tool matching now also scans the IOC's `description` and `tags`+ fields, not just `value`.+- IOC lookups go through a new public method `OpenSearchStore.match_ioc_values()`+ rather than reaching into `os_store._os.search()` directly.+- The attribution engine accepts a `catalog` constructor argument so+ tests and downstream services can inject custom profiles without+ monkey-patching module-level state.+- An empty catalog now resolves to `actor_id="unknown"` with explicit+ reasoning (`"Actor catalog is empty"`), instead of confusingly+ falling through to the no-match-above-threshold branch.++### Security caveat++The `/api/v1/actors/*` endpoints are reachable on the `threatintel`+service without RBAC enforcement in v0 — they assume cluster-internal+network reachability only. Do **not** expose them through public+ingress until a `Depends(require_permission(...))` guard is added.+Tracked as a known limitation in the docs.+## [6.1.0] — 2026-05-07### Added — v1.5 market-driven feature expansiondiff --git a/apps/docs/docs/operations/air-gapped.md b/apps/docs/docs/operations/air-gapped.mdnew file mode 100644index 000000000..a1e1ae45b--- /dev/null+++ b/apps/docs/docs/operations/air-gapped.md@@ -0,0 +1,219 @@+---+title: Air-gapped / Local-LLM Mode+sidebar_label: Air-gapped mode+sidebar_position: 6+---++# Air-gapped / Local-LLM Mode++AiSOC can run **entirely within your network perimeter** with zero outbound LLM+calls. The feature is controlled by a single environment variable and a+companion Docker Compose overlay that wires in a local inference server (Ollama,+LiteLLM, or vLLM).++---++## Quick start (Ollama + Docker Compose)++The easiest path is the pre-built air-gap overlay shipped in the repository:++```bash+docker compose \+ -f docker-compose.demo.yml \+ -f docker-compose.airgap.yml \+ up -d+```++What it does:++| Component | Action |+|-----------|--------|+| `ollama` service | Starts `ollama/ollama:0.6.7` bound to `127.0.0.1:11434` |+| `ollama-pull` init container | Pulls the pinned model on first boot (cached on restart) |+| `agents` service override | Sets `AISOC_AIRGAPPED=true`, `LLM_BASE_URL`, `LLM_MODEL`, blanks external keys |++The pinned default model is **`llama3.2:3b-instruct-q4_K_M`** (~2 GB). To use+a larger model:++```bash+AIRGAP_LLM_MODEL=llama3.1:8b-instruct-q4_K_M \+docker compose -f docker-compose.demo.yml -f docker-compose.airgap.yml up -d+```++---++## How air-gap enforcement works++Setting `AISOC_AIRGAPPED=true` activates an allow-list check inside the LLM+resolver (`services/agents/app/security/llm_resolver.py`). When a credential+set is resolved:++1. **Local providers pass** — any base URL containing `ollama`, `vllm`, or+ `litellm` (or mapped by the `_HOSTED_SUBSTRINGS` table) is classified as+ local and is always permitted.+2. **External providers are blocked** — any credential pointing to a hosted API+ (`api.openai.com`, `*.azure.com`, `generativelanguage.googleapis.com`, etc.)+ raises `AirgapViolationError` before the HTTP call is made.+3. **Deterministic fallback** — if no local LLM is configured either, the+ investigator's deterministic synthesizer fills all LLM response fields with+ canned, reproducible output so the demo seed and evaluation harness complete+ without errors.++---++## Environment variables++| Variable | Default | Description |+|----------|---------|-------------|+| `AISOC_AIRGAPPED` | `false` | Set to `true` to enforce local-only LLM calls |+| `LLM_BASE_URL` | _(unset)_ | OpenAI-compatible base URL of the local server (e.g. `http://ollama:11434/v1`) |+| `LLM_API_KEY` | _(unset)_ | API key passed to the local server (Ollama ignores it; use any non-empty string) |+| `LLM_MODEL` | _(unset)_ | Model name as understood by the local server (e.g. `llama3.2:3b-instruct-q4_K_M`) |++---++## Plugging in a different local inference server++### Ollama (recommended)++```env+AISOC_AIRGAPPED=true+LLM_BASE_URL=http://ollama.internal:11434/v1+LLM_API_KEY=ollama+LLM_MODEL=llama3.1:70b-instruct-q4_K_M+```++### LiteLLM proxy++LiteLLM can front multiple local backends (Ollama, vLLM, GGUF servers) behind a+single OpenAI-compatible endpoint:++```env+AISOC_AIRGAPPED=true+LLM_BASE_URL=http://litellm.internal:4000+LLM_API_KEY=<litellm-master-key>+LLM_MODEL=ollama/llama3.1:70b-instruct+```++### vLLM++```env+AISOC_AIRGAPPED=true+LLM_BASE_URL=http://vllm.internal:8000/v1+LLM_API_KEY=vllm-api-key+LLM_MODEL=meta-llama/Llama-3.1-70B-Instruct+```++---++## Tenant-level overrides (BYOK under air-gap)++Platform operators can allow individual tenants to bring their own local LLM+credentials via **Settings → Deployment & AI → LLM Provider**. The UI exposes+three local-provider options:++| Provider label | Internal `provider_type` |+|----------------|--------------------------|+| Local Ollama | `local-ollama` |+| Local LiteLLM | `local-litellm` |+| Local vLLM | `local-vllm` |++When `AISOC_AIRGAPPED=true`, the resolver validates that the tenant-supplied+base URL is classified as a local endpoint before allowing it. If a tenant+tries to configure an external endpoint, the request is rejected with HTTP 422+and the error `"airgap_violation"`.++---++## Verifying air-gap compliance++Call the LLM status endpoint after startup:++```bash+curl -s http://localhost:8000/api/v1/llm/status | jq .+```++A compliant response looks like:++```json+{+ "provider_type": "local-ollama",+ "model": "llama3.2:3b-instruct-q4_K_M",+ "reachable": true,+ "airgap_compliant": true+}+```++`airgap_compliant: false` means the resolved provider would make external calls.+Stop the stack, correct the environment variables, and restart.++---++## Running the demo seed in air-gapped mode++The demo seed script (`scripts/demo_seed.py`) seeds a reference incident and+kicks off an investigation with `"mode": "deterministic"`. In this mode:++* **Triage, hunt, and enrichment nodes** use the local LLM for scoring if+ `LLM_BASE_URL` is set, otherwise they use pre-computed deterministic stubs.+* **All external connector calls** remain in simulation mode (no live+ integrations are contacted).+* **Zero external LLM calls** are made when `AISOC_AIRGAPPED=true` and the+ local server is healthy.++```bash+# With the air-gap overlay running:+docker exec aisoc-api python scripts/demo_seed.py+```++Expected output includes `investigation_status: closed` and no `openai.com`+entries in the network logs.++---++## Kubernetes / production deployment++For production air-gapped clusters add these env vars to the `agents` Deployment:++```yaml+env:+ - name: AISOC_AIRGAPPED+ value: "true"+ - name: LLM_BASE_URL+ value: "http://ollama.llm-infra.svc.cluster.local:11434/v1"+ - name: LLM_API_KEY+ valueFrom:+ secretKeyRef:+ name: airgap-llm-creds+ key: api-key+ - name: LLM_MODEL+ value: "llama3.1:70b-instruct-q4_K_M"+ # Blank external keys explicitly+ - name: OPENAI_API_KEY+ value: ""+ - name: ANTHROPIC_API_KEY+ value: ""+```++Use a Kubernetes `NetworkPolicy` to deny egress to `api.openai.com` and other+external LLM endpoints as a defence-in-depth measure alongside the software+enforcement.++---++## Troubleshooting++| Symptom | Likely cause | Fix |+|---------|-------------|-----|+| `AirgapViolationError` in logs | `LLM_BASE_URL` points to an external host | Correct `LLM_BASE_URL` to your local server |+| `reachable: false` in `/api/v1/llm/status` | Local server not running | Check `docker compose ps` and Ollama health |+| Model pull timeout | Large model, slow disk | Use a smaller quantised model or increase `start_period` |+| `connection refused` on port 11434 | Port binding conflict | Change `127.0.0.1:11434` → a free port in the overlay |++---++## Related pages++* [Credentials & Vault](credentials.md) — how tenant secrets are encrypted at rest+* [API configuration](../getting-started/configuration.md) — all environment variables+* [Plugin SDK](../plugins/overview.md) — build connectors that work under air-gapdiff --git a/apps/docs/sidebars.ts b/apps/docs/sidebars.tsindex 32e309974..968d12c70 100644--- a/apps/docs/sidebars.ts+++ b/apps/docs/sidebars.ts@@ -62,6 +62,7 @@ const sidebars: SidebarsConfig = {"operations/security","operations/credentials","operations/airgap",+ "operations/air-gapped","operations/theming","operations/upgrades","operations/troubleshooting",diff --git a/apps/web/src/app/(app)/investigate/page.tsx b/apps/web/src/app/(app)/investigate/page.tsxindex 6e665afbf..d6846695c 100644--- a/apps/web/src/app/(app)/investigate/page.tsx+++ b/apps/web/src/app/(app)/investigate/page.tsx@@ -1,7 +1,78 @@-import InvestigationChat from '@/components/copilot/InvestigationChat';+"use client";-export const metadata = { title: 'Investigation Chat | AiSOC' };+/**+ * /investigate page — tabbed view: Chat | Timeline+ *+ * Author: Beenu <[email protected]>+ */++import dynamic from "next/dynamic";+import { useSearchParams } from "next/navigation";+import { Suspense, useState } from "react";++const InvestigationChat = dynamic(+ () => import("@/components/copilot/InvestigationChat"),+ { ssr: false },+);++const InvestigationTimeline = dynamic(+ () => import("@/components/copilot/InvestigationTimeline"),+ { ssr: false },+);++type Tab = "chat" | "timeline";++function InvestigatePageInner() {+ const searchParams = useSearchParams();+ const runId = searchParams.get("runId") ?? undefined;+ const [activeTab, setActiveTab] = useState<Tab>("chat");++ return (+ <div className="flex h-full flex-col bg-slate-950 text-slate-100">+ {/* Tab bar */}+ <div className="flex border-b border-slate-800 bg-slate-900">+ {(["chat", "timeline"] as Tab[]).map((tab) => (+ <button+ key={tab}+ onClick={() => setActiveTab(tab)}+ className={`px-5 py-2.5 text-sm font-medium capitalize transition-colors+ ${activeTab === tab+ ? "border-b-2 border-indigo-500 text-indigo-300"+ : "text-slate-400 hover:text-slate-200"}`}+ >+ {tab === "chat" ? "💬 Chat" : "🕐 Timeline"}+ </button>+ ))}+ {runId && (+ <span className="ml-auto flex items-center pr-4 text-xs text-slate-500">+ run: {runId.slice(0, 8)}…+ </span>+ )}+ </div>++ {/* Tab content */}+ <div className="flex-1 overflow-hidden">+ {activeTab === "chat" && <InvestigationChat runId={runId} />}+ {activeTab === "timeline" && (+ <div className="h-full overflow-y-auto p-4">+ <InvestigationTimeline runId={runId} />+ </div>+ )}+ </div>+ </div>+ );+}export default function InvestigatePage() {- return <InvestigationChat />;+ return (+ <Suspense+ fallback={+ <div className="flex h-full items-center justify-center text-slate-400">+ Loading…+ </div>+ }+ >+ <InvestigatePageInner />+ </Suspense>+ );}diff --git a/apps/web/src/components/alerts/AlertsView.tsx b/apps/web/src/components/alerts/AlertsView.tsxindex 547950857..0615e8cb3 100644--- a/apps/web/src/components/alerts/AlertsView.tsx+++ b/apps/web/src/components/alerts/AlertsView.tsx@@ -8,6 +8,7 @@ import { alertsApi, type Alert, type AlertFilters, type ConfidenceLabel } from 'import { clsx } from 'clsx';import { formatDistanceToNow } from 'date-fns';import { EntityRiskQueue } from './EntityRiskQueue';+import { ExplainDrawer } from './ExplainDrawer';import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';import { ErrorState } from '@/components/ui/ErrorState';import { SavedViewsBar } from '@/components/saved-views/SavedViewsBar';@@ -177,7 +178,10 @@ function FiltersBar({);}-function AlertRow({ alert }: { alert: Alert }) {+// WS-D1 — AlertRow accepts an onExplain callback so the Explain button can open+// the SSE-streaming side drawer without navigating away. The button uses+// e.preventDefault() + e.stopPropagation() to suppress the parent <Link>.+function AlertRow({ alert, onExplain }: { alert: Alert; onExplain: (a: Alert) => void }) {return (<Linkhref={`/alerts/${alert.id}`}@@ -206,6 +210,20 @@ function AlertRow({ alert }: { alert: Alert }) {</div><div className="flex items-center gap-2 shrink-0">+ {/* WS-D1: Explain button — opens SSE-streaming side drawer */}+ <button+ type="button"+ aria-label="AI explain this alert"+ title="AI Explain"+ onClick={(e) => {+ e.preventDefault();+ e.stopPropagation();+ onExplain(alert);+ }}+ className="text-[10px] font-medium px-2 py-0.5 rounded border border-violet-500/30 bg-violet-500/10 text-violet-400 hover:bg-violet-500/20 hover:border-violet-500/50 transition-colors shrink-0"+ >+ ✦ Explain+ </button>{alert.confidenceLabel && <ConfidencePill label={alert.confidenceLabel} />}<SeverityBadge severity={alert.severity} /><StatusBadge status={alert.status} />@@ -225,6 +243,8 @@ export function AlertsView() {// RBA work. Analysts can flip back to the raw alert grid for legacy// workflows or when triaging a specific alert ID.const [viewMode, setViewMode] = useState<ViewMode>('entities');+ // WS-D1 — controls the SSE-streaming Explain side drawer.+ const [explainAlert, setExplainAlert] = useState<Alert | null>(null);const { data, error, isLoading } = useSWR(['alerts', filters],@@ -298,12 +318,18 @@ export function AlertsView() {Alerts</button></div>- <button- onClick={() => toast('Manual alert creation is coming soon.', { icon: '🔔' })}- className="bg-blue-600 hover:bg-blue-500 text-white text-sm px-4 py-2 rounded-lg transition-colors"- >- + Create Alert- </button>+ <div className="flex items-center gap-2">+ <button+ disabled+ title="Manual alert creation is planned for v1.1"+ className="bg-gray-700 text-gray-400 text-sm px-4 py-2 rounded-lg cursor-not-allowed select-none"+ >+ + Create Alert+ </button>+ <span className="text-xs font-medium rounded-full bg-amber-500/15 text-amber-400 border border-amber-500/30 px-2 py-0.5">+ Planned for v1.1+ </span>+ </div></div></div>@@ -320,6 +346,18 @@ export function AlertsView() {isLoading={isLoading}error={error}onFilterChange={handleFilterChange}+ onExplain={setExplainAlert}+ />+ )}++ {/* WS-D1 — SSE-streaming AI explain side drawer.+ We always mount the drawer (open controls CSS visibility) so the+ closing animation can finish before the alert ref is cleared. */}+ {explainAlert && (+ <ExplainDrawer+ open={true}+ alert={explainAlert}+ onClose={() => setExplainAlert(null)}/>)}</div>@@ -338,6 +376,7 @@ function AlertsTable({isLoading,error,onFilterChange,+ onExplain,}: {alerts: Alert[];total: number;@@ -348,6 +387,7 @@ function AlertsTable({isLoading: boolean;error: unknown;onFilterChange: (f: AlertFilters) => void;+ onExplain: (a: Alert) => void;}) {return (<div className="space-y-4">@@ -439,7 +479,7 @@ function AlertsTable({) : (<div>{alerts.map((alert) => (- <AlertRow key={alert.id} alert={alert} />+ <AlertRow key={alert.id} alert={alert} onExplain={onExplain} />))}</div>)}diff --git a/apps/web/src/components/analytics/TeamAnalyticsView.tsx b/apps/web/src/components/analytics/TeamAnalyticsView.tsxindex 7f6a6f829..179cdd7e3 100644--- a/apps/web/src/components/analytics/TeamAnalyticsView.tsx+++ b/apps/web/src/components/analytics/TeamAnalyticsView.tsx@@ -2,6 +2,7 @@import { useState } from 'react';import { clsx } from 'clsx';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';interface Analyst {id: string;@@ -87,20 +88,23 @@ function achievementIcon(icon: Achievement['icon']) {export function TeamAnalyticsView() {const [sortBy, setSortBy] = useState<SortKey>('score');+ const [search, setSearch] = useState('');const totalCases = ANALYSTS.reduce((s, a) => s + a.casesClosed, 0);const avgResolution = Math.round(ANALYSTS.reduce((s, a) => s + a.avgResolutionMin, 0) / ANALYSTS.length);const teamAccuracy = (ANALYSTS.reduce((s, a) => s + a.accuracy, 0) / ANALYSTS.length).toFixed(1);const totalBadges = ANALYSTS.reduce((s, a) => s + a.badges.length, 0);- const sorted = [...ANALYSTS].sort((a, b) => {- switch (sortBy) {- case 'score': return b.score - a.score;- case 'cases': return b.casesClosed - a.casesClosed;- case 'accuracy': return b.accuracy - a.accuracy;- case 'speed': return a.avgResolutionMin - b.avgResolutionMin;- }- });+ const sorted = [...ANALYSTS]+ .filter((a) => !search.trim() || a.name.toLowerCase().includes(search.toLowerCase()))+ .sort((a, b) => {+ switch (sortBy) {+ case 'score': return b.score - a.score;+ case 'cases': return b.casesClosed - a.casesClosed;+ case 'accuracy': return b.accuracy - a.accuracy;+ case 'speed': return a.avgResolutionMin - b.avgResolutionMin;+ }+ });const SORT_OPTIONS: { key: SortKey; label: string }[] = [{ key: 'score', label: 'Score' },@@ -135,7 +139,14 @@ export function TeamAnalyticsView() {<div className="rounded-xl border border-gray-800/60 bg-gray-900/40 p-5 space-y-4"><div className="flex flex-wrap items-center justify-between gap-3"><h2 className="text-lg font-semibold text-white">Analyst Leaderboard</h2>- <div className="flex items-center gap-2">+ <div className="flex items-center gap-3">+ <input+ type="search"+ placeholder="Search analyst…"+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ className="rounded-lg border border-gray-700/60 bg-gray-900 px-3 py-1.5 text-xs text-gray-200 placeholder-gray-600 focus:outline-none focus:ring-1 focus:ring-indigo-500/60 w-44"+ /><span className="text-xs font-medium uppercase tracking-wider text-gray-500">Sort</span>{SORT_OPTIONS.map((opt) => (<button@@ -154,6 +165,22 @@ export function TeamAnalyticsView() {</div></div>+ {sorted.length === 0 ? (+ <EmptyState+ icon={<EmptyStateIcons.Search />}+ title="No analysts match your search"+ description="Try a different name or clear the search to see all analysts."+ action={+ <button+ type="button"+ onClick={() => setSearch('')}+ className="rounded-lg bg-gray-800 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 transition-colors"+ >+ Clear search+ </button>+ }+ />+ ) : (<div className="overflow-x-auto"><table className="w-full text-left text-sm"><thead>@@ -230,6 +257,7 @@ export function TeamAnalyticsView() {</tbody></table></div>+ )}</div>{/* Team Highlights */}diff --git a/apps/web/src/components/cases/CasesView.tsx b/apps/web/src/components/cases/CasesView.tsxindex 08ed9b4f9..51f197216 100644--- a/apps/web/src/components/cases/CasesView.tsx+++ b/apps/web/src/components/cases/CasesView.tsx@@ -191,15 +191,21 @@ export function CasesView({ initialCases }: CasesViewProps = {}) {<h1 className="text-xl font-semibold text-gray-100">Cases</h1><p className="text-sm text-gray-500 mt-0.5">Manage security investigations and incidents</p></div>- <button- onClick={() => toast('Case creation wizard is coming soon.', { icon: '📋' })}- className="flex items-center gap-2 bg-blue-600 hover:bg-blue-500 text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors"- >- <svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">- <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />- </svg>- New Case- </button>+ <div className="flex items-center gap-2">+ <button+ disabled+ title="Case creation wizard is planned for v1.1"+ className="flex items-center gap-2 bg-gray-700 text-gray-400 text-sm font-medium px-4 py-2 rounded-lg cursor-not-allowed select-none"+ >+ <svg className="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />+ </svg>+ New Case+ </button>+ <span className="text-xs font-medium rounded-full bg-amber-500/15 text-amber-400 border border-amber-500/30 px-2 py-0.5">+ Planned for v1.1+ </span>+ </div></div>{/* Stats */}diff --git a/apps/web/src/components/connectors/ConnectorInstanceList.tsx b/apps/web/src/components/connectors/ConnectorInstanceList.tsxindex 4e2e98d9b..80a5fd658 100644--- a/apps/web/src/components/connectors/ConnectorInstanceList.tsx+++ b/apps/web/src/components/connectors/ConnectorInstanceList.tsx@@ -318,10 +318,12 @@ function ConnectorCard({</button><buttontype="button"- onClick={() => onConfigure?.(connector)}- className="flex-1 text-xs bg-blue-600/20 hover:bg-blue-600/30 text-blue-400 px-3 py-2 rounded-lg transition-colors border border-blue-500/20"+ disabled+ title="Connector editing UI is planned for v1.1"+ className="flex-1 text-xs bg-gray-800/40 text-gray-500 px-3 py-2 rounded-lg border border-gray-700/40 cursor-not-allowed select-none">Configure+ <span className="ml-1.5 text-[10px] font-medium text-amber-400">v1.1</span></button>{onDelete && (<buttondiff --git a/apps/web/src/components/copilot/InvestigationChat.tsx b/apps/web/src/components/copilot/InvestigationChat.tsxindex 689e476d2..e2c2e7e23 100644--- a/apps/web/src/components/copilot/InvestigationChat.tsx+++ b/apps/web/src/components/copilot/InvestigationChat.tsx@@ -1,6 +1,6 @@'use client';-import { useEffect, useRef, useState } from 'react';+import { useCallback, useEffect, useRef, useState } from 'react';type MessageRole = 'user' | 'assistant' | 'system';@@ -11,6 +11,12 @@ interface ChatMessage {timestamp: string;}+interface SummaryArtifact {+ artifactId: string;+ summaryMarkdown: string;+ closedAt: string;+}+const QUICK_ACTIONS = ['Investigate Alert','Summarize Case',@@ -64,7 +70,12 @@ const CONTEXT = {riskLevel: 'High',};-export default function InvestigationChat() {+interface Props {+ /** Optional live run ID. When provided the Close button calls the real API. */+ runId?: string;+}++export default function InvestigationChat({ runId }: Props) {const [messages, setMessages] = useState<ChatMessage[]>([{id: 'sys-0',@@ -75,6 +86,13 @@ export default function InvestigationChat() {]);const [input, setInput] = useState('');const [isTyping, setIsTyping] = useState(false);+ const [isClosed, setIsClosed] = useState(false);+ const [isClosing, setIsClosing] = useState(false);+ const [summary, setSummary] = useState<SummaryArtifact | null>(null);+ const [showSummary, setShowSummary] = useState(false);+ const [analystNote, setAnalystNote] = useState('');+ const [showNoteInput, setShowNoteInput] = useState(false);+ const [pdfLoading, setPdfLoading] = useState(false);const scrollRef = useRef<HTMLDivElement>(null);useEffect(() => {@@ -84,7 +102,7 @@ export default function InvestigationChat() {const sendMessage = (text: string) => {const trimmed = text.trim();- if (!trimmed || isTyping) return;+ if (!trimmed || isTyping || isClosed) return;const userMsg: ChatMessage = {id: `u-${Date.now()}`,@@ -115,18 +133,195 @@ export default function InvestigationChat() {}};+ const handleCloseInvestigation = useCallback(async () => {+ setIsClosing(true);+ try {+ let artifactId: string;+ let summaryMarkdown: string;++ if (runId) {+ const res = await fetch(`/api/v1/investigations/${runId}/close`, {+ method: 'POST',+ headers: { 'Content-Type': 'application/json' },+ body: JSON.stringify({ analyst_note: analystNote || null }),+ });+ if (!res.ok) {+ throw new Error(`Close failed: ${res.status} ${await res.text()}`);+ }+ const data = await res.json();+ artifactId = data.artifact_id;+ summaryMarkdown = data.summary_markdown;+ } else {+ // Offline / demo mode — build a local summary from message history+ artifactId = `demo-${Date.now()}`;+ const msgLines = messages+ .filter((m) => m.role !== 'system')+ .slice(-10)+ .map((m) => `- [${m.role.toUpperCase()}] ${m.content.slice(0, 120)}`)+ .join('\n');+ summaryMarkdown =+ `# Investigation Summary — ${CONTEXT.caseId}\n\n` ++ `**Status:** closed \n**Case ID:** ${CONTEXT.caseId} \n**Alerts:** ${CONTEXT.alertCount} \n**IOCs:** ${CONTEXT.iocsFound} \n**Risk:** ${CONTEXT.riskLevel} \n\n` ++ `## Conversation (last 10 turns)\n\n${msgLines || '_No messages._'}\n\n` ++ (analystNote ? `## Analyst Note\n\n${analystNote}\n\n` : '') ++ `---\n*Generated by AiSOC — [email protected]*`;+ }++ setSummary({+ artifactId,+ summaryMarkdown,+ closedAt: new Date().toLocaleString(),+ });+ setIsClosed(true);+ setShowSummary(true);+ setShowNoteInput(false);++ const closedMsg: ChatMessage = {+ id: `sys-close-${Date.now()}`,+ role: 'system',+ content: '✓ Investigation closed. Summary generated and stored as an artifact.',+ timestamp: new Date().toISOString(),+ };+ setMessages((prev) => [...prev, closedMsg]);+ } catch (err) {+ console.error('[InvestigationChat] close error:', err);+ const errMsg: ChatMessage = {+ id: `sys-err-${Date.now()}`,+ role: 'system',+ content: `Failed to close investigation: ${String(err)}`,+ timestamp: new Date().toISOString(),+ };+ setMessages((prev) => [...prev, errMsg]);+ } finally {+ setIsClosing(false);+ }+ }, [runId, messages, analystNote]);++ const handleDownloadPdf = useCallback(async () => {+ if (!summary) return;+ setPdfLoading(true);++ try {+ if (runId) {+ const res = await fetch(`/api/v1/investigations/${runId}/summary.pdf`);+ if (!res.ok) throw new Error(`PDF fetch failed: ${res.status}`);+ const blob = await res.blob();+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `investigation-${runId}.pdf`;+ a.click();+ URL.revokeObjectURL(url);+ } else {+ // Client-side plain-text fallback when no backend is available+ const blob = new Blob([summary.summaryMarkdown], { type: 'text/plain' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `investigation-${CONTEXT.caseId}.md`;+ a.click();+ URL.revokeObjectURL(url);+ }+ } catch (err) {+ console.error('[InvestigationChat] PDF download error:', err);+ } finally {+ setPdfLoading(false);+ }+ }, [runId, summary]);+return (<div className="flex h-[calc(100vh-7rem)] gap-4">{/* Main chat area */}<div className="flex flex-1 flex-col rounded-xl border border-slate-800/80 bg-slate-900/40">{/* Header */}- <div className="border-b border-slate-800/80 px-4 py-3">- <h1 className="text-base font-semibold text-white">Investigation Chat</h1>- <p className="text-xs text-slate-400">- AI-assisted threat investigation — ask about alerts, IOCs, or cases- </p>+ <div className="flex items-start justify-between border-b border-slate-800/80 px-4 py-3">+ <div>+ <h1 className="text-base font-semibold text-white">Investigation Chat</h1>+ <p className="text-xs text-slate-400">+ AI-assisted threat investigation — ask about alerts, IOCs, or cases+ </p>+ </div>++ {/* Close / Status controls */}+ <div className="flex shrink-0 items-center gap-2">+ {isClosed ? (+ <>+ <span className="rounded-full bg-slate-700/60 px-2.5 py-1 text-xs font-medium text-slate-400">+ Closed+ </span>+ <button+ onClick={() => setShowSummary((s) => !s)}+ className="rounded-lg border border-slate-700/70 bg-slate-800/50 px-3 py-1.5 text-xs text-slate-300 hover:border-blue-500/40 hover:text-white"+ >+ {showSummary ? 'Hide Summary' : 'View Summary'}+ </button>+ {summary && (+ <button+ onClick={handleDownloadPdf}+ disabled={pdfLoading}+ className="rounded-lg bg-blue-700/80 px-3 py-1.5 text-xs font-semibold text-white hover:bg-blue-600 disabled:opacity-50"+ >+ {pdfLoading ? 'Exporting…' : '↓ PDF'}+ </button>+ )}+ </>+ ) : (+ <>+ {showNoteInput ? (+ <div className="flex items-center gap-2">+ <input+ type="text"+ value={analystNote}+ onChange={(e) => setAnalystNote(e.target.value)}+ placeholder="Optional analyst note…"+ className="rounded-lg border border-slate-700/70 bg-slate-950/50 px-2 py-1.5 text-xs text-slate-200 placeholder-slate-500 outline-none focus:border-blue-500/50"+ />+ <button+ onClick={handleCloseInvestigation}+ disabled={isClosing}+ className="rounded-lg bg-red-700/80 px-3 py-1.5 text-xs font-semibold text-white hover:bg-red-600 disabled:opacity-60"+ >+ {isClosing ? 'Closing…' : 'Confirm Close'}+ </button>+ <button+ onClick={() => setShowNoteInput(false)}+ className="rounded-lg border border-slate-700/70 px-2.5 py-1.5 text-xs text-slate-400 hover:text-white"+ >+ Cancel+ </button>+ </div>+ ) : (+ <button+ onClick={() => setShowNoteInput(true)}+ disabled={isTyping}+ className="rounded-lg border border-red-800/60 bg-red-950/30 px-3 py-1.5 text-xs font-semibold text-red-400 transition-colors hover:border-red-600/70 hover:bg-red-900/40 hover:text-red-300 disabled:opacity-50"+ >+ Close Investigation+ </button>+ )}+ </>+ )}+ </div></div>+ {/* Summary panel (shown when closed) */}+ {showSummary && summary && (+ <div className="border-b border-slate-800/80 bg-slate-950/60 px-4 py-4">+ <div className="mx-auto max-w-3xl">+ <div className="mb-2 flex items-center justify-between">+ <h3 className="text-sm font-semibold text-white">Investigation Summary</h3>+ <span className="text-[11px] text-slate-500">Closed {summary.closedAt}</span>+ </div>+ <pre className="max-h-64 overflow-y-auto whitespace-pre-wrap rounded-lg border border-slate-800/60 bg-slate-900/80 p-3 text-xs text-slate-300">+ {summary.summaryMarkdown}+ </pre>+ <p className="mt-1.5 text-[11px] text-slate-500">+ Artifact ID: <code className="text-slate-400">{summary.artifactId}</code>+ </p>+ </div>+ </div>+ )}+{/* Messages */}<div ref={scrollRef} className="min-h-0 flex-1 overflow-y-auto p-4"><ul className="mx-auto max-w-3xl space-y-3">@@ -171,39 +366,48 @@ export default function InvestigationChat() {{/* Quick actions + input */}<div className="border-t border-slate-800/80 p-3">- <div className="mx-auto flex max-w-3xl flex-wrap gap-2 pb-2">- {QUICK_ACTIONS.map((action) => (+ {!isClosed && (+ <div className="mx-auto flex max-w-3xl flex-wrap gap-2 pb-2">+ {QUICK_ACTIONS.map((action) => (+ <button+ key={action}+ onClick={() => sendMessage(action)}+ disabled={isTyping}+ className="rounded-full border border-slate-700/70 bg-slate-800/50 px-3 py-1.5 text-xs text-slate-300 transition-colors hover:border-blue-500/40 hover:bg-slate-700/60 hover:text-white disabled:opacity-50"+ >+ {action}+ </button>+ ))}+ </div>+ )}++ {isClosed ? (+ <p className="mx-auto max-w-3xl text-center text-xs text-slate-500">+ This investigation is closed. Open a new session to continue.+ </p>+ ) : (+ <div className="mx-auto flex max-w-3xl items-end gap-2 rounded-xl border border-slate-700/70 bg-slate-950/40 p-2 focus-within:border-blue-500/50">+ <textarea+ value={input}+ onChange={(e) => setInput(e.target.value)}+ onKeyDown={onKeyDown}+ rows={1}+ placeholder="Ask about an alert, IOC, or investigation…"+ className="flex-1 resize-none bg-transparent px-2 py-2 text-sm text-slate-100 placeholder-slate-500 outline-none"+ /><button- key={action}- onClick={() => sendMessage(action)}- disabled={isTyping}- className="rounded-full border border-slate-700/70 bg-slate-800/50 px-3 py-1.5 text-xs text-slate-300 transition-colors hover:border-blue-500/40 hover:bg-slate-700/60 hover:text-white disabled:opacity-50"+ onClick={() => sendMessage(input)}+ disabled={!input.trim() || isTyping}+ className={`flex-none rounded-lg px-3 py-2 text-sm font-semibold transition-colors ${+ input.trim() && !isTyping+ ? 'bg-blue-600 text-white hover:bg-blue-500'+ : 'bg-slate-800 text-slate-500'+ }`}>- {action}+ Send</button>- ))}- </div>- <div className="mx-auto flex max-w-3xl items-end gap-2 rounded-xl border border-slate-700/70 bg-slate-950/40 p-2 focus-within:border-blue-500/50">- <textarea- value={input}- onChange={(e) => setInput(e.target.value)}- onKeyDown={onKeyDown}- rows={1}- placeholder="Ask about an alert, IOC, or investigation…"- className="flex-1 resize-none bg-transparent px-2 py-2 text-sm text-slate-100 placeholder-slate-500 outline-none"- />- <button- onClick={() => sendMessage(input)}- disabled={!input.trim() || isTyping}- className={`flex-none rounded-lg px-3 py-2 text-sm font-semibold transition-colors ${- input.trim() && !isTyping- ? 'bg-blue-600 text-white hover:bg-blue-500'- : 'bg-slate-800 text-slate-500'- }`}- >- Send- </button>- </div>+ </div>+ )}</div></div>@@ -239,6 +443,16 @@ export default function InvestigationChat() {</p><p className="mt-1 text-lg font-bold text-red-400">{CONTEXT.riskLevel}</p></div>++ {/* Status badge */}+ <div className="rounded-lg border border-slate-800/80 bg-slate-800/30 p-3">+ <p className="text-[11px] font-medium uppercase tracking-wider text-slate-500">+ Status+ </p>+ <p className={`mt-1 text-sm font-semibold ${isClosed ? 'text-slate-400' : 'text-emerald-400'}`}>+ {isClosed ? '⬛ Closed' : '🟢 Active'}+ </p>+ </div></div><div className="mt-auto rounded-lg border border-slate-800/80 bg-slate-800/30 p-3">diff --git a/apps/web/src/components/copilot/InvestigationTimeline.tsx b/apps/web/src/components/copilot/InvestigationTimeline.tsxnew file mode 100644index 000000000..0309f7302--- /dev/null+++ b/apps/web/src/components/copilot/InvestigationTimeline.tsx@@ -0,0 +1,684 @@+"use client";++/**+ * InvestigationTimeline — WS-D3+ *+ * Scrubbable investigation timeline with:+ * • Visual timeline track with scrubber (click any node to jump)+ * • Per-node decision-provenance tooltip (reason, confidence, tool, next phase)+ * • Agent-decision diff badges when the same agent re-ran a step+ * • Artifact indicator (paper-clip icon)+ * • Live progress for in-progress runs via polling+ *+ * Author: Beenu <[email protected]>+ */++import { useCallback, useEffect, useRef, useState } from "react";++// ---------------------------------------------------------------------------+// Types (mirror backend TimelineResponse / TimelineNode)+// ---------------------------------------------------------------------------++interface TimelineDecision {+ reason: string | null;+ confidence: number | null;+ next_phase: string | null;+ tool_name: string | null;+ tool_args: Record<string, unknown> | null;+ tool_result_summary: string | null;+}++interface TimelineNode {+ seq: number;+ ts: string;+ kind: string;+ agent: string;+ summary: string;+ duration_ms: number;+ decision: TimelineDecision | null;+ has_artifact: boolean;+ diff_vs_prev_attempt: string | null;+}++interface TimelineResponse {+ run_id: string;+ case_id: string;+ status: string;+ total_duration_ms: number;+ attempt_count: number;+ nodes: TimelineNode[];+}++// ---------------------------------------------------------------------------+// Props+// ---------------------------------------------------------------------------++interface Props {+ /** Active investigation run ID. When provided the component fetches live data. */+ runId?: string;+ /** Optionally override the API base URL (useful for tests / storybook). */+ apiBase?: string;+ /** Called when the user clicks an artifact-bearing node. */+ onArtifactClick?: (runId: string, seq: number) => void;+}++// ---------------------------------------------------------------------------+// Helpers+// ---------------------------------------------------------------------------++const KIND_LABELS: Record<string, string> = {+ run_start: "Run started",+ agent_start: "Agent initialised",+ step: "Step",+ decision: "Decision",+ tool_call: "Tool call",+ tool_result: "Tool result",+ agent_output: "Agent output",+ run_end: "Run finished",+ error: "Error",+};++const KIND_COLORS: Record<string, string> = {+ run_start: "bg-blue-500",+ agent_start: "bg-indigo-500",+ step: "bg-slate-400",+ decision: "bg-yellow-500",+ tool_call: "bg-teal-500",+ tool_result: "bg-teal-300",+ agent_output: "bg-emerald-500",+ run_end: "bg-blue-700",+ error: "bg-red-500",+};++function kindColor(kind: string): string {+ return KIND_COLORS[kind] ?? "bg-slate-400";+}++function kindLabel(kind: string): string {+ return KIND_LABELS[kind] ?? kind.replace(/_/g, " ");+}++function formatDuration(ms: number): string {+ if (ms < 1000) return `${ms}ms`;+ if (ms < 60000) return `${(ms / 1000).toFixed(1)}s`;+ return `${Math.floor(ms / 60000)}m ${Math.round((ms % 60000) / 1000)}s`;+}++function confidenceBadge(c: number): string {+ if (c >= 0.8) return "text-emerald-400";+ if (c >= 0.6) return "text-yellow-400";+ return "text-red-400";+}++// ---------------------------------------------------------------------------+// Tooltip component+// ---------------------------------------------------------------------------++function DecisionTooltip({ decision }: { decision: TimelineDecision }) {+ return (+ <div className="absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 w-72 rounded-lg border border-slate-700 bg-slate-900 p-3 text-xs shadow-xl">+ <div className="mb-1 text-[10px] font-semibold uppercase tracking-wider text-slate-400">+ Decision provenance+ </div>+ {decision.reason && (+ <p className="mb-1 text-slate-200">+ <span className="font-medium text-slate-400">Reason: </span>+ {decision.reason}+ </p>+ )}+ {decision.confidence !== null && (+ <p className="mb-1">+ <span className="font-medium text-slate-400">Confidence: </span>+ <span className={confidenceBadge(decision.confidence)}>+ {(decision.confidence * 100).toFixed(0)}%+ </span>+ </p>+ )}+ {decision.next_phase && (+ <p className="mb-1 text-slate-200">+ <span className="font-medium text-slate-400">Next phase: </span>+ {decision.next_phase}+ </p>+ )}+ {decision.tool_name && (+ <p className="mb-1 text-slate-200">+ <span className="font-medium text-slate-400">Tool: </span>+ <code className="rounded bg-slate-800 px-1 text-teal-300">+ {decision.tool_name}+ </code>+ </p>+ )}+ {decision.tool_args && (+ <details className="mb-1">+ <summary className="cursor-pointer text-slate-400 hover:text-slate-200">+ Args ▸+ </summary>+ <pre className="mt-1 overflow-auto rounded bg-slate-800 p-1 text-slate-300">+ {JSON.stringify(decision.tool_args, null, 2)}+ </pre>+ </details>+ )}+ {decision.tool_result_summary && (+ <p className="text-slate-200">+ <span className="font-medium text-slate-400">Result: </span>+ {decision.tool_result_summary}+ </p>+ )}+ </div>+ );+}++// ---------------------------------------------------------------------------+// Single timeline node+// ---------------------------------------------------------------------------++interface NodeProps {+ node: TimelineNode;+ isFocused: boolean;+ isLast: boolean;+ onClick: () => void;+ onArtifactClick?: () => void;+ totalDurationMs: number;+ firstTs: number;+}++function TimelineNodeCard({+ node,+ isFocused,+ isLast,+ onClick,+ onArtifactClick,+ totalDurationMs,+ firstTs,+}: NodeProps) {+ const [showTooltip, setShowTooltip] = useState(false);+ const nodeTs = new Date(node.ts).getTime();+ const offsetPct =+ totalDurationMs > 0+ ? Math.min(((nodeTs - firstTs) / totalDurationMs) * 100, 100)+ : 0;++ return (+ <div+ className={`relative flex gap-3 rounded-lg px-3 py-2 transition-colors cursor-pointer+ ${isFocused ? "bg-slate-700/60 ring-1 ring-slate-500" : "hover:bg-slate-800/60"}`}+ onClick={onClick}+ >+ {/* vertical connector */}+ {!isLast && (+ <div className="absolute left-5 top-9 bottom-0 w-0.5 bg-slate-700" />+ )}++ {/* dot */}+ <div className="relative z-10 mt-1 flex h-4 w-4 flex-shrink-0 items-center justify-center">+ <button+ className={`h-3 w-3 rounded-full ring-2 ring-slate-900 ${kindColor(node.kind)} transition-transform ${isFocused ? "scale-150" : "hover:scale-125"}`}+ title={kindLabel(node.kind)}+ />+ </div>++ {/* content */}+ <div className="min-w-0 flex-1">+ <div className="flex items-baseline gap-2 flex-wrap">+ <span className="text-[10px] font-semibold uppercase tracking-wide text-slate-400">+ {kindLabel(node.kind)}+ </span>+ <span className="text-[10px] text-slate-500">+ {new Date(node.ts).toLocaleTimeString()}+ </span>+ <span className="text-[10px] text-slate-600">+ +{formatDuration(node.duration_ms)}+ </span>+ <span className="text-[10px] font-mono text-indigo-400">{node.agent}</span>++ {node.diff_vs_prev_attempt && (+ <span+ className="rounded bg-amber-900/60 px-1 text-[10px] text-amber-300"+ title={node.diff_vs_prev_attempt}+ >+ ↺ retry diff+ </span>+ )}++ {node.has_artifact && (+ <button+ className="text-[10px] text-slate-400 hover:text-white"+ title="Open transcript artifact"+ onClick={(e) => {+ e.stopPropagation();+ onArtifactClick?.();+ }}+ >+ 📎+ </button>+ )}+ </div>++ <p className="mt-0.5 text-sm text-slate-200 leading-snug line-clamp-2">+ {node.summary}+ </p>++ {/* scrubber position hint */}+ <div className="mt-1 text-[9px] text-slate-600">+ t+{offsetPct.toFixed(1)}%+ </div>++ {/* decision tooltip trigger */}+ {node.decision && (+ <div className="relative mt-1 inline-block">+ <button+ className="rounded bg-yellow-900/50 px-1.5 py-0.5 text-[10px] text-yellow-300 hover:bg-yellow-900"+ onMouseEnter={() => setShowTooltip(true)}+ onMouseLeave={() => setShowTooltip(false)}+ onClick={(e) => e.stopPropagation()}+ >+ ⚡ decision provenance+ </button>+ {showTooltip && <DecisionTooltip decision={node.decision} />}+ </div>+ )}+ </div>+ </div>+ );+}++// ---------------------------------------------------------------------------+// Scrubber bar+// ---------------------------------------------------------------------------++function ScrubberBar({+ nodes,+ focusedSeq,+ totalDurationMs,+ firstTs,+ onScrub,+}: {+ nodes: TimelineNode[];+ focusedSeq: number | null;+ totalDurationMs: number;+ firstTs: number;+ onScrub: (seq: number) => void;+}) {+ const barRef = useRef<HTMLDivElement>(null);++ const handleClick = useCallback(+ (e: React.MouseEvent<HTMLDivElement>) => {+ if (!barRef.current || nodes.length === 0 || totalDurationMs === 0) return;+ const rect = barRef.current.getBoundingClientRect();+ const pct = (e.clientX - rect.left) / rect.width;+ const targetMs = pct * totalDurationMs;+ // Find closest node by offset+ let closest = nodes[0];+ let minDist = Infinity;+ for (const n of nodes) {+ const dist = Math.abs(+ new Date(n.ts).getTime() - firstTs - targetMs,+ );+ if (dist < minDist) {+ minDist = dist;+ closest = n;+ }+ }+ onScrub(closest.seq);+ },+ [nodes, totalDurationMs, firstTs, onScrub],+ );++ return (+ <div className="mb-4 px-3">+ <div+ ref={barRef}+ className="relative h-3 cursor-crosshair rounded-full bg-slate-700"+ onClick={handleClick}+ title="Click to jump to a point in the timeline"+ >+ {nodes.map((n) => {+ const pct =+ totalDurationMs > 0+ ? Math.min(+ ((new Date(n.ts).getTime() - firstTs) / totalDurationMs) * 100,+ 100,+ )+ : 0;+ const isFocused = n.seq === focusedSeq;+ return (+ <div+ key={n.seq}+ className={`absolute top-1/2 -translate-y-1/2 -translate-x-1/2 rounded-full transition-all+ ${kindColor(n.kind)}+ ${isFocused ? "h-3 w-3 ring-2 ring-white" : "h-1.5 w-1.5"}`}+ style={{ left: `${pct}%` }}+ />+ );+ })}+ {/* playhead */}+ {focusedSeq !== null && (() => {+ const focused = nodes.find((n) => n.seq === focusedSeq);+ if (!focused) return null;+ const pct =+ totalDurationMs > 0+ ? Math.min(+ ((new Date(focused.ts).getTime() - firstTs) / totalDurationMs) * 100,+ 100,+ )+ : 0;+ return (+ <div+ className="absolute top-0 bottom-0 w-0.5 bg-white/80 pointer-events-none"+ style={{ left: `${pct}%` }}+ />+ );+ })()}+ </div>+ <div className="mt-1 flex justify-between text-[10px] text-slate-600">+ <span>0s</span>+ <span>{formatDuration(totalDurationMs)}</span>+ </div>+ </div>+ );+}++// ---------------------------------------------------------------------------+// Main component+// ---------------------------------------------------------------------------++/** Synthetic demo timeline shown when no runId is provided. */+function makeDemoTimeline(): TimelineResponse {+ const base = Date.now() - 45000;+ const makeTs = (offsetMs: number) =>+ new Date(base + offsetMs).toISOString();++ return {+ run_id: "demo-run",+ case_id: "CASE-001",+ status: "completed",+ total_duration_ms: 45000,+ attempt_count: 1,+ nodes: [+ {+ seq: 1,+ ts: makeTs(0),+ kind: "run_start",+ agent: "orchestrator",+ summary: "Investigation started for CASE-001",+ duration_ms: 12,+ decision: null,+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 2,+ ts: makeTs(800),+ kind: "agent_start",+ agent: "triage",+ summary: "Triage agent initialised; loading alert context",+ duration_ms: 200,+ decision: null,+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 3,+ ts: makeTs(2000),+ kind: "decision",+ agent: "triage",+ summary: "Classified as credential-stuffing attack; routing to Identity investigation",+ duration_ms: 850,+ decision: {+ reason:+ "Three failed MFA events from distinct ASNs in under 60 s — confidence below 0.6 triggers forensic escalation",+ confidence: 0.52,+ next_phase: "identity-forensics",+ tool_name: null,+ tool_args: null,+ tool_result_summary: null,+ },+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 4,+ ts: makeTs(5000),+ kind: "tool_call",+ agent: "identity",+ summary: "Querying Okta audit logs for user [email protected]",+ duration_ms: 1200,+ decision: {+ reason: "Target user identified from alert entity extraction",+ confidence: 0.88,+ next_phase: null,+ tool_name: "okta_get_user_events",+ tool_args: { user: "[email protected]", window_minutes: 60 },+ tool_result_summary: "12 events returned; 3 failed MFA, 1 successful login from US",+ },+ has_artifact: true,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 5,+ ts: makeTs(11000),+ kind: "tool_result",+ agent: "identity",+ summary: "Okta returned 12 events; anomalous login from 185.x.x.x flagged",+ duration_ms: 80,+ decision: null,+ has_artifact: true,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 6,+ ts: makeTs(14000),+ kind: "decision",+ agent: "identity",+ summary: "Confidence now 0.82 — escalating to automated containment",+ duration_ms: 310,+ decision: {+ reason: "Anomalous IP + impossible travel confirmed; confidence crossed 0.8 threshold",+ confidence: 0.82,+ next_phase: "containment",+ tool_name: null,+ tool_args: null,+ tool_result_summary: null,+ },+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 7,+ ts: makeTs(18000),+ kind: "tool_call",+ agent: "response",+ summary: "Suspending Okta session for [email protected]",+ duration_ms: 950,+ decision: {+ reason: "Playbook: suspend-and-notify on confirmed account compromise",+ confidence: 0.95,+ next_phase: null,+ tool_name: "okta_suspend_user_session",+ tool_args: { user: "[email protected]", notify_user: true },+ tool_result_summary: "Session suspended; email dispatched to [email protected]",+ },+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 8,+ ts: makeTs(25000),+ kind: "agent_output",+ agent: "response",+ summary: "Containment complete — session suspended, user notified, ticket created",+ duration_ms: 120,+ decision: null,+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ {+ seq: 9,+ ts: makeTs(45000),+ kind: "run_end",+ agent: "orchestrator",+ summary: "Investigation closed successfully in 45 s",+ duration_ms: 30,+ decision: null,+ has_artifact: false,+ diff_vs_prev_attempt: null,+ },+ ],+ };+}++export default function InvestigationTimeline({+ runId,+ apiBase = "/api/v1",+ onArtifactClick,+}: Props) {+ const [timeline, setTimeline] = useState<TimelineResponse | null>(null);+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [focusedSeq, setFocusedSeq] = useState<number | null>(null);+ const focusedRef = useRef<HTMLDivElement>(null);+ const pollRef = useRef<ReturnType<typeof setTimeout> | null>(null);++ const fetchTimeline = useCallback(async () => {+ if (!runId) return;+ try {+ const res = await fetch(`${apiBase}/investigations/${runId}/timeline`, {+ credentials: "include",+ });+ if (!res.ok) throw new Error(`HTTP ${res.status}`);+ const data: TimelineResponse = await res.json();+ setTimeline(data);+ setError(null);+ // Poll while run is still in progress+ if (data.status === "running") {+ pollRef.current = setTimeout(fetchTimeline, 3000);+ }+ } catch (e: unknown) {+ setError(e instanceof Error ? e.message : "Failed to load timeline");+ } finally {+ setLoading(false);+ }+ }, [runId, apiBase]);++ useEffect(() => {+ if (!runId) {+ setTimeline(makeDemoTimeline());+ return;+ }+ setLoading(true);+ setError(null);+ fetchTimeline();+ return () => {+ if (pollRef.current) clearTimeout(pollRef.current);+ };+ }, [runId, fetchTimeline]);++ // Scroll focused node into view+ useEffect(() => {+ if (focusedRef.current) {+ focusedRef.current.scrollIntoView({ behavior: "smooth", block: "nearest" });+ }+ }, [focusedSeq]);++ const data = timeline;+ const nodes = data?.nodes ?? [];+ const firstTs = nodes.length > 0 ? new Date(nodes[0].ts).getTime() : 0;++ if (loading) {+ return (+ <div className="flex h-48 items-center justify-center text-slate-400 text-sm">+ Loading timeline…+ </div>+ );+ }++ if (error) {+ return (+ <div className="rounded-lg border border-red-800 bg-red-950/30 p-4 text-sm text-red-300">+ {error}+ </div>+ );+ }++ if (!data) return null;++ return (+ <div className="flex flex-col gap-2 text-slate-100">+ {/* Header */}+ <div className="flex items-center justify-between px-3 pb-1">+ <div>+ <p className="text-sm font-semibold">+ {data.case_id}{" "}+ <span+ className={`ml-2 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase+ ${data.status === "completed" ? "bg-emerald-900/70 text-emerald-300" :+ data.status === "running" ? "bg-blue-900/70 text-blue-300 animate-pulse" :+ data.status === "failed" ? "bg-red-900/70 text-red-300" :+ "bg-slate-700 text-slate-300"}`}+ >+ {data.status}+ </span>+ </p>+ <p className="text-[11px] text-slate-400">+ {nodes.length} events · {formatDuration(data.total_duration_ms)} ·{" "}+ {data.attempt_count} attempt{data.attempt_count !== 1 ? "s" : ""}+ </p>+ </div>++ {focusedSeq !== null && (+ <button+ className="text-xs text-slate-400 hover:text-white"+ onClick={() => setFocusedSeq(null)}+ >+ ✕ clear focus+ </button>+ )}+ </div>++ {/* Scrubber */}+ {nodes.length > 1 && (+ <ScrubberBar+ nodes={nodes}+ focusedSeq={focusedSeq}+ totalDurationMs={data.total_duration_ms}+ firstTs={firstTs}+ onScrub={setFocusedSeq}+ />+ )}++ {/* Event list */}+ <div className="flex flex-col gap-0.5 overflow-y-auto max-h-[60vh] pr-1">+ {nodes.map((node, idx) => {+ const isFocused = node.seq === focusedSeq;+ return (+ <div key={node.seq} ref={isFocused ? (focusedRef as React.RefObject<HTMLDivElement>) : undefined}>+ <TimelineNodeCard+ node={node}+ isFocused={isFocused}+ isLast={idx === nodes.length - 1}+ totalDurationMs={data.total_duration_ms}+ firstTs={firstTs}+ onClick={() => setFocusedSeq(isFocused ? null : node.seq)}+ onArtifactClick={+ node.has_artifact && onArtifactClick+ ? () => onArtifactClick(data.run_id, node.seq)+ : undefined+ }+ />+ </div>+ );+ })}+ </div>++ {/* Legend */}+ <div className="flex flex-wrap gap-x-3 gap-y-1 border-t border-slate-800 px-3 pt-2 text-[10px] text-slate-500">+ {Object.entries(KIND_COLORS).map(([k, cls]) => (+ <span key={k} className="flex items-center gap-1">+ <span className={`inline-block h-2 w-2 rounded-full ${cls}`} />+ {kindLabel(k)}+ </span>+ ))}+ </div>+ </div>+ );+}diff --git a/apps/web/src/components/coverage/CoverageAdvisorView.tsx b/apps/web/src/components/coverage/CoverageAdvisorView.tsxindex 42908a30e..0ab33e68b 100644--- a/apps/web/src/components/coverage/CoverageAdvisorView.tsx+++ b/apps/web/src/components/coverage/CoverageAdvisorView.tsx@@ -3,6 +3,7 @@import { useState } from 'react';import { clsx } from 'clsx';import toast from 'react-hot-toast';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';type CoverageStatus = 'covered' | 'partial' | 'gap';type Priority = 'high' | 'medium' | 'low';@@ -48,6 +49,11 @@ const PRIORITY_STYLES: Record<Priority, { bg: string; text: string }> = {export default function CoverageAdvisorView() {const [techniques] = useState(TECHNIQUES);+ const [statusFilter, setStatusFilter] = useState<CoverageStatus | 'all'>('all');++ const filteredTechniques = statusFilter === 'all'+ ? techniques+ : techniques.filter((t) => t.status === statusFilter);const covered = techniques.filter((t) => t.status === 'covered').length;const partial = techniques.filter((t) => t.status === 'partial').length;@@ -82,8 +88,24 @@ export default function CoverageAdvisorView() {{/* Gap Analysis Table */}<div className="rounded-xl border border-gray-800/60 bg-gray-900/40 overflow-hidden">- <div className="px-5 py-4 border-b border-gray-800/60">- <h2 className="text-lg font-semibold text-white">Gap Analysis</h2>+ <div className="px-5 py-4 border-b border-gray-800/60 flex flex-wrap items-center gap-3">+ <h2 className="text-lg font-semibold text-white flex-1 min-w-0">Gap Analysis</h2>+ <div className="flex gap-2">+ {(['all', 'gap', 'partial', 'covered'] as const).map((f) => (+ <button+ key={f}+ onClick={() => setStatusFilter(f)}+ className={clsx(+ 'text-xs px-3 py-1 rounded-lg border transition-colors',+ statusFilter === f+ ? 'bg-blue-600/15 text-blue-300 border-blue-600/30'+ : 'text-gray-400 border-gray-800 hover:border-gray-700',+ )}+ >+ {f === 'all' ? 'All' : STATUS_STYLES[f as CoverageStatus].label}+ </button>+ ))}+ </div></div><div className="overflow-x-auto"><table className="w-full text-sm">@@ -99,38 +121,59 @@ export default function CoverageAdvisorView() {</tr></thead><tbody>- {techniques.map((t) => {- const st = STATUS_STYLES[t.status];- const pr = PRIORITY_STYLES[t.priority];- return (- <tr key={t.id} className="border-b border-gray-800/40 hover:bg-gray-800/30 transition-colors">- <td className="px-5 py-3 font-mono text-blue-400 text-xs">{t.id}</td>- <td className="px-5 py-3 text-white">{t.name}</td>- <td className="px-5 py-3 text-gray-300">{t.tactic}</td>- <td className="px-5 py-3 text-center">- <span className={clsx('inline-block px-2.5 py-0.5 rounded-full text-xs font-medium', st.bg, st.text)}>- {st.label}- </span>- </td>- <td className="px-5 py-3 text-center">- <span className={clsx('inline-block px-2.5 py-0.5 rounded-full text-xs font-medium capitalize', pr.bg, pr.text)}>- {t.priority}- </span>- </td>- <td className="px-5 py-3 text-gray-400 max-w-xs truncate">{t.recommendation}</td>- <td className="px-5 py-3 text-center">- {t.status !== 'covered' && (+ {filteredTechniques.length === 0 ? (+ <tr>+ <td colSpan={7} className="py-0">+ <EmptyState+ icon={<EmptyStateIcons.Shield />}+ title="No techniques match this filter"+ description="Try selecting a different coverage status or view all techniques."+ action={<button- onClick={() => toast.success(`Detection rule draft created for ${t.id}`)}- className="text-xs px-2.5 py-1 rounded-lg bg-blue-600 hover:bg-blue-500 text-white transition-colors whitespace-nowrap"+ type="button"+ onClick={() => setStatusFilter('all')}+ className="rounded-lg bg-gray-800 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 transition-colors">- Generate Detection+ Show all techniques</button>- )}- </td>- </tr>- );- })}+ }+ />+ </td>+ </tr>+ ) : (+ filteredTechniques.map((t) => {+ const st = STATUS_STYLES[t.status];+ const pr = PRIORITY_STYLES[t.priority];+ return (+ <tr key={t.id} className="border-b border-gray-800/40 hover:bg-gray-800/30 transition-colors">+ <td className="px-5 py-3 font-mono text-blue-400 text-xs">{t.id}</td>+ <td className="px-5 py-3 text-white">{t.name}</td>+ <td className="px-5 py-3 text-gray-300">{t.tactic}</td>+ <td className="px-5 py-3 text-center">+ <span className={clsx('inline-block px-2.5 py-0.5 rounded-full text-xs font-medium', st.bg, st.text)}>+ {st.label}+ </span>+ </td>+ <td className="px-5 py-3 text-center">+ <span className={clsx('inline-block px-2.5 py-0.5 rounded-full text-xs font-medium capitalize', pr.bg, pr.text)}>+ {t.priority}+ </span>+ </td>+ <td className="px-5 py-3 text-gray-400 max-w-xs truncate">{t.recommendation}</td>+ <td className="px-5 py-3 text-center">+ {t.status !== 'covered' && (+ <button+ onClick={() => toast.success(`Detection rule draft created for ${t.id}`)}+ className="text-xs px-2.5 py-1 rounded-lg bg-blue-600 hover:bg-blue-500 text-white transition-colors whitespace-nowrap"+ >+ Generate Detection+ </button>+ )}+ </td>+ </tr>+ );+ })+ )}</tbody></table></div>diff --git a/apps/web/src/components/dashboard/DashboardView.tsx b/apps/web/src/components/dashboard/DashboardView.tsxindex a53355cc2..20aa4dec9 100644--- a/apps/web/src/components/dashboard/DashboardView.tsx+++ b/apps/web/src/components/dashboard/DashboardView.tsx@@ -1,6 +1,20 @@'use client';-import React, { Component, type ErrorInfo, type ReactNode } from 'react';+/**+ * DashboardView+ * =============+ * Main SOC dashboard with live metrics, charts, and source activity.+ *+ * WS-F3: Drag-and-drop widget reordering.+ * Each major section (DashboardWelcome, Top Metrics, Charts row, Bottom row,+ * SOC Performance) is a draggable "widget". The user can grab the ⠿ handle in+ * the widget's header and drop it anywhere in the layout. Order is persisted to+ * localStorage so it survives page refreshes.+ *+ * Author: Beenu <[email protected]>+ */++import React, { Component, type ErrorInfo, type ReactNode, useState, useEffect, useRef, useCallback } from 'react';import useSWR from 'swr';import { metricsApi, type DashboardMetrics } from '@/lib/api';import { clsx } from 'clsx';@@ -204,6 +218,151 @@ function CustomTooltip({ active, payload, label }: any) {);}+// ─── Drag-and-Drop Widget Layout (WS-F3) ──────────────────────────────────────++const WIDGET_ORDER_KEY = 'aisoc:dashboard:widget-order';++type WidgetId =+ | 'welcome'+ | 'top-metrics'+ | 'charts-row'+ | 'bottom-row'+ | 'soc-performance';++const DEFAULT_WIDGET_ORDER: WidgetId[] = [+ 'welcome',+ 'top-metrics',+ 'charts-row',+ 'bottom-row',+ 'soc-performance',+];++function loadWidgetOrder(): WidgetId[] {+ if (typeof window === 'undefined') return DEFAULT_WIDGET_ORDER;+ try {+ const raw = localStorage.getItem(WIDGET_ORDER_KEY);+ if (!raw) return DEFAULT_WIDGET_ORDER;+ const parsed = JSON.parse(raw) as WidgetId[];+ // Guard against stale storage with missing or extra IDs+ if (+ Array.isArray(parsed) &&+ parsed.length === DEFAULT_WIDGET_ORDER.length &&+ DEFAULT_WIDGET_ORDER.every((id) => parsed.includes(id))+ ) {+ return parsed;+ }+ } catch {}+ return DEFAULT_WIDGET_ORDER;+}++/** Drag state kept in a ref so re-renders stay minimal during the drag gesture. */+interface DragState {+ dragId: WidgetId | null;+ overId: WidgetId | null;+}++interface DraggableWidgetProps {+ id: WidgetId;+ dragState: DragState;+ onDragStart: (id: WidgetId) => void;+ onDragOver: (id: WidgetId) => void;+ onDrop: () => void;+ children: ReactNode;+}++/**+ * Thin drag-and-drop shell around each dashboard section.+ * The ⠿ handle (aria-label "Drag to reorder") is the only interactive target;+ * clicking anywhere else in the widget works normally.+ */+function DraggableWidget({ id, dragState, onDragStart, onDragOver, onDrop, children }: DraggableWidgetProps) {+ const isDragging = dragState.dragId === id;+ const isOver = dragState.overId === id && dragState.dragId !== id;++ return (+ <div+ draggable+ onDragStart={() => onDragStart(id)}+ onDragOver={(e) => { e.preventDefault(); onDragOver(id); }}+ onDrop={(e) => { e.preventDefault(); onDrop(); }}+ onDragEnd={onDrop}+ className={clsx(+ 'relative group transition-opacity',+ isDragging && 'opacity-40',+ isOver && 'ring-2 ring-blue-500/60 ring-offset-2 ring-offset-gray-950 rounded-xl',+ )}+ aria-label={`Dashboard widget: ${id}`}+ >+ {/* Drag handle — visible on hover */}+ <button+ aria-label="Drag to reorder"+ title="Drag to reorder"+ className={clsx(+ 'absolute top-2 right-2 z-10 cursor-grab active:cursor-grabbing',+ 'px-1.5 py-0.5 rounded text-gray-600 hover:text-gray-400',+ 'opacity-0 group-hover:opacity-100 transition-opacity',+ 'select-none text-base leading-none',+ )}+ // Pointer-down on the handle initiates the native drag+ onPointerDown={(e) => {+ // We rely on the parent div's draggable; just prevent focus loss+ e.currentTarget.closest('[draggable]')?.dispatchEvent(+ new DragEvent('dragstart', { bubbles: true })+ );+ }}+ tabIndex={-1}+ >+ ⠿+ </button>+ {children}+ </div>+ );+}++/** Persist + manage the ordered list of widget IDs. */+function useDashboardLayout() {+ const [order, setOrder] = useState<WidgetId[]>(DEFAULT_WIDGET_ORDER);+ const dragState = useRef<DragState>({ dragId: null, overId: null });+ // Trigger a render when drag state changes so highlights update+ const [, forceRender] = useState(0);++ // Hydrate from localStorage on mount (client-only)+ useEffect(() => { setOrder(loadWidgetOrder()); }, []);++ const handleDragStart = useCallback((id: WidgetId) => {+ dragState.current = { dragId: id, overId: null };+ forceRender((n) => n + 1);+ }, []);++ const handleDragOver = useCallback((id: WidgetId) => {+ if (dragState.current.overId !== id) {+ dragState.current = { ...dragState.current, overId: id };+ forceRender((n) => n + 1);+ }+ }, []);++ const handleDrop = useCallback(() => {+ const { dragId, overId } = dragState.current;+ dragState.current = { dragId: null, overId: null };+ forceRender((n) => n + 1);++ if (!dragId || !overId || dragId === overId) return;++ setOrder((prev) => {+ const next = [...prev];+ const from = next.indexOf(dragId);+ const to = next.indexOf(overId);+ if (from === -1 || to === -1) return prev;+ next.splice(from, 1);+ next.splice(to, 0, dragId);+ try { localStorage.setItem(WIDGET_ORDER_KEY, JSON.stringify(next)); } catch {}+ return next;+ });+ }, []);++ return { order, dragState: dragState.current, handleDragStart, handleDragOver, handleDrop };+}+// ─── Main Dashboard ───────────────────────────────────────────────────────────export function DashboardView() {@@ -234,12 +393,17 @@ export function DashboardView() {{ name: 'Low', value: metrics.alerts.low, color: '#3b82f6' },];- return (- <DashboardErrorBoundary>- <div className="space-y-5">- <DashboardWelcome />- {/* Header */}- <div className="flex items-center justify-between">+ // WS-F3: drag-and-drop widget reordering+ const { order, dragState, handleDragStart, handleDragOver, handleDrop } = useDashboardLayout();++ /** Map each widget ID to its rendered section. */+ const widgetContent: Record<WidgetId, ReactNode> = {+ welcome: <DashboardWelcome />,++ 'top-metrics': (+ <div>+ {/* Section header */}+ <div className="flex items-center justify-between mb-4"><div><h1 className="text-xl font-semibold text-gray-100">Security Operations Center</h1><p className="text-sm text-gray-500 mt-0.5">@@ -247,8 +411,6 @@ export function DashboardView() {</p></div></div>-- {/* Top Metrics */}<div className="grid grid-cols-2 sm:grid-cols-5 gap-4"><MetricCardlabel="Active Alerts"@@ -284,83 +446,102 @@ export function DashboardView() {color="purple"/></div>+ </div>+ ),- {/* Charts row */}- <div className="grid grid-cols-3 gap-4">- <div className="col-span-2 bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">- <div className="flex items-center justify-between mb-4">- <h3 className="text-sm font-medium text-gray-300">Alert Volume (24h)</h3>- <span className="text-xs text-gray-500">Last 24 hours</span>- </div>- <RechartsArea data={trendData} />+ 'charts-row': (+ <div className="grid grid-cols-3 gap-4">+ <div className="col-span-2 bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">+ <div className="flex items-center justify-between mb-4">+ <h3 className="text-sm font-medium text-gray-300">Alert Volume (24h)</h3>+ <span className="text-xs text-gray-500">Last 24 hours</span></div>-- <div className="bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">- <h3 className="text-sm font-medium text-gray-300 mb-4">Severity Breakdown</h3>- <RechartsPie data={SEVERITY_CHART_DATA} />- <div className="space-y-1.5 mt-2">- {SEVERITY_CHART_DATA.map((d) => (- <div key={d.name} className="flex items-center justify-between text-xs">- <div className="flex items-center gap-1.5">- <span className="w-2 h-2 rounded-full" style={{ background: d.color }} />- <span className="text-gray-400">{d.name}</span>- </div>- <span className="text-gray-300 font-medium">{d.value}</span>+ <RechartsArea data={trendData} />+ </div>+ <div className="bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">+ <h3 className="text-sm font-medium text-gray-300 mb-4">Severity Breakdown</h3>+ <RechartsPie data={SEVERITY_CHART_DATA} />+ <div className="space-y-1.5 mt-2">+ {SEVERITY_CHART_DATA.map((d) => (+ <div key={d.name} className="flex items-center justify-between text-xs">+ <div className="flex items-center gap-1.5">+ <span className="w-2 h-2 rounded-full" style={{ background: d.color }} />+ <span className="text-gray-400">{d.name}</span></div>- ))}- </div>+ <span className="text-gray-300 font-medium">{d.value}</span>+ </div>+ ))}</div></div>+ </div>+ ),- {/* Bottom row */}- <div className="grid grid-cols-3 gap-4">- <div className="bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">- <h3 className="text-sm font-medium text-gray-300 mb-4">Top MITRE ATT&CK Tactics</h3>- <RechartsBar data={metrics.topMitre} />- </div>-- <div className="bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">- <h3 className="text-sm font-medium text-gray-300 mb-4">Connected Sources</h3>- <div className="space-y-3">- {metrics.sources.map((src) => {- const maxCount = Math.max(...metrics.sources.map(s => s.count));- const pct = Math.round((src.count / maxCount) * 100);- return (- <div key={src.name}>- <div className="flex items-center justify-between mb-1">- <div className="flex items-center gap-2">- <span className={clsx(- 'w-1.5 h-1.5 rounded-full',- src.status === 'active' ? 'bg-green-500' : 'bg-gray-500'- )} />- <span className="text-xs text-gray-300">{src.name}</span>- </div>- <span className="text-xs text-gray-500">{src.count}</span>- </div>- <div className="h-1 bg-gray-800 rounded-full">- <div className="h-1 bg-blue-500/60 rounded-full" style={{ width: `${pct}%` }} />+ 'bottom-row': (+ <div className="grid grid-cols-3 gap-4">+ <div className="bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">+ <h3 className="text-sm font-medium text-gray-300 mb-4">Top MITRE ATT&CK Tactics</h3>+ <RechartsBar data={metrics.topMitre} />+ </div>+ <div className="bg-gray-900/60 border border-gray-800/60 rounded-xl p-5">+ <h3 className="text-sm font-medium text-gray-300 mb-4">Connected Sources</h3>+ <div className="space-y-3">+ {metrics.sources.map((src) => {+ const maxCount = Math.max(...metrics.sources.map(s => s.count));+ const pct = Math.round((src.count / maxCount) * 100);+ return (+ <div key={src.name}>+ <div className="flex items-center justify-between mb-1">+ <div className="flex items-center gap-2">+ <span className={clsx(+ 'w-1.5 h-1.5 rounded-full',+ src.status === 'active' ? 'bg-green-500' : 'bg-gray-500'+ )} />+ <span className="text-xs text-gray-300">{src.name}</span></div>+ <span className="text-xs text-gray-500">{src.count}</span>+ </div>+ <div className="h-1 bg-gray-800 rounded-full">+ <div className="h-1 bg-blue-500/60 rounded-full" style={{ width: `${pct}%` }} /></div>- );- })}- </div>+ </div>+ );+ })}</div>-- <LiveFeedPanel /></div>+ <LiveFeedPanel />+ </div>+ ),- {/* SOC Performance */}- <div className="pt-2">- <div className="flex items-center justify-between mb-3">- <div>- <h2 className="text-base font-semibold text-gray-100">SOC Performance</h2>- <p className="text-xs text-gray-500 mt-0.5">- Outcome metrics, agent calibration, and technique coverage. Auto-computed every 30s.- </p>- </div>+ 'soc-performance': (+ <div className="pt-2">+ <div className="flex items-center justify-between mb-3">+ <div>+ <h2 className="text-base font-semibold text-gray-100">SOC Performance</h2>+ <p className="text-xs text-gray-500 mt-0.5">+ Outcome metrics, agent calibration, and technique coverage. Auto-computed every 30s.+ </p></div>- <SOCMetricsDashboard /></div>+ <SOCMetricsDashboard />+ </div>+ ),+ };++ return (+ <DashboardErrorBoundary>+ <div className="space-y-5">+ {order.map((id) => (+ <DraggableWidget+ key={id}+ id={id}+ dragState={dragState}+ onDragStart={handleDragStart}+ onDragOver={handleDragOver}+ onDrop={handleDrop}+ >+ {widgetContent[id]}+ </DraggableWidget>+ ))}</div></DashboardErrorBoundary>);diff --git a/apps/web/src/components/detections/DetectionProposalsView.tsx b/apps/web/src/components/detections/DetectionProposalsView.tsxindex a83ed9e94..ba8a7030a 100644--- a/apps/web/src/components/detections/DetectionProposalsView.tsx+++ b/apps/web/src/components/detections/DetectionProposalsView.tsx@@ -71,8 +71,27 @@ export function DetectionProposalsView() {const promote = async (p: DetectionProposal) => {try {- await detectionProposalsApi.promote(p.id);- toast.success('Promoted to active rule');+ const result = await detectionProposalsApi.promote(p.id);+ // WS-B4: git PR path — Author: Beenu - [email protected]+ // If a GitHub PR was created, surface the URL in the success toast so+ // the operator can jump directly to the PR without hunting for it.+ if (result?.github_pr_url) {+ toast.success(+ <span>+ Promoted to active rule —{' '}+ <a+ href={result.github_pr_url}+ target="_blank"+ rel="noopener noreferrer"+ className="underline"+ >+ Open PR+ </a>+ </span>,+ );+ } else {+ toast.success('Promoted to active rule');+ }mutate();} catch (err) {console.warn('Promote failed', err);@@ -254,6 +273,28 @@ export function DetectionProposalsView() {Promote → Active</button>)}+ {/* WS-B4: git PR path — Author: Beenu - [email protected]+ For already-promoted proposals that have an associated GitHub PR,+ surface a direct link in the card footer so operators don't need+ to re-trigger promotion to find the PR. */}+ {p.github_pr_url && (+ <a+ href={p.github_pr_url}+ target="_blank"+ rel="noopener noreferrer"+ className="inline-flex items-center gap-1 rounded-md bg-sky-500/10 px-3 py-1.5 text-xs font-medium text-sky-300 hover:bg-sky-500/20"+ >+ <svg+ className="h-3.5 w-3.5"+ viewBox="0 0 16 16"+ fill="currentColor"+ aria-hidden="true"+ >+ <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" />+ </svg>+ View PR+ </a>+ )}</div></div></li>diff --git a/apps/web/src/components/detections/DetectionsView.tsx b/apps/web/src/components/detections/DetectionsView.tsxindex 4536deab1..b0af39d2d 100644--- a/apps/web/src/components/detections/DetectionsView.tsx+++ b/apps/web/src/components/detections/DetectionsView.tsx@@ -533,7 +533,7 @@ export function DetectionsView() {title="No detection rules yet"description="Author your first detection in Sigma, KQL, or EQL — or import the AiSOC starter pack to bootstrap coverage across the MITRE ATT&CK matrix."action={- <div className="flex gap-2">+ <div className="flex flex-wrap items-center gap-2"><Linkhref="/detection/new"className="rounded-md bg-blue-500 px-4 py-2 text-sm font-medium text-white hover:bg-blue-600"@@ -542,13 +542,15 @@ export function DetectionsView() {</Link><buttontype="button"- onClick={() =>- toast('Starter pack import is coming soon')- }- className="rounded-md border border-gray-700 px-4 py-2 text-sm text-gray-300 hover:bg-gray-800"+ disabled+ title="Starter pack import is planned for v1.1"+ className="rounded-md border border-gray-700 px-4 py-2 text-sm text-gray-500 cursor-not-allowed select-none">Import starter pack</button>+ <span className="text-xs font-medium rounded-full bg-amber-500/15 text-amber-400 border border-amber-500/30 px-2 py-0.5">+ Planned for v1.1+ </span></div>}/>diff --git a/apps/web/src/components/detections/RuleEditor.tsx b/apps/web/src/components/detections/RuleEditor.tsxindex 7f19a1608..fc2ce92be 100644--- a/apps/web/src/components/detections/RuleEditor.tsx+++ b/apps/web/src/components/detections/RuleEditor.tsx@@ -152,6 +152,8 @@ export function RuleEditor({ mode, ruleId }: RuleEditorProps) {maxRegressionPp?: number;durationSeconds?: number;ranAt?: string;+ /** WS-B4: GitHub PR URL created when the proposal is promoted (may be absent). */+ githubPrUrl?: string;} | null>(null);// Hydrate form when data arrives@@ -572,6 +574,22 @@ export function RuleEditor({ mode, ruleId }: RuleEditorProps) {)}</div>)}+ {/* WS-B4: git PR path — Author: Beenu - [email protected]+ When promotion creates a GitHub PR, surface the direct link here+ so the analyst can jump to the PR without leaving the editor. */}+ {evalVerdict.githubPrUrl && (+ <div className="mt-2 flex items-center gap-1.5 text-xs">+ <span className="text-gray-400">GitHub PR</span>+ <a+ href={evalVerdict.githubPrUrl}+ target="_blank"+ rel="noopener noreferrer"+ className="font-mono text-sky-400 underline-offset-2 hover:underline"+ >+ {evalVerdict.githubPrUrl.replace('https://github.com/', 'github.com/')}+ </a>+ </div>+ )}</div>)}diff --git a/apps/web/src/components/easm/EASMView.tsx b/apps/web/src/components/easm/EASMView.tsxindex a614802c5..f3cdba4cf 100644--- a/apps/web/src/components/easm/EASMView.tsx+++ b/apps/web/src/components/easm/EASMView.tsx@@ -2,6 +2,7 @@import { useState } from 'react';import { clsx } from 'clsx';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';type RiskLevel = 'critical' | 'high' | 'medium' | 'low' | 'info';type AssetType = 'domain' | 'ip' | 'cert' | 'subdomain' | 'service';@@ -147,25 +148,46 @@ export function EASMView() {</tr></thead><tbody>- {filteredAssets.map((asset) => (- <tr key={asset.id} className="border-b border-gray-800/30 hover:bg-gray-800/30 transition-colors">- <td className="px-5 py-3">- <span className="text-gray-200 font-mono text-xs">{asset.asset}</span>- </td>- <td className="px-5 py-3 text-gray-400 text-xs">{TYPE_LABELS[asset.type]}</td>- <td className="px-5 py-3">- <span className={clsx('text-xs font-medium px-2 py-0.5 rounded border', STATUS_COLOR[asset.status])}>- {asset.status.charAt(0).toUpperCase() + asset.status.slice(1)}- </span>+ {filteredAssets.length === 0 ? (+ <tr>+ <td colSpan={5} className="py-0">+ <EmptyState+ icon={<EmptyStateIcons.Shield />}+ title="No assets match this filter"+ description="Try selecting a different status filter or view all assets."+ action={+ <button+ type="button"+ onClick={() => setAssetFilter('all')}+ className="rounded-lg bg-gray-800 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 transition-colors"+ >+ Show all assets+ </button>+ }+ /></td>- <td className="px-5 py-3">- <span className={clsx('text-xs font-medium px-2 py-0.5 rounded border', RISK_CONFIG[asset.risk].className)}>- {RISK_CONFIG[asset.risk].label}- </span>- </td>- <td className="px-5 py-3 text-xs text-gray-500">{asset.lastSeen}</td></tr>- ))}+ ) : (+ filteredAssets.map((asset) => (+ <tr key={asset.id} className="border-b border-gray-800/30 hover:bg-gray-800/30 transition-colors">+ <td className="px-5 py-3">+ <span className="text-gray-200 font-mono text-xs">{asset.asset}</span>+ </td>+ <td className="px-5 py-3 text-gray-400 text-xs">{TYPE_LABELS[asset.type]}</td>+ <td className="px-5 py-3">+ <span className={clsx('text-xs font-medium px-2 py-0.5 rounded border', STATUS_COLOR[asset.status])}>+ {asset.status.charAt(0).toUpperCase() + asset.status.slice(1)}+ </span>+ </td>+ <td className="px-5 py-3">+ <span className={clsx('text-xs font-medium px-2 py-0.5 rounded border', RISK_CONFIG[asset.risk].className)}>+ {RISK_CONFIG[asset.risk].label}+ </span>+ </td>+ <td className="px-5 py-3 text-xs text-gray-500">{asset.lastSeen}</td>+ </tr>+ ))+ )}</tbody></table></div>diff --git a/apps/web/src/components/layout/Sidebar.tsx b/apps/web/src/components/layout/Sidebar.tsxindex 6a28cbe6b..7654c9fb2 100644--- a/apps/web/src/components/layout/Sidebar.tsx+++ b/apps/web/src/components/layout/Sidebar.tsx@@ -22,63 +22,63 @@ interface NavSection {}const ShieldIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z" /></svg>);const BellIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" /></svg>);const FolderIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" /></svg>);const EyeIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z" /><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>);const PuzzleIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 01-.657.643 48.39 48.39 0 01-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 01-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 00-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 01-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 00.657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 01-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 005.427-.63 48.05 48.05 0 00.582-4.717.532.532 0 00-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.959.401v0a.656.656 0 00.658-.663 48.422 48.422 0 00-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 01-.61-.58v0z" /></svg>);const GlobeIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" /></svg>);const CogIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z" /><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>);const ChartBarIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z" /></svg>);const SearchIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z" /></svg>);const GraphIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><circle cx="6" cy="6" r="2" strokeWidth={1.5} /><circle cx="18" cy="6" r="2" strokeWidth={1.5} /><circle cx="12" cy="18" r="2" strokeWidth={1.5} />@@ -87,43 +87,43 @@ const GraphIcon = () => ();const PlaybookIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z" /></svg>);const SparklesIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.847.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z" /></svg>);const ClockIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>);const ScanIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M7.5 3.75H6A2.25 2.25 0 003.75 6v1.5M16.5 3.75H18A2.25 2.25 0 0120.25 6v1.5m0 9V18A2.25 2.25 0 0118 20.25h-1.5m-9 0H6A2.25 2.25 0 013.75 18v-1.5M15 12a3 3 0 11-6 0 3 3 0 016 0z" /></svg>);const MarketplaceIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M13.5 21v-7.5a.75.75 0 01.75-.75h3a.75.75 0 01.75.75V21m-4.5 0H2.36m11.14 0H18m0 0h3.64m-1.39 0V9.349m-16.5 11.65V9.35m0 0a3.001 3.001 0 003.75-.615A2.993 2.993 0 009.75 9.75c.896 0 1.7-.393 2.25-1.016a2.993 2.993 0 002.25 1.016c.896 0 1.7-.393 2.25-1.016a3.001 3.001 0 003.75.614m-16.5 0a3.004 3.004 0 01-.621-4.72L4.318 3.44A1.5 1.5 0 015.378 3h13.243a1.5 1.5 0 011.06.44l1.19 1.189a3 3 0 01-.621 4.72m-13.5 8.65h3.75a.75.75 0 00.75-.75V13.5a.75.75 0 00-.75-.75H6.75a.75.75 0 00-.75.75v3.75c0 .415.336.75.75.75z" /></svg>);const DocumentReportIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M9 17.25v-3.75M12 17.25V9.75M15 17.25v-1.5M19.5 19.5h-15A2.25 2.25 0 012.25 17.25V6.75A2.25 2.25 0 014.5 4.5h15a2.25 2.25 0 012.25 2.25v10.5a2.25 2.25 0 01-2.25 2.25z" /></svg>);const CurrencyIcon = () => (- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>);@@ -325,7 +325,7 @@ export function Sidebar() {onClick={() => setMobileOpen(true)}className="md:hidden fixed top-4 left-4 z-40 p-2 rounded-lg bg-surface-card/90 text-fg-secondary hover:text-fg-primary">- <svg className="w-5 h-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <svg className="w-5 h-5" aria-hidden="true" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M4 6h16M4 12h16M4 18h16" /></svg></button>@@ -338,10 +338,13 @@ export function Sidebar() {/>)}- <aside className={clsx(- 'fixed inset-y-0 left-0 w-60 flex flex-col bg-surface-raised/95 border-r border-surface-border z-40 transition-transform duration-200',- mobileOpen ? 'translate-x-0' : '-translate-x-full md:translate-x-0'- )}>+ <aside+ aria-label="Application sidebar"+ className={clsx(+ 'fixed inset-y-0 left-0 w-60 flex flex-col bg-surface-raised/95 border-r border-surface-border z-40 transition-transform duration-200',+ mobileOpen ? 'translate-x-0' : '-translate-x-full md:translate-x-0'+ )}+ >{/* Logo */}<div className="flex items-center gap-3 px-5 h-16 border-b border-surface-border"><div className="flex-shrink-0 w-8 h-8 rounded-lg bg-brand-600/20 border border-brand-600/30 flex items-center justify-center">@@ -354,15 +357,15 @@ export function Sidebar() {<span className="text-brand-400 font-bold text-base tracking-tight">SOC</span><p className="text-xs text-fg-subtle -mt-0.5">open-source</p></div>- {/* Live indicator */}- <div className="ml-auto flex items-center gap-1">- <div className="w-1.5 h-1.5 rounded-full bg-green-400 pulse-dot" />- <span className="text-xs text-fg-subtle">Live</span>- </div>+ {/* Live indicator — decorative, status conveyed by the green dot label */}+ <div className="ml-auto flex items-center gap-1" aria-hidden="true">+ <div className="w-1.5 h-1.5 rounded-full bg-green-400 pulse-dot" />+ <span className="text-xs text-fg-subtle">Live</span>+ </div></div>{/* Nav */}- <nav className="flex-1 overflow-y-auto py-4 px-3 space-y-5">+ <nav aria-label="Main navigation" className="flex-1 overflow-y-auto py-4 px-3 space-y-5">{navSections.map((section, si) => (<div key={si}>{section.title && (diff --git a/apps/web/src/components/mssp/MSSPDashboardView.tsx b/apps/web/src/components/mssp/MSSPDashboardView.tsxindex cbab4381a..9f2e0c0c5 100644--- a/apps/web/src/components/mssp/MSSPDashboardView.tsx+++ b/apps/web/src/components/mssp/MSSPDashboardView.tsx@@ -3,6 +3,7 @@import { useState } from 'react';import { clsx } from 'clsx';import toast from 'react-hot-toast';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';interface Tenant {name: string;@@ -50,10 +51,15 @@ function kpiCards(tenants: Tenant[]) {];}+type SLAFilter = 'all' | 'compliant' | 'warning' | 'breach';+export default function MSSPDashboardView() {const [tenants] = useState(TENANTS);+ const [slaFilter, setSlaFilter] = useState<SLAFilter>('all');const cards = kpiCards(tenants);+ const filteredTenants = slaFilter === 'all' ? tenants : tenants.filter((t) => t.slaStatus === slaFilter);+return (<div className="space-y-8 p-6 max-w-7xl mx-auto"><div>@@ -73,15 +79,46 @@ export default function MSSPDashboardView() {{/* Tenant Table */}<div className="rounded-xl border border-gray-800/60 bg-gray-900/40 overflow-hidden">- <div className="px-5 py-4 border-b border-gray-800/60 flex items-center justify-between">+ <div className="px-5 py-4 border-b border-gray-800/60 flex flex-wrap items-center justify-between gap-3"><h2 className="text-lg font-semibold text-white">Tenant Overview</h2>- <button- onClick={() => toast.success('Report exported for all tenants')}- className="text-sm px-3 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-500 text-white transition-colors"- >- Export Report- </button>+ <div className="flex items-center gap-3">+ <span className="text-xs font-medium uppercase tracking-wider text-gray-500">SLA</span>+ {(['all', 'compliant', 'warning', 'breach'] as SLAFilter[]).map((f) => (+ <button+ key={f}+ onClick={() => setSlaFilter(f)}+ className={clsx(+ 'rounded-md px-2.5 py-1 text-xs font-medium capitalize transition',+ slaFilter === f ? 'bg-white/10 text-white' : 'text-gray-500 hover:text-gray-300',+ )}+ >+ {f}+ </button>+ ))}+ <button+ onClick={() => toast.success('Report exported for all tenants')}+ className="text-sm px-3 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-500 text-white transition-colors"+ >+ Export Report+ </button>+ </div></div>+ {filteredTenants.length === 0 ? (+ <EmptyState+ icon={<EmptyStateIcons.Shield />}+ title="No tenants match this SLA filter"+ description="Try a different status filter to view tenants."+ action={+ <button+ type="button"+ onClick={() => setSlaFilter('all')}+ className="rounded-lg bg-gray-800 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 transition-colors"+ >+ Show all tenants+ </button>+ }+ />+ ) : (<div className="overflow-x-auto"><table className="w-full text-sm"><thead>@@ -98,7 +135,7 @@ export default function MSSPDashboardView() {</tr></thead><tbody>- {tenants.map((t) => {+ {filteredTenants.map((t) => {const sla = SLA_STYLES[t.slaStatus];return (<tr key={t.name} className="border-b border-gray-800/40 hover:bg-gray-800/30 transition-colors">@@ -123,6 +160,7 @@ export default function MSSPDashboardView() {</tbody></table></div>+ )}</div></div>);diff --git a/apps/web/src/components/noise/NoiseTuningView.tsx b/apps/web/src/components/noise/NoiseTuningView.tsxindex cbbc31df3..44609c477 100644--- a/apps/web/src/components/noise/NoiseTuningView.tsx+++ b/apps/web/src/components/noise/NoiseTuningView.tsx@@ -3,6 +3,7 @@import { useState } from 'react';import { clsx } from 'clsx';import toast from 'react-hot-toast';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';interface AlertRule {name: string;@@ -28,6 +29,11 @@ const INITIAL_RULES: AlertRule[] = [export default function NoiseTuningView() {const [rules, setRules] = useState(INITIAL_RULES);+ const [search, setSearch] = useState('');++ const filteredRules = search.trim()+ ? rules.filter((r) => r.name.toLowerCase().includes(search.toLowerCase()))+ : rules;const totalVerdicts = rules.reduce((s, r) => s + r.alertsFired, 0);const totalFP = rules.reduce((s, r) => s + r.fpCount, 0);@@ -90,8 +96,15 @@ export default function NoiseTuningView() {{/* Rules Table */}<div className="rounded-xl border border-gray-800/60 bg-gray-900/40 overflow-hidden">- <div className="px-5 py-4 border-b border-gray-800/60 flex items-center justify-between">- <h2 className="text-lg font-semibold text-white">Alert Rules</h2>+ <div className="px-5 py-4 border-b border-gray-800/60 flex flex-wrap items-center gap-3">+ <h2 className="text-lg font-semibold text-white flex-1 min-w-0">Alert Rules</h2>+ <input+ type="search"+ value={search}+ onChange={(e) => setSearch(e.target.value)}+ placeholder="Search rules…"+ className="w-56 rounded-lg border border-gray-700 bg-gray-800/60 px-3 py-1.5 text-sm text-gray-200 placeholder-gray-500 focus:border-blue-500 focus:outline-none"+ /><buttononClick={() => toast.success('Tuning recommendations applied to 3 rules')}className="text-sm px-3 py-1.5 rounded-lg bg-blue-600 hover:bg-blue-500 text-white transition-colors"@@ -113,42 +126,64 @@ export default function NoiseTuningView() {</tr></thead><tbody>- {rules.map((r, i) => {- const fp = ruleFpRate(r);- return (- <tr key={r.name} className="border-b border-gray-800/40 hover:bg-gray-800/30 transition-colors">- <td className="px-5 py-3 font-medium text-white">{r.name}</td>- <td className="px-5 py-3 text-right text-gray-300">{r.alertsFired.toLocaleString()}</td>- <td className="px-5 py-3 text-right text-gray-300">{r.tpCount}</td>- <td className="px-5 py-3 text-right text-gray-300">{r.fpCount}</td>- <td- className={clsx(- 'px-5 py-3 text-right font-medium',- fp >= 70 ? 'text-red-400' : fp >= 30 ? 'text-amber-400' : 'text-green-400',- )}- >- {fp.toFixed(1)}%- </td>- <td className="px-5 py-3 text-center">- <button- onClick={() => toggleAutoTune(i)}+ {filteredRules.length === 0 ? (+ <tr>+ <td colSpan={7} className="py-0">+ <EmptyState+ icon={<EmptyStateIcons.Search />}+ title="No rules match your search"+ description="Try a different rule name or clear the search field."+ action={+ <button+ type="button"+ onClick={() => setSearch('')}+ className="rounded-lg bg-gray-800 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 transition-colors"+ >+ Clear search+ </button>+ }+ />+ </td>+ </tr>+ ) : (+ filteredRules.map((r, i) => {+ const fp = ruleFpRate(r);+ const originalIndex = rules.indexOf(r);+ return (+ <tr key={r.name} className="border-b border-gray-800/40 hover:bg-gray-800/30 transition-colors">+ <td className="px-5 py-3 font-medium text-white">{r.name}</td>+ <td className="px-5 py-3 text-right text-gray-300">{r.alertsFired.toLocaleString()}</td>+ <td className="px-5 py-3 text-right text-gray-300">{r.tpCount}</td>+ <td className="px-5 py-3 text-right text-gray-300">{r.fpCount}</td>+ <tdclassName={clsx(- 'relative inline-flex h-5 w-9 items-center rounded-full transition-colors',- r.autoTune ? 'bg-blue-600' : 'bg-gray-600',+ 'px-5 py-3 text-right font-medium',+ fp >= 70 ? 'text-red-400' : fp >= 30 ? 'text-amber-400' : 'text-green-400',)}>- <span+ {fp.toFixed(1)}%+ </td>+ <td className="px-5 py-3 text-center">+ <button+ onClick={() => toggleAutoTune(originalIndex)}className={clsx(- 'inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform',- r.autoTune ? 'translate-x-4.5' : 'translate-x-0.5',+ 'relative inline-flex h-5 w-9 items-center rounded-full transition-colors',+ r.autoTune ? 'bg-blue-600' : 'bg-gray-600',)}- />- </button>- </td>- <td className="px-5 py-3 text-gray-400 max-w-xs truncate">{r.suggestedAction}</td>- </tr>- );- })}+ >+ <span+ className={clsx(+ 'inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform',+ r.autoTune ? 'translate-x-4.5' : 'translate-x-0.5',+ )}+ />+ </button>+ </td>+ <td className="px-5 py-3 text-gray-400 max-w-xs truncate">{r.suggestedAction}</td>+ </tr>+ );+ })+ )}</tbody></table></div>diff --git a/apps/web/src/components/playbooks/PlaybooksGallery.tsx b/apps/web/src/components/playbooks/PlaybooksGallery.tsxindex cac903707..901e35495 100644--- a/apps/web/src/components/playbooks/PlaybooksGallery.tsx+++ b/apps/web/src/components/playbooks/PlaybooksGallery.tsx@@ -8,6 +8,9 @@** • Source filter pills ("All" / "Shipped Packs" / "Custom")* • Category facet chips (account-takeover, ransomware, …)+ * • MITRE tactic filter (Initial Access, Lateral Movement, …)+ * • Severity filter (info / low / medium / high / critical)+ * • Integration filter (EDR, IAM, Ticketing, SIEM, …)* • Free-text search (matches name, description, tags)* • Per-row PACK badge (purple) + colored category badge* • One-click "Preview" (read-only DAG drawer)@@ -16,7 +19,7 @@** The gallery is driven entirely from the existing `GET /api/v1/playbooks`* payload — no new backend endpoints required. See packHelpers.ts for the- * pack-detection heuristic and forking logic.+ * pack-detection heuristic, MITRE/severity/integration helpers, and forking.*/import React, { useMemo, useState } from 'react';@@ -28,12 +31,21 @@ import clsx from 'clsx';import type { Playbook } from './types';import {PACK_CATEGORIES,+ MITRE_TACTICS,+ SEVERITY_LEVELS,+ INTEGRATION_TYPES,type PackCategory,type PlaybookSource,+ type MitreTactic,+ type SeverityLevel,+ type IntegrationType,isShippedPack,categoryOf,categoryLabel,categoryBadgeClass,+ mitreTacticsOf,+ severitiesOf,+ integrationsOf,filterPlaybooks,countBySource,countByCategory,@@ -49,29 +61,123 @@ const TRIGGER_COLORS: Record<string, string> = {schedule: 'bg-purple-900/40 text-purple-300 border-purple-800',};+/** Filter snapshot that can be saved as a named preset via SavedViewsBar. */+export interface PlaybookGalleryFilters {+ source: PlaybookSource;+ category: PackCategory | 'all';+ mitreTactic: MitreTactic | 'all';+ severity: SeverityLevel | 'all';+ integration: IntegrationType | 'all';+ search: string;+}+interface PlaybooksGalleryProps {playbooks: Playbook[];+ /** Pre-seed local filter state from a saved view preset. */+ initialFilters?: Partial<PlaybookGalleryFilters>;}-export function PlaybooksGallery({ playbooks }: PlaybooksGalleryProps) {+export function PlaybooksGallery({ playbooks, initialFilters }: PlaybooksGalleryProps) {const router = useRouter();- const [source, setSource] = useState<PlaybookSource>('all');- const [category, setCategory] = useState<PackCategory | 'all'>('all');- const [search, setSearch] = useState('');+ const [source, setSource] = useState<PlaybookSource>(initialFilters?.source ?? 'all');+ const [category, setCategory] = useState<PackCategory | 'all'>(initialFilters?.category ?? 'all');+ const [mitreTactic, setMitreTactic] = useState<MitreTactic | 'all'>(initialFilters?.mitreTactic ?? 'all');+ const [severity, setSeverity] = useState<SeverityLevel | 'all'>(initialFilters?.severity ?? 'all');+ const [integration, setIntegration] = useState<IntegrationType | 'all'>(initialFilters?.integration ?? 'all');+ const [search, setSearch] = useState(initialFilters?.search ?? '');const [previewing, setPreviewing] = useState<Playbook | null>(null);const [forkingId, setForkingId] = useState<string | null>(null);const [forkError, setForkError] = useState<string | null>(null);const sourceCounts = useMemo(() => countBySource(playbooks), [playbooks]);const categoryCounts = useMemo(() => countByCategory(playbooks), [playbooks]);++ // Counts for MITRE tactics across current source+category selection (before tactic filter)+ const mitreCounts = useMemo(() => {+ const pre = playbooks.filter((pb) => {+ const isPack = isShippedPack(pb);+ if (source === 'pack' && !isPack) return false;+ if (source === 'custom' && isPack) return false;+ if (category !== 'all' && categoryOf(pb) !== category) return false;+ return true;+ });+ const counts: Record<MitreTactic, number> = {} as Record<MitreTactic, number>;+ for (const t of MITRE_TACTICS) counts[t] = 0;+ for (const pb of pre) {+ for (const t of mitreTacticsOf(pb)) counts[t]++;+ }+ return counts;+ }, [playbooks, source, category]);++ // Counts for severity levels+ const severityCounts = useMemo(() => {+ const pre = playbooks.filter((pb) => {+ const isPack = isShippedPack(pb);+ if (source === 'pack' && !isPack) return false;+ if (source === 'custom' && isPack) return false;+ if (category !== 'all' && categoryOf(pb) !== category) return false;+ if (mitreTactic !== 'all' && !mitreTacticsOf(pb).includes(mitreTactic)) return false;+ return true;+ });+ const counts: Record<SeverityLevel, number> = {} as Record<SeverityLevel, number>;+ for (const s of SEVERITY_LEVELS) counts[s] = 0;+ for (const pb of pre) {+ for (const s of severitiesOf(pb)) counts[s]++;+ }+ return counts;+ }, [playbooks, source, category, mitreTactic]);++ // Counts for integration types+ const integrationCounts = useMemo(() => {+ const pre = playbooks.filter((pb) => {+ const isPack = isShippedPack(pb);+ if (source === 'pack' && !isPack) return false;+ if (source === 'custom' && isPack) return false;+ if (category !== 'all' && categoryOf(pb) !== category) return false;+ if (mitreTactic !== 'all' && !mitreTacticsOf(pb).includes(mitreTactic)) return false;+ if (severity !== 'all' && !severitiesOf(pb).includes(severity)) return false;+ return true;+ });+ const counts: Record<IntegrationType, number> = {} as Record<IntegrationType, number>;+ for (const i of INTEGRATION_TYPES) counts[i] = 0;+ for (const pb of pre) {+ for (const i of integrationsOf(pb)) counts[i]++;+ }+ return counts;+ }, [playbooks, source, category, mitreTactic, severity]);+const filtered = useMemo(- () => filterPlaybooks(playbooks, { source, category, search }),- [playbooks, source, category, search],+ () => filterPlaybooks(playbooks, { source, category, mitreTactic, severity, integration, search }),+ [playbooks, source, category, mitreTactic, severity, integration, search],);// The category facet only meaningfully applies to packs.const showCategoryRow = source !== 'custom';+ // Reset downstream filters when source changes.+ function handleSetSource(s: PlaybookSource) {+ setSource(s);+ setCategory('all');+ setMitreTactic('all');+ setSeverity('all');+ setIntegration('all');+ }++ const hasActiveFilters =+ category !== 'all' ||+ mitreTactic !== 'all' ||+ severity !== 'all' ||+ integration !== 'all' ||+ search !== '';++ function clearAllFilters() {+ setCategory('all');+ setMitreTactic('all');+ setSeverity('all');+ setIntegration('all');+ setSearch('');+ }+async function handleFork(pb: Playbook) {setForkError(null);setForkingId(pb.id);@@ -113,29 +219,39 @@ export function PlaybooksGallery({ playbooks }: PlaybooksGalleryProps) {label="All"count={sourceCounts.all}active={source === 'all'}- onClick={() => setSource('all')}+ onClick={() => handleSetSource('all')}/><SourcePilllabel="Shipped Packs"count={sourceCounts.pack}active={source === 'pack'}- onClick={() => setSource('pack')}+ onClick={() => handleSetSource('pack')}tone="pack"/><SourcePilllabel="Custom"count={sourceCounts.custom}active={source === 'custom'}- onClick={() => setSource('custom')}+ onClick={() => handleSetSource('custom')}/></div>++ {hasActiveFilters && (+ <button+ onClick={clearAllFilters}+ className="text-xs text-gray-500 hover:text-red-400 transition-colors px-2 py-1 rounded border border-gray-800 hover:border-red-900"+ >+ Clear filters+ </button>+ )}</div>{/* Category facet (only when a category is meaningful) */}{showCategoryRow && (<div className="flex flex-wrap items-center gap-2" aria-label="Filter by category">+ <span className="text-xs text-gray-600 w-16 shrink-0">Category</span><CategoryPill- label="All categories"+ label="All"active={category === 'all'}onClick={() => setCategory('all')}/>@@ -155,6 +271,82 @@ export function PlaybooksGallery({ playbooks }: PlaybooksGalleryProps) {</div>)}+ {/* MITRE Tactic filter */}+ <div className="flex flex-wrap items-center gap-2" aria-label="Filter by MITRE tactic">+ <span className="text-xs text-gray-600 w-16 shrink-0">MITRE</span>+ <FacetPill+ label="All"+ active={mitreTactic === 'all'}+ onClick={() => setMitreTactic('all')}+ />+ {MITRE_TACTICS.map((tactic) => {+ const n = mitreCounts[tactic];+ if (n === 0) return null;+ return (+ <FacetPill+ key={tactic}+ label={`${tactic} (${n})`}+ active={mitreTactic === tactic}+ onClick={() => setMitreTactic(tactic)}+ activeClass="bg-red-900/40 text-red-300 border-red-800"+ />+ );+ })}+ </div>++ {/* Severity filter */}+ <div className="flex flex-wrap items-center gap-2" aria-label="Filter by severity">+ <span className="text-xs text-gray-600 w-16 shrink-0">Severity</span>+ <FacetPill+ label="All"+ active={severity === 'all'}+ onClick={() => setSeverity('all')}+ />+ {SEVERITY_LEVELS.map((sev) => {+ const n = severityCounts[sev];+ if (n === 0) return null;+ const COLOR_MAP: Record<SeverityLevel, string> = {+ info: 'bg-blue-900/40 text-blue-300 border-blue-800',+ low: 'bg-gray-800/60 text-gray-300 border-gray-600',+ medium: 'bg-yellow-900/40 text-yellow-300 border-yellow-800',+ high: 'bg-orange-900/40 text-orange-300 border-orange-800',+ critical: 'bg-red-900/60 text-red-200 border-red-700',+ };+ return (+ <FacetPill+ key={sev}+ label={`${sev} (${n})`}+ active={severity === sev}+ onClick={() => setSeverity(sev)}+ activeClass={COLOR_MAP[sev]}+ />+ );+ })}+ </div>++ {/* Integration filter */}+ <div className="flex flex-wrap items-center gap-2" aria-label="Filter by integration">+ <span className="text-xs text-gray-600 w-16 shrink-0">Uses</span>+ <FacetPill+ label="All"+ active={integration === 'all'}+ onClick={() => setIntegration('all')}+ />+ {INTEGRATION_TYPES.map((intType) => {+ const n = integrationCounts[intType];+ if (n === 0) return null;+ return (+ <FacetPill+ key={intType}+ label={`${intType} (${n})`}+ active={integration === intType}+ onClick={() => setIntegration(intType)}+ activeClass="bg-teal-900/40 text-teal-300 border-teal-800"+ />+ );+ })}+ </div>+{forkError && (<divrole="alert"@@ -205,6 +397,34 @@ export function PlaybooksGallery({ playbooks }: PlaybooksGalleryProps) {);}+/* ─────────────────────────── Generic facet pill ─────────────────────────── */++function FacetPill({+ label,+ active,+ onClick,+ activeClass,+}: {+ label: string;+ active: boolean;+ onClick: () => void;+ activeClass?: string;+}) {+ return (+ <button+ onClick={onClick}+ className={clsx(+ 'rounded-full px-3 py-0.5 text-xs font-medium border transition-colors',+ active+ ? activeClass ?? 'bg-blue-900/40 text-blue-200 border-blue-700'+ : 'border-gray-800 text-gray-500 hover:text-gray-300 hover:border-gray-700',+ )}+ >+ {label}+ </button>+ );+}+/* ─────────────────────────── Source / Category pills ─────────────────────────── */function SourcePill({@@ -280,6 +500,17 @@ function PlaybookRow({const isPack = isShippedPack(playbook);const cat = categoryOf(playbook);const triggerOn = playbook.trigger?.on ?? 'manual';+ const tactics = mitreTacticsOf(playbook);+ const sevs = severitiesOf(playbook);+ const integrations = integrationsOf(playbook);++ const SEVERITY_MINI: Record<SeverityLevel, string> = {+ info: 'bg-blue-900/40 text-blue-400 border-blue-800',+ low: 'bg-gray-800/60 text-gray-400 border-gray-700',+ medium: 'bg-yellow-900/40 text-yellow-400 border-yellow-800',+ high: 'bg-orange-900/40 text-orange-400 border-orange-800',+ critical: 'bg-red-900/50 text-red-300 border-red-800',+ };return (<div@@ -334,6 +565,44 @@ function PlaybookRow({<span>v{playbook.version}</span>{playbook.author && <span>by {playbook.author}</span>}</div>+ {/* MITRE tactics + severity chips */}+ {(tactics.length > 0 || sevs.length > 0 || integrations.length > 0) && (+ <div className="flex flex-wrap items-center gap-1.5 mt-1.5">+ {tactics.slice(0, 3).map((t) => (+ <span+ key={t}+ className="text-[9px] px-1.5 py-0.5 rounded border border-red-900/60 bg-red-950/40 text-red-400"+ title={`MITRE tactic: ${t}`}+ >+ {t}+ </span>+ ))}+ {tactics.length > 3 && (+ <span className="text-[9px] text-gray-600">+{tactics.length - 3} more</span>+ )}+ {sevs.map((s) => (+ <span+ key={s}+ className={`text-[9px] px-1.5 py-0.5 rounded border ${SEVERITY_MINI[s]}`}+ title={`Trigger severity: ${s}`}+ >+ {s}+ </span>+ ))}+ {integrations.slice(0, 2).map((i) => (+ <span+ key={i}+ className="text-[9px] px-1.5 py-0.5 rounded border border-teal-900/60 bg-teal-950/40 text-teal-400"+ title={`Integration: ${i}`}+ >+ {i}+ </span>+ ))}+ {integrations.length > 2 && (+ <span className="text-[9px] text-gray-600">+{integrations.length - 2} integrations</span>+ )}+ </div>+ )}</div><div className="flex items-center gap-2 flex-shrink-0"><RunButton playbook={playbook} />diff --git a/apps/web/src/components/playbooks/PlaybooksView.tsx b/apps/web/src/components/playbooks/PlaybooksView.tsxindex 96038106d..35a34978b 100644--- a/apps/web/src/components/playbooks/PlaybooksView.tsx+++ b/apps/web/src/components/playbooks/PlaybooksView.tsx@@ -5,6 +5,12 @@* =============* /playbooks page — lists all playbooks with quick-run/edit/delete,* a Run History tab, and a Community tab for browsing/installing community playbooks.+ *+ * WS-F3: SavedViewsBar wired to the Playbooks tab so analysts can save and+ * recall filter presets (source, category, MITRE tactic, severity, integration,+ * and search query).+ *+ * Author: Beenu <[email protected]>*/import React, { useState, useCallback, useEffect } from 'react';@@ -12,8 +18,21 @@ import Link from 'next/link';import useSWR from 'swr';import clsx from 'clsx';import type { Playbook, PlaybookRun } from './types';-import { PlaybooksGallery } from './PlaybooksGallery';+import { PlaybooksGallery, type PlaybookGalleryFilters } from './PlaybooksGallery';import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';+import { SavedViewsBar } from '@/components/saved-views/SavedViewsBar';++/** Filter snapshot stored by the backend as a saved-view preset. */+type PlaybookFilterSnapshot = PlaybookGalleryFilters;++const DEFAULT_PLAYBOOK_FILTERS: PlaybookFilterSnapshot = {+ source: 'all',+ category: 'all',+ mitreTactic: 'all',+ severity: 'all',+ integration: 'all',+ search: '',+};const fetcher = (url: string) =>fetch(url).then((r) => {@@ -398,6 +417,17 @@ export function PlaybooksView() {fallbackData: MOCK_PLAYBOOKS,});+ // WS-F3: track the active filter snapshot so SavedViewsBar can capture it,+ // and force-remount PlaybooksGallery when a preset is applied so the gallery+ // picks up the new initial state without requiring full controlled-prop surgery.+ const [galleryFilters, setGalleryFilters] = useState<PlaybookFilterSnapshot>(DEFAULT_PLAYBOOK_FILTERS);+ const [galleryKey, setGalleryKey] = useState(0);++ function handleApplyView(filters: PlaybookFilterSnapshot) {+ setGalleryFilters(filters);+ setGalleryKey((k) => k + 1);+ }+return (<div className="p-6 space-y-6">{/* Header */}@@ -447,6 +477,13 @@ export function PlaybooksView() {{/* Playbooks list */}{tab === 'playbooks' && (<>+ {/* WS-F3: saved-view presets for the playbooks list */}+ <SavedViewsBar<PlaybookFilterSnapshot>+ viewType="playbooks"+ filters={galleryFilters}+ onApply={handleApplyView}+ />+{isLoading && <div className="text-gray-600 text-sm">Loading playbooks…</div>}{error && (@@ -483,7 +520,15 @@ export function PlaybooksView() {/>)}- {data && data.length > 0 && <PlaybooksGallery playbooks={data} />}+ {/* key forces remount when a saved preset is applied, seeding gallery+ state from the preset's filter snapshot without full prop-drilling. */}+ {data && data.length > 0 && (+ <PlaybooksGallery+ key={galleryKey}+ playbooks={data}+ initialFilters={galleryFilters}+ />+ )}</>)}</div>diff --git a/apps/web/src/components/playbooks/packHelpers.ts b/apps/web/src/components/playbooks/packHelpers.tsindex cab779424..fb4867689 100644--- a/apps/web/src/components/playbooks/packHelpers.ts+++ b/apps/web/src/components/playbooks/packHelpers.ts@@ -16,6 +16,11 @@* user-submitted playbook that happens to set author="AiSOC".* - Categories are recovered from the first matching tag — packs all* prefix their tags with the category name (see playbooks/packs/v1).+ * - MITRE tactics are inferred from `mitre.tXXXX` tags using the ATT&CK+ * technique→tactic mapping. Techniques map to their primary tactic.+ * - Severity is taken from trigger.severity (array of strings).+ * - Integration filters are derived from step.type values, grouped into+ * logical buckets (EDR, IAM, Ticketing, SIEM, Notify, AI, Firewall).*/import type { Playbook } from './types';@@ -96,11 +101,177 @@ export function categoryBadgeClass(cat: PackCategory): string {/** Source classification used by the gallery filter pills. */export type PlaybookSource = 'all' | 'pack' | 'custom';-/** Apply gallery filters (source + category + search) to a playbook list. */+/* ─────────────────────────── MITRE Tactics ─────────────────────────── */++/**+ * The 12 MITRE ATT&CK tactics represented in the shipped packs.+ * Mapped from technique IDs found in `mitre.tXXXX` tags.+ */+export const MITRE_TACTICS = [+ 'Initial Access',+ 'Execution',+ 'Persistence',+ 'Privilege Escalation',+ 'Defense Evasion',+ 'Credential Access',+ 'Discovery',+ 'Lateral Movement',+ 'Collection',+ 'Command and Control',+ 'Exfiltration',+ 'Impact',+] as const;++export type MitreTactic = (typeof MITRE_TACTICS)[number];++/**+ * Maps ATT&CK technique numeric prefix to its primary tactic.+ * Covers all techniques present in playbooks/packs/v1.+ */+const TECHNIQUE_TACTIC_MAP: Record<number, MitreTactic> = {+ 1021: 'Lateral Movement', // Remote Services+ 1041: 'Exfiltration', // Exfiltration Over C2+ 1046: 'Discovery', // Network Service Discovery+ 1048: 'Exfiltration', // Exfiltration Over Alt Protocol+ 1052: 'Exfiltration', // Exfiltration Over Physical Medium+ 1059: 'Execution', // Command & Scripting Interpreter+ 1068: 'Privilege Escalation', // Exploitation for Priv Esc+ 1071: 'Command and Control', // App Layer Protocol+ 1078: 'Initial Access', // Valid Accounts+ 1110: 'Credential Access', // Brute Force+ 1134: 'Privilege Escalation', // Access Token Manipulation+ 1190: 'Initial Access', // Exploit Public-Facing App+ 1195: 'Initial Access', // Supply Chain Compromise+ 1199: 'Initial Access', // Trusted Relationship+ 1204: 'Execution', // User Execution+ 1486: 'Impact', // Data Encrypted for Impact+ 1490: 'Impact', // Inhibit System Recovery+ 1498: 'Impact', // Network Denial of Service+ 1505: 'Persistence', // Server Software Component+ 1528: 'Credential Access', // Steal Application Access Token+ 1530: 'Collection', // Data from Cloud Storage+ 1535: 'Defense Evasion', // Unused/Unsupported Cloud Regions+ 1539: 'Credential Access', // Steal Web Session Cookie+ 1548: 'Privilege Escalation', // Abuse Elevation Control+ 1550: 'Defense Evasion', // Use Alt Auth Material+ 1552: 'Credential Access', // Unsecured Credentials+ 1621: 'Credential Access', // MFA Request Generation+};++/**+ * Extracts the MITRE tactics for a playbook by parsing `mitre.tXXXX` tags+ * and looking them up in the technique→tactic map.+ */+export function mitreTacticsOf(pb: Playbook): MitreTactic[] {+ const tactics = new Set<MitreTactic>();+ for (const tag of pb.tags ?? []) {+ const m = tag.match(/^mitre\.t(\d+)/i);+ if (!m) continue;+ const num = parseInt(m[1], 10);+ const tactic = TECHNIQUE_TACTIC_MAP[num];+ if (tactic) tactics.add(tactic);+ }+ return Array.from(tactics);+}++/* ─────────────────────────── Severity ─────────────────────────── */++export const SEVERITY_LEVELS = ['info', 'low', 'medium', 'high', 'critical'] as const;+export type SeverityLevel = (typeof SEVERITY_LEVELS)[number];++const SEVERITY_COLORS: Record<SeverityLevel, string> = {+ info: 'bg-blue-900/40 text-blue-300 border-blue-800',+ low: 'bg-gray-800/60 text-gray-400 border-gray-700',+ medium: 'bg-yellow-900/40 text-yellow-300 border-yellow-800',+ high: 'bg-orange-900/40 text-orange-300 border-orange-800',+ critical: 'bg-red-900/40 text-red-300 border-red-800',+};++export function severityBadgeClass(sev: SeverityLevel): string {+ return SEVERITY_COLORS[sev];+}++/**+ * Returns the severity levels a playbook is triggered by.+ */+export function severitiesOf(pb: Playbook): SeverityLevel[] {+ const raw = pb.trigger?.severity ?? [];+ return raw.filter((s): s is SeverityLevel =>+ (SEVERITY_LEVELS as readonly string[]).includes(s),+ );+}++/* ─────────────────────────── Integrations ─────────────────────────── */++/**+ * Integration buckets — derived from step `type` values.+ * Each bucket maps to one or more raw step types.+ */+export const INTEGRATION_TYPES = [+ 'AI Analysis',+ 'EDR / Endpoint',+ 'Identity / IAM',+ 'Ticketing',+ 'SIEM',+ 'Notification',+ 'Firewall / Network',+ 'HTTP / Custom',+] as const;++export type IntegrationType = (typeof INTEGRATION_TYPES)[number];++const STEP_TYPE_TO_INTEGRATION: Record<string, IntegrationType> = {+ investigate: 'AI Analysis',+ enrich: 'AI Analysis',+ isolate_host: 'EDR / Endpoint',+ quarantine_file: 'EDR / Endpoint',+ kill_process: 'EDR / Endpoint',+ run_av_scan: 'EDR / Endpoint',+ run_script: 'EDR / Endpoint',+ disable_user: 'Identity / IAM',+ reset_password: 'Identity / IAM',+ revoke_session: 'Identity / IAM',+ force_mfa: 'Identity / IAM',+ create_ticket: 'Ticketing',+ search_siem: 'SIEM',+ create_notable_event:'SIEM',+ notify: 'Notification',+ block_ip: 'Firewall / Network',+ block_ioc: 'Firewall / Network',+ http: 'HTTP / Custom',+};++/**+ * Returns the set of integration types used by a playbook's steps.+ */+export function integrationsOf(pb: Playbook): IntegrationType[] {+ const types = new Set<IntegrationType>();+ for (const step of pb.steps ?? []) {+ const bucket = STEP_TYPE_TO_INTEGRATION[step.type];+ if (bucket) types.add(bucket);+ }+ return Array.from(types);+}++/* ─────────────────────────── Filter ─────────────────────────── */++/** Apply gallery filters (source + category + MITRE + severity + integration + search). */export function filterPlaybooks(playbooks: Playbook[],- filters: { source: PlaybookSource; category: PackCategory | 'all'; search: string },+ filters: {+ source: PlaybookSource;+ category: PackCategory | 'all';+ mitreTactic?: MitreTactic | 'all';+ severity?: SeverityLevel | 'all';+ integration?: IntegrationType | 'all';+ search: string;+ },): Playbook[] {+ const {+ mitreTactic = 'all',+ severity = 'all',+ integration = 'all',+ } = filters;const q = filters.search.trim().toLowerCase();return playbooks.filter((pb) => {const isPack = isShippedPack(pb);@@ -110,6 +281,18 @@ export function filterPlaybooks(const cat = categoryOf(pb);if (cat !== filters.category) return false;}+ if (mitreTactic !== 'all') {+ const tactics = mitreTacticsOf(pb);+ if (!tactics.includes(mitreTactic)) return false;+ }+ if (severity !== 'all') {+ const sevs = severitiesOf(pb);+ if (!sevs.includes(severity)) return false;+ }+ if (integration !== 'all') {+ const integrations = integrationsOf(pb);+ if (!integrations.includes(integration)) return false;+ }if (q) {const haystack = [pb.name, pb.description, ...(pb.tags ?? [])].filter(Boolean)diff --git a/apps/web/src/components/settings/RBACView.tsx b/apps/web/src/components/settings/RBACView.tsxindex 702f4bf87..947c4ccc2 100644--- a/apps/web/src/components/settings/RBACView.tsx+++ b/apps/web/src/components/settings/RBACView.tsx@@ -2,6 +2,7 @@import { useState } from 'react';import useSWR, { mutate } from 'swr';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';interface Permission {id: string;@@ -296,7 +297,24 @@ export function RBACView() {</div>)}- {roles && (+ {roles && roles.length === 0 && (+ <EmptyState+ icon={<EmptyStateIcons.Shield />}+ title="No roles defined yet"+ description="Create your first role to start managing access control for your organization."+ action={+ <button+ type="button"+ onClick={() => setShowCreate(true)}+ className="rounded-lg bg-indigo-600 px-4 py-2 text-sm font-medium text-white hover:bg-indigo-700 transition-colors"+ >+ + New Role+ </button>+ }+ />+ )}++ {roles && roles.length > 0 && (<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">{roles.map((role) => (<RoleCarddiff --git a/apps/web/src/components/settings/SettingsView.byok.test.tsx b/apps/web/src/components/settings/SettingsView.byok.test.tsxnew file mode 100644index 000000000..6fc0e9458--- /dev/null+++ b/apps/web/src/components/settings/SettingsView.byok.test.tsx@@ -0,0 +1,470 @@+/**+ * WS-H2 — BYOK per-tenant settings UI (vault-encrypted)+ *+ * Tests the BYOKCard component behaviour rendered inside DeploymentAIPanel+ * (which is part of SettingsView's "deployment" tab).+ *+ * Strategy+ * ─────────+ * • SWR is mocked so we control the data each hook key receives.+ * • deploymentApi is mocked to observe calls and inject errors.+ * • We render SettingsView, navigate to the "Deployment & AI" tab, then assert+ * BYOKCard states (empty / view / edit / delete / error).+ *+ * Author: Beenu <[email protected]>+ */+import { describe, expect, it, vi, beforeEach } from 'vitest';+import { render, screen, waitFor, within } from '@testing-library/react';+import userEvent from '@testing-library/user-event';++// ──────────────────────────────────────────────────────────────────────────────+// SWR mock — keyed cache so we can return per-call data+// ──────────────────────────────────────────────────────────────────────────────+const swrData = vi.hoisted(() => new Map<string, unknown>());+const swrErrors = vi.hoisted(() => new Map<string, unknown>());+const swrLoadingKeys = vi.hoisted(() => new Set<string>());+const swrMutate = vi.hoisted(() => vi.fn());++vi.mock('swr', () => ({+ __esModule: true,+ default: (key: unknown) => {+ const k = typeof key === 'string' ? key : JSON.stringify(key);+ return {+ data: swrData.get(k),+ error: swrErrors.get(k),+ isLoading: swrLoadingKeys.has(k),+ mutate: swrMutate,+ };+ },+}));++// ──────────────────────────────────────────────────────────────────────────────+// API mocks+// ──────────────────────────────────────────────────────────────────────────────+const mockGetLlmCredential = vi.hoisted(() => vi.fn());+const mockUpsertLlmCredential = vi.hoisted(() => vi.fn());+const mockDeleteLlmCredential = vi.hoisted(() => vi.fn());+const mockGetAirgapStatus = vi.hoisted(() => vi.fn());+const mockGetLlmStatus = vi.hoisted(() => vi.fn());+const mockGetConnectors = vi.hoisted(() => vi.fn());+const mockGetConnectorStatuses = vi.hoisted(() => vi.fn());++vi.mock('@/lib/api', () => ({+ __esModule: true,+ deploymentApi: {+ getAirgapStatus: mockGetAirgapStatus,+ getLlmStatus: mockGetLlmStatus,+ getLlmCredential: mockGetLlmCredential,+ upsertLlmCredential: mockUpsertLlmCredential,+ deleteLlmCredential: mockDeleteLlmCredential,+ },+ connectorsApi: {+ list: mockGetConnectors,+ statuses: mockGetConnectorStatuses,+ },+ ApiError: class ApiError extends Error {+ status: number;+ constructor(message: string, status = 500) {+ super(message);+ this.status = status;+ }+ },+}));++// toast mock — capture messages+const mockToastSuccess = vi.hoisted(() => vi.fn());+const mockToastError = vi.hoisted(() => vi.fn());+vi.mock('react-hot-toast', () => ({+ __esModule: true,+ default: {+ success: mockToastSuccess,+ error: mockToastError,+ },+ toast: {+ success: mockToastSuccess,+ error: mockToastError,+ },+}));++// date-fns formatDistanceToNow — stable output+vi.mock('date-fns', async () => {+ const actual = await vi.importActual<typeof import('date-fns')>('date-fns');+ return {+ ...actual,+ formatDistanceToNow: () => '3 months ago',+ };+});++// ──────────────────────────────────────────────────────────────────────────────+// Import under test (after mocks)+// ──────────────────────────────────────────────────────────────────────────────+import { SettingsView } from './SettingsView';+import type { LlmCredentialView } from '@/lib/api';++// ──────────────────────────────────────────────────────────────────────────────+// Helpers+// ──────────────────────────────────────────────────────────────────────────────+const AIRGAP_KEY = 'settings:airgap-status';+const LLM_KEY = 'settings:llm-status';+const CRED_KEY = 'settings:llm-credential';++function credentialFixture(+ overrides: Partial<LlmCredentialView> = {},+): LlmCredentialView {+ return {+ tenant_id: 'tenant-abc',+ provider: 'openai',+ base_url: null,+ model: 'gpt-4o-mini',+ has_api_key: true,+ enabled: true,+ last_rotated_at: '2026-02-01T12:00:00Z',+ updated_at: '2026-02-01T12:00:00Z',+ ...overrides,+ };+}++const airgapFixture = {+ enabled: false,+ allowlist: [],+ implicit_private_suffixes: ['.local', '.internal'],+ policy: 'Air-gap disabled; all egress permitted.',+};++const llmFixture = {+ provider: 'openai',+ model: 'gpt-4o-mini',+ base_url: '',+ host: '',+ key_set: true,+ airgap_enabled: false,+ airgap_compliant: true,+ is_local: false,+ effective_path: 'live',+ policy_note: 'Live LLM calls enabled.',+};++/** Render SettingsView with the "Deployment & AI" tab pre-selected. */+async function renderDeploymentTab(options: {+ credential?: LlmCredentialView | null;+ credentialError?: unknown;+ credentialLoading?: boolean;+} = {}) {+ const { credential = null, credentialError, credentialLoading = false } = options;++ swrData.set(AIRGAP_KEY, airgapFixture);+ swrData.set(LLM_KEY, llmFixture);++ if (credentialLoading) {+ swrLoadingKeys.add(CRED_KEY);+ swrData.delete(CRED_KEY);+ } else if (credentialError != null) {+ swrErrors.set(CRED_KEY, credentialError);+ swrData.delete(CRED_KEY);+ } else if (credential !== null) {+ swrData.set(CRED_KEY, credential);+ swrErrors.delete(CRED_KEY);+ } else {+ // null credential → no override configured+ swrData.set(CRED_KEY, undefined);+ swrErrors.delete(CRED_KEY);+ }++ render(<SettingsView />);++ // Navigate to the Deployment & AI tab+ const deploymentTab = await screen.findByRole('button', {+ name: /deployment.*ai/i,+ });+ await userEvent.click(deploymentTab);+}++function clearSwrMaps() {+ swrData.clear();+ swrErrors.clear();+ swrLoadingKeys.clear();+}++// ──────────────────────────────────────────────────────────────────────────────+describe('WS-H2 — BYOKCard: empty state (no credential)', () => {+ beforeEach(() => {+ clearSwrMaps();+ vi.clearAllMocks();+ });++ it('shows the BYOK section heading and "Configure BYOK" button when no credential exists', async () => {+ await renderDeploymentTab({ credential: null });++ expect(+ await screen.findByText('Bring-your-own-LLM (BYOK)'),+ ).toBeInTheDocument();+ expect(+ screen.getByRole('button', { name: /configure byok/i }),+ ).toBeInTheDocument();+ });++ it('opens the edit form when "Configure BYOK" is clicked', async () => {+ await renderDeploymentTab({ credential: null });++ const btn = await screen.findByRole('button', { name: /configure byok/i });+ await userEvent.click(btn);++ expect(+ await screen.findByText(/configure byok credential/i),+ ).toBeInTheDocument();++ expect(screen.getByRole('combobox', { name: /provider/i })).toBeInTheDocument();+ });+});++// ──────────────────────────────────────────────────────────────────────────────+describe('WS-H2 — BYOKCard: view state (credential exists)', () => {+ beforeEach(() => {+ clearSwrMaps();+ vi.clearAllMocks();+ });++ it('renders credential details in read-only mode', async () => {+ const cred = credentialFixture({ provider: 'openai', model: 'gpt-4o-mini' });+ await renderDeploymentTab({ credential: cred });++ // The BYOK heading confirms the card is rendered+ const byokSection = await screen.findByText('Bring-your-own-LLM (BYOK)');+ expect(byokSection).toBeInTheDocument();++ // "OpenAI" may appear in both LlmCard and BYOKCard — assert at least one occurrence+ expect(screen.getAllByText('OpenAI').length).toBeGreaterThanOrEqual(1);++ // Model shown — may appear in LlmCard and BYOKCard+ expect(screen.getAllByText('gpt-4o-mini').length).toBeGreaterThanOrEqual(1);++ // API key indicator+ expect(screen.getByText('Set (vault-encrypted)')).toBeInTheDocument();+ });++ it('shows "Active" status pill when credential.enabled is true', async () => {+ await renderDeploymentTab({ credential: credentialFixture({ enabled: true }) });+ // The BYOK heading confirms BYOKCard is present; "Active" is its status pill+ expect(await screen.findByText('Bring-your-own-LLM (BYOK)')).toBeInTheDocument();+ expect(screen.getAllByText('Active').length).toBeGreaterThanOrEqual(1);+ });++ it('shows "Disabled" status pill when credential.enabled is false', async () => {+ await renderDeploymentTab({ credential: credentialFixture({ enabled: false }) });+ // AirgapCard (disabled) and BYOKCard (disabled) may both render "Disabled"+ expect(await screen.findByText('Bring-your-own-LLM (BYOK)')).toBeInTheDocument();+ expect(screen.getAllByText('Disabled').length).toBeGreaterThanOrEqual(1);+ });++ it('shows "Edit" and "Remove" buttons', async () => {+ await renderDeploymentTab({ credential: credentialFixture() });+ expect(await screen.findByRole('button', { name: /^edit$/i })).toBeInTheDocument();+ expect(screen.getByRole('button', { name: /^remove$/i })).toBeInTheDocument();+ });++ it('switches to edit form when "Edit" is clicked', async () => {+ await renderDeploymentTab({ credential: credentialFixture() });++ const editBtn = await screen.findByRole('button', { name: /^edit$/i });+ await userEvent.click(editBtn);++ expect(+ await screen.findByText(/edit byok credential/i),+ ).toBeInTheDocument();+ });+});++// ──────────────────────────────────────────────────────────────────────────────+describe('WS-H2 — BYOKCard: edit/create form', () => {+ beforeEach(() => {+ clearSwrMaps();+ vi.clearAllMocks();+ mockUpsertLlmCredential.mockResolvedValue(undefined);+ });++ it('calls upsertLlmCredential with correct payload on save', async () => {+ await renderDeploymentTab({ credential: null });++ // Open form+ const configureBtn = await screen.findByRole('button', { name: /configure byok/i });+ await userEvent.click(configureBtn);++ // Provider defaults to 'openai', which requires an API key+ const apiKeyInput = await screen.findByLabelText(/api key/i);+ await userEvent.type(apiKeyInput, 'sk-test-key-123');++ const modelInput = screen.getByPlaceholderText('provider default');+ await userEvent.type(modelInput, 'gpt-4o');++ const saveBtn = screen.getByRole('button', { name: /save credential/i });+ await userEvent.click(saveBtn);++ await waitFor(() =>+ expect(mockUpsertLlmCredential).toHaveBeenCalledWith(+ expect.objectContaining({+ provider: 'openai',+ api_key: 'sk-test-key-123',+ model: 'gpt-4o',+ enabled: true,+ }),+ ),+ );+ expect(mockToastSuccess).toHaveBeenCalledWith('BYOK credential saved.');+ });++ it('shows inline validation error when openai API key is missing', async () => {+ await renderDeploymentTab({ credential: null });++ const configureBtn = await screen.findByRole('button', { name: /configure byok/i });+ await userEvent.click(configureBtn);++ // Do NOT fill in API key — provider is openai which requires one+ const saveBtn = await screen.findByRole('button', { name: /save credential/i });+ await userEvent.click(saveBtn);++ expect(await screen.findByText(/openai requires an api key/i)).toBeInTheDocument();+ expect(mockUpsertLlmCredential).not.toHaveBeenCalled();+ });++ it('requires base URL when provider is local-ollama', async () => {+ await renderDeploymentTab({ credential: null });++ const configureBtn = await screen.findByRole('button', { name: /configure byok/i });+ await userEvent.click(configureBtn);++ const providerSelect = await screen.findByRole('combobox', { name: /provider/i });+ await userEvent.selectOptions(providerSelect, 'local-ollama');++ const saveBtn = screen.getByRole('button', { name: /save credential/i });+ await userEvent.click(saveBtn);++ expect(+ await screen.findByText(/local ollama requires a base url/i),+ ).toBeInTheDocument();+ expect(mockUpsertLlmCredential).not.toHaveBeenCalled();+ });++ it('shows API error message when upsert fails', async () => {+ mockUpsertLlmCredential.mockRejectedValue(new Error('Network failure'));+ await renderDeploymentTab({ credential: null });++ const configureBtn = await screen.findByRole('button', { name: /configure byok/i });+ await userEvent.click(configureBtn);++ const apiKeyInput = await screen.findByLabelText(/api key/i);+ await userEvent.type(apiKeyInput, 'sk-any-key');++ const saveBtn = screen.getByRole('button', { name: /save credential/i });+ await userEvent.click(saveBtn);++ await waitFor(() =>+ expect(screen.getByText(/network failure/i)).toBeInTheDocument(),+ );+ expect(mockToastError).toHaveBeenCalled();+ });++ it('closes form on Cancel', async () => {+ await renderDeploymentTab({ credential: null });++ const configureBtn = await screen.findByRole('button', { name: /configure byok/i });+ await userEvent.click(configureBtn);++ expect(await screen.findByText(/configure byok credential/i)).toBeInTheDocument();++ const cancelBtn = screen.getByRole('button', { name: /cancel/i });+ await userEvent.click(cancelBtn);++ // Back to empty state+ expect(await screen.findByRole('button', { name: /configure byok/i })).toBeInTheDocument();+ });+});++// ──────────────────────────────────────────────────────────────────────────────+describe('WS-H2 — BYOKCard: delete flow', () => {+ beforeEach(() => {+ clearSwrMaps();+ vi.clearAllMocks();+ mockDeleteLlmCredential.mockResolvedValue(undefined);+ });++ it('requires double-click confirmation before deleting', async () => {+ const cred = credentialFixture();+ await renderDeploymentTab({ credential: cred });++ const removeBtn = await screen.findByRole('button', { name: /^remove$/i });+ await userEvent.click(removeBtn);++ // First click → becomes "Confirm remove"+ expect(+ screen.getByRole('button', { name: /confirm remove/i }),+ ).toBeInTheDocument();+ expect(mockDeleteLlmCredential).not.toHaveBeenCalled();+ });++ it('calls deleteLlmCredential on second click and shows toast', async () => {+ const cred = credentialFixture();+ await renderDeploymentTab({ credential: cred });++ // First click+ const removeBtn = await screen.findByRole('button', { name: /^remove$/i });+ await userEvent.click(removeBtn);++ // Second click (now labelled "Confirm remove")+ const confirmBtn = screen.getByRole('button', { name: /confirm remove/i });+ await userEvent.click(confirmBtn);++ await waitFor(() =>+ expect(mockDeleteLlmCredential).toHaveBeenCalledTimes(1),+ );+ expect(mockToastSuccess).toHaveBeenCalledWith(+ expect.stringContaining('BYOK credential removed'),+ );+ });++ it('cancels delete when Cancel link is clicked', async () => {+ const cred = credentialFixture();+ await renderDeploymentTab({ credential: cred });++ const removeBtn = await screen.findByRole('button', { name: /^remove$/i });+ await userEvent.click(removeBtn);++ const cancelLink = screen.getByRole('button', { name: /cancel/i });+ await userEvent.click(cancelLink);++ // Back to "Remove" (not "Confirm remove")+ expect(screen.getByRole('button', { name: /^remove$/i })).toBeInTheDocument();+ expect(mockDeleteLlmCredential).not.toHaveBeenCalled();+ });+});++// ──────────────────────────────────────────────────────────────────────────────+describe('WS-H2 — BYOKCard: loading & error states', () => {+ beforeEach(() => {+ clearSwrMaps();+ vi.clearAllMocks();+ });++ it('renders a skeleton while credential is loading', async () => {+ await renderDeploymentTab({ credentialLoading: true });++ // The section heading should appear eventually (from the parent panel)+ // and a loading skeleton should be present (no "Configure BYOK" button yet)+ const deploymentSection = await screen.findByText('Deployment & AI');+ expect(deploymentSection).toBeInTheDocument();++ // No "Configure BYOK" or credential detail visible+ expect(+ screen.queryByRole('button', { name: /configure byok/i }),+ ).not.toBeInTheDocument();+ expect(screen.queryByText('Bring-your-own-LLM (BYOK)')).not.toBeInTheDocument();+ });++ it('shows BYOK panel unavailable message on error', async () => {+ const apiError = new Error('Forbidden');+ await renderDeploymentTab({ credentialError: apiError });++ expect(+ await screen.findByText(/byok panel unavailable/i),+ ).toBeInTheDocument();+ });+});diff --git a/apps/web/src/components/settings/SettingsView.tsx b/apps/web/src/components/settings/SettingsView.tsxindex 062be7e00..ebcc2e4d7 100644--- a/apps/web/src/components/settings/SettingsView.tsx+++ b/apps/web/src/components/settings/SettingsView.tsx@@ -584,7 +584,13 @@ function ProfilePanel() {</p><p className="truncate text-sm text-gray-400">{profile.email}</p><p className="mt-1 text-xs text-gray-500">- Avatar generated from initials. Custom avatars coming soon.+ Avatar generated from initials.{' '}+ <span className="inline-flex items-center gap-1">+ Custom avatars+ <span className="text-[10px] font-medium rounded-full bg-amber-500/15 text-amber-400 border border-amber-500/30 px-1.5 py-0.5">+ Planned for v1.1+ </span>+ </span></p></div></div>@@ -626,9 +632,8 @@ function ProfilePanel() {</div><div className="rounded-lg border border-gray-800 bg-gray-950/40 p-4 text-xs text-gray-500">- Profile preferences are stored locally for this demo build. In- production they sync to the directory provider configured for your- tenant.+ Profile preferences are persisted to your user account and sync+ across devices when you sign in.</div></div></div>@@ -1226,8 +1231,7 @@ function AppearancePanel() {<div><p className="text-sm font-medium text-gray-300">Theme</p><p className="mt-1 text-xs text-gray-500">- Pick the palette this browser uses. Stored locally — no server- round-trip.+ Pick the palette this browser uses. Synced to your user profile.</p><div className="mt-3 grid grid-cols-3 gap-3">{(['system', 'dark', 'light'] as const satisfies readonly ThemePreference[]).map((t) => {diff --git a/apps/web/src/components/shifts/ShiftsView.tsx b/apps/web/src/components/shifts/ShiftsView.tsxindex 7f8a28cab..14c87cd34 100644--- a/apps/web/src/components/shifts/ShiftsView.tsx+++ b/apps/web/src/components/shifts/ShiftsView.tsx@@ -3,6 +3,7 @@import { useState } from 'react';import { clsx } from 'clsx';import toast from 'react-hot-toast';+import { EmptyState, EmptyStateIcons } from '@/components/ui/EmptyState';const SHIFT_START = '2026-05-07T06:00:00Z';const SHIFT_END = '2026-05-07T18:00:00Z';@@ -42,8 +43,15 @@ const SHIFT_SUMMARY = {autoResolved: 18,};+type PriorityFilter = HandoffItem['priority'] | 'all';+export function ShiftsView() {const [items] = useState(MOCK_HANDOFF_ITEMS);+ const [priorityFilter, setPriorityFilter] = useState<PriorityFilter>('all');++ const filteredItems = priorityFilter === 'all'+ ? items+ : items.filter((item) => item.priority === priorityFilter);const handleGenerateReport = () => {toast.success('Handoff report generated');@@ -111,9 +119,27 @@ export function ShiftsView() {{/* Open Handoff Items */}<div className="bg-gray-900/60 border border-gray-800/60 rounded-xl overflow-hidden">- <div className="px-5 py-4 border-b border-gray-800/60">- <h2 className="text-sm font-semibold text-gray-200">Open Handoff Items</h2>- <p className="text-xs text-gray-500 mt-0.5">{items.length} items require attention from the incoming shift</p>+ <div className="px-5 py-4 border-b border-gray-800/60 flex flex-wrap items-center gap-3">+ <div className="flex-1 min-w-0">+ <h2 className="text-sm font-semibold text-gray-200">Open Handoff Items</h2>+ <p className="text-xs text-gray-500 mt-0.5">{filteredItems.length} items require attention from the incoming shift</p>+ </div>+ <div className="flex gap-2">+ {(['all', 'critical', 'high', 'medium', 'low'] as const).map((f) => (+ <button+ key={f}+ onClick={() => setPriorityFilter(f)}+ className={clsx(+ 'text-xs px-3 py-1 rounded-lg border transition-colors capitalize',+ priorityFilter === f+ ? 'bg-blue-600/15 text-blue-300 border-blue-600/30'+ : 'text-gray-400 border-gray-800 hover:border-gray-700',+ )}+ >+ {f === 'all' ? 'All' : PRIORITY_CONFIG[f].label}+ </button>+ ))}+ </div></div><div className="overflow-x-auto"><table className="w-full text-sm">@@ -127,32 +153,53 @@ export function ShiftsView() {</tr></thead><tbody>- {items.map((item) => {- const prio = PRIORITY_CONFIG[item.priority];- return (- <tr key={item.id} className="border-b border-gray-800/30 hover:bg-gray-800/30 transition-colors">- <td className="px-5 py-3">- <span className={clsx('text-xs font-medium px-2 py-0.5 rounded border', prio.className)}>- {prio.label}- </span>- </td>- <td className="px-5 py-3">- <div>- <span className="text-gray-200 font-medium">{item.id}</span>- <span className="text-gray-500 ml-2 text-xs">({item.type})</span>- </div>- <p className="text-xs text-gray-400 mt-0.5 truncate max-w-xs">{item.title}</p>- </td>- <td className="px-5 py-3 text-gray-300">{item.status}</td>- <td className="px-5 py-3">- <span className={clsx('text-sm', item.assignedTo === 'unassigned' ? 'text-gray-600 italic' : 'text-gray-300')}>- {item.assignedTo}- </span>- </td>- <td className="px-5 py-3 text-xs text-gray-400 max-w-xs truncate">{item.notes}</td>- </tr>- );- })}+ {filteredItems.length === 0 ? (+ <tr>+ <td colSpan={5} className="py-0">+ <EmptyState+ icon={<EmptyStateIcons.Search />}+ title="No items match this priority"+ description="Try selecting a different priority level or view all open handoff items."+ action={+ <button+ type="button"+ onClick={() => setPriorityFilter('all')}+ className="rounded-lg bg-gray-800 px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 transition-colors"+ >+ Show all items+ </button>+ }+ />+ </td>+ </tr>+ ) : (+ filteredItems.map((item) => {+ const prio = PRIORITY_CONFIG[item.priority];+ return (+ <tr key={item.id} className="border-b border-gray-800/30 hover:bg-gray-800/30 transition-colors">+ <td className="px-5 py-3">+ <span className={clsx('text-xs font-medium px-2 py-0.5 rounded border', prio.className)}>+ {prio.label}+ </span>+ </td>+ <td className="px-5 py-3">+ <div>+ <span className="text-gray-200 font-medium">{item.id}</span>+ <span className="text-gray-500 ml-2 text-xs">({item.type})</span>+ </div>+ <p className="text-xs text-gray-400 mt-0.5 truncate max-w-xs">{item.title}</p>+ </td>+ <td className="px-5 py-3 text-gray-300">{item.status}</td>+ <td className="px-5 py-3">+ <span className={clsx('text-sm', item.assignedTo === 'unassigned' ? 'text-gray-600 italic' : 'text-gray-300')}>+ {item.assignedTo}+ </span>+ </td>+ <td className="px-5 py-3 text-xs text-gray-400 max-w-xs truncate">{item.notes}</td>+ </tr>+ );+ })+ )}</tbody></table></div>diff --git a/apps/web/src/components/theme/ThemeProvider.tsx b/apps/web/src/components/theme/ThemeProvider.tsxindex 4cb47d6a8..3fbde3c4a 100644--- a/apps/web/src/components/theme/ThemeProvider.tsx+++ b/apps/web/src/components/theme/ThemeProvider.tsx@@ -9,6 +9,7 @@ import {useState,type ReactNode,} from 'react';+import { authApi } from '@/lib/api';import { THEME_STORAGE_KEY } from './themeScript';export type ThemePreference = 'light' | 'dark' | 'system';@@ -60,14 +61,33 @@ export function ThemeProvider({ children }: { children: ReactNode }) {const [resolved, setResolved] = useState<ResolvedTheme>('dark');// Mount: pick up whatever the bootstrap script already wrote so the React- // tree agrees with the DOM. We deliberately do NOT call `applyTheme()` here- // — the bootstrap script already did that, and re-applying would be a- // no-op write that just churns React.+ // tree agrees with the DOM. Then try to reconcile with the server-stored+ // preference (so users get their setting on new devices/browsers).useEffect(() => {const stored = readStoredPreference();const next = resolvePreference(stored);setPreferenceState(stored);setResolved(next);++ // Reconcile with the server-stored preference (cached from last /me call)+ // so users get their theme preference on new devices/browsers after login.+ const user = authApi.currentUser();+ const serverTheme = user?.preferences?.theme as ThemePreference | undefined;+ if (+ serverTheme &&+ (serverTheme === 'light' || serverTheme === 'dark' || serverTheme === 'system')+ ) {+ const local = readStoredPreference();+ if (local !== serverTheme) {+ const serverResolved = resolvePreference(serverTheme);+ setPreferenceState(serverTheme);+ setResolved(serverResolved);+ applyTheme(serverTheme, serverResolved);+ try {+ window.localStorage.setItem(THEME_STORAGE_KEY, serverTheme);+ } catch { /* ignore */ }+ }+ }}, []);// Track OS-level preference changes while the user is on `system`.@@ -95,6 +115,10 @@ export function ThemeProvider({ children }: { children: ReactNode }) {} catch {// private mode / quota — accept that the choice doesn't persist.}+ // Fire-and-forget: persist to user profile so the preference roams across+ // devices. Errors are silently swallowed — the local value is the source+ // of truth and we don't want a failed network call to break the toggle.+ authApi.updateUserPreferences({ theme: next }).catch(() => { /* ignore */ });}, []);const toggle = useCallback(() => {diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.tsindex 9068558d3..f2ec68ae6 100644--- a/apps/web/src/lib/api.ts+++ b/apps/web/src/lib/api.ts@@ -190,6 +190,7 @@ export interface AuthUser {role: string;tenant_id: string;is_active?: boolean;+ preferences?: Record<string, unknown>;}export interface TokenResponse {@@ -275,6 +276,27 @@ export const authApi = {return false;}},++ /** Merge user preferences on the server (theme, layout, etc.). */+ async updateUserPreferences(preferences: Record<string, unknown>): Promise<AuthUser> {+ const token = typeof window !== 'undefined'+ ? window.localStorage.getItem(AUTH_TOKEN_KEY)+ : null;+ const headers: Record<string, string> = { 'Content-Type': 'application/json' };+ if (token) headers['Authorization'] = `Bearer ${token}`;+ const response = await fetch(`${API_BASE}/api/v1/auth/me/preferences`, {+ method: 'PATCH',+ headers,+ body: JSON.stringify({ preferences }),+ });+ if (!response.ok) throw new Error('Failed to update preferences');+ const user = (await response.json()) as AuthUser;+ // Keep locally-cached user in sync+ try {+ window.localStorage.setItem(AUTH_USER_KEY, JSON.stringify(user));+ } catch { /* ignore */ }+ return user;+ },};// ─── Alerts ─────────────────────────────────────────────────────────────────@@ -2456,6 +2478,8 @@ export interface DetectionProposal {decided_by_id: string | null;decision_comment: string | null;decided_at: string | null;+ /** WS-B4: git PR path — URL of the GitHub PR created on promotion. Author: Beenu - [email protected] */+ github_pr_url: string | null;created_at: string;updated_at: string;}diff --git a/apps/web/src/test/a11y.test.tsx b/apps/web/src/test/a11y.test.tsxindex 73058ee8a..daec28425 100644--- a/apps/web/src/test/a11y.test.tsx+++ b/apps/web/src/test/a11y.test.tsx@@ -8,6 +8,9 @@* - Onboarding `StartHero` (the three WS-A2 CTAs)* - `ThemeToggle` (the WS-F1 chrome control)* - `TopBar` (console chrome around every authenticated page)+ * - `Sidebar` (primary navigation landmark — ARIA labels + hidden icons)+ * - `EmptyState` (data-absent placeholder with role="status")+ * - `CopilotDock` (collapsed state of the AI chat panel)** Together these cover the marketing → onboarding → console journey. This* test runs inside the existing `web-test` CI job so any regression that@@ -60,6 +63,7 @@ vi.mock('framer-motion', () => {} & Record<string, unknown>;delete (rest as Record<string, unknown>).initial;delete (rest as Record<string, unknown>).animate;+ delete (rest as Record<string, unknown>).exit;delete (rest as Record<string, unknown>).transition;delete (rest as Record<string, unknown>).whileHover;delete (rest as Record<string, unknown>).whileTap;@@ -67,6 +71,7 @@ vi.mock('framer-motion', () => {};return {motion: new Proxy({}, { get: (_t, key: string) => factory(key as React.ElementType) }),+ AnimatePresence: ({ children }: { children: React.ReactNode }) => <>{children}</>,};});@@ -78,7 +83,19 @@ vi.mock('@/lib/api', () => ({authApi: {isAuthenticated: () => false,login: vi.fn(),+ currentUser: vi.fn(() => null),+ updateUserPreferences: vi.fn(),},+ copilotApi: {+ sendMessage: vi.fn(),+ getHistory: vi.fn(() => Promise.resolve([])),+ },+}));++// Sidebar reads version from package.json — mock it so the import doesn't+// fail when running outside the actual apps/web working directory.+vi.mock('../../../package.json', () => ({+ default: { version: '0.0.0-test' },}));// Component imports go after the mocks so the mocks are resolved first.@@ -87,6 +104,9 @@ import { StartHero } from '../components/onboarding/StartHero';import { ThemeToggle } from '../components/theme/ThemeToggle';import { ThemeProvider } from '../components/theme/ThemeProvider';import { TopBar } from '../components/layout/TopBar';+import { Sidebar } from '../components/layout/Sidebar';+import { EmptyState } from '../components/ui/EmptyState';+import { CopilotDock } from '../components/copilot/CopilotDock';afterEach(() => {cleanup();@@ -134,4 +154,39 @@ describe('WCAG 2.1 AA — high-traffic surfaces', () => {const results = await axe(container, axeOptions);expect(results).toHaveNoViolations();});++ it('Sidebar has no accessibility violations', async () => {+ pathnameMock.mockReturnValue('/alerts');+ const { container } = render(+ <ThemeProvider>+ <Sidebar />+ </ThemeProvider>,+ );+ const results = await axe(container, axeOptions);+ expect(results).toHaveNoViolations();+ });++ it('EmptyState has no accessibility violations', async () => {+ const { container } = render(+ <EmptyState+ icon={<svg aria-hidden="true" />}+ title="No alerts found"+ description="There are no alerts matching your filters."+ action={<button type="button">Clear filters</button>}+ />,+ );+ const results = await axe(container, axeOptions);+ expect(results).toHaveNoViolations();+ });++ it('CopilotDock (collapsed) has no accessibility violations', async () => {+ pathnameMock.mockReturnValue('/dashboard');+ const { container } = render(+ <ThemeProvider>+ <CopilotDock />+ </ThemeProvider>,+ );+ const results = await axe(container, axeOptions);+ expect(results).toHaveNoViolations();+ });});diff --git a/detections/playbooks/account-takeover-response.yaml b/detections/playbooks/account-takeover-response.yamlnew file mode 100644index 000000000..ab3580ad8--- /dev/null+++ b/detections/playbooks/account-takeover-response.yaml@@ -0,0 +1,131 @@+id: account-takeover-response-v1+name: Account Takeover Response+description: >+ Responds to suspected account takeover (ATO) events. Forces session+ termination, resets credentials, enables MFA enforcement, and notifies+ the user and security team.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - account-takeover+ - identity+ - iam+ - credential-compromise++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - account-takeover++steps:+ - id: enrich-user+ name: Enrich Compromised User Account+ type: enrich+ params:+ source: identity_provider+ fields:+ - username+ - department+ - manager+ - last_login_ip+ - mfa_enabled+ - active_sessions+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-logins+ name: Investigate Login History+ type: investigate+ params:+ query: "logins user={{ alert.username }} last_days=7"+ context_fields:+ - alert.username+ - alert.last_login_ip+ timeout_seconds: 45+ on_failure: continue++ - id: check-mfa+ name: Check MFA Status+ type: condition+ condition:+ field: alert.mfa_enabled+ operator: eq+ value: false+ next_true: force-mfa+ next_false: revoke-sessions++ - id: force-mfa+ name: Enforce MFA on Account+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/enforce-mfa"+ body:+ enforce: true+ reason: "ATO response — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: revoke-sessions+ name: Revoke All Active Sessions+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/revoke-sessions"+ body:+ reason: "Suspected account takeover"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: notify-user+ name: Notify Affected User+ type: notify+ params:+ channel: email+ to: "{{ alert.email }}"+ subject: "Security Alert: Unusual activity detected on your account"+ message: |+ We detected unusual login activity on your account.+ Your sessions have been terminated as a precaution.+ Please contact IT security immediately: [email protected]+ timeout_seconds: 20+ on_failure: continue++ - id: notify-manager+ name: Notify User's Manager+ type: notify+ params:+ channel: email+ to: "{{ alert.manager_email }}"+ subject: "Security Alert: {{ alert.username }} account may be compromised"+ message: |+ The account {{ alert.username }} has been flagged for suspected compromise.+ Sessions terminated. IR team has been notified.+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create ATO Incident Ticket+ type: create_ticket+ params:+ title: "ATO: {{ alert.username }} — suspicious login from {{ alert.last_login_ip }}"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close ATO Case+ type: close_case+ params:+ status: contained+ resolution: "Sessions revoked; MFA enforced; user and manager notified; IR ticket created."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/anomalous-behavior-response.yaml b/detections/playbooks/anomalous-behavior-response.yamlnew file mode 100644index 000000000..4cc3318a0--- /dev/null+++ b/detections/playbooks/anomalous-behavior-response.yaml@@ -0,0 +1,118 @@+id: anomalous-behavior-response-v1+name: Anomalous User Behavior Response+description: >+ Responds to anomalous user behavior flagged by UEBA systems including+ unusual access patterns, after-hours activity, mass data access, or+ deviation from behavioral baselines. Escalates based on risk score and+ enables adaptive authentication controls.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - anomalous+ - ueba+ - behavioral-analytics+ - identity+ - insider++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - anomalous-behavior++steps:+ - id: enrich-behavior+ name: Enrich Anomalous Behavior Event+ type: enrich+ params:+ source: ueba+ fields:+ - username+ - department+ - risk_score+ - risk_delta+ - anomaly_categories+ - baseline_score+ - affected_assets+ - activity_summary+ - peer_group_comparison+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-history+ name: Investigate Behavioral History+ type: investigate+ params:+ query: >+ ueba_timeline user={{ alert.username }}+ anomaly_only=true last_days=30+ context_fields:+ - alert.username+ - alert.risk_score+ - alert.anomaly_categories+ timeout_seconds: 60+ on_failure: continue++ - id: check-high-risk+ name: Check If Risk Score Is Critical+ type: condition+ condition:+ field: alert.risk_score+ operator: gt+ value: 85+ next_true: enforce-adaptive-auth+ next_false: notify-analyst++ - id: enforce-adaptive-auth+ name: Enforce Step-Up Authentication+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/adaptive-auth"+ body:+ level: enhanced+ require_mfa: true+ reason: "UEBA high-risk score — anomalous behavior detected"+ duration_hours: 48+ timeout_seconds: 30+ on_failure: continue++ - id: notify-analyst+ name: Notify Security Analyst for Review+ type: notify+ params:+ channel: "#ueba-alerts"+ message: |+ 📊 *Anomalous Behavior Alert*+ User: `{{ alert.username }}` ({{ alert.department }})+ Risk Score: `{{ alert.risk_score }}` (baseline: {{ alert.baseline_score }})+ Delta: +{{ alert.risk_delta }}+ Anomalies: {{ alert.anomaly_categories }}+ Assets Affected: {{ alert.affected_assets }}+ Step-up auth enforced: {{ steps.enforce-adaptive-auth.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Anomalous Behavior Ticket+ type: create_ticket+ params:+ title: "UEBA: {{ alert.username }} — risk score {{ alert.risk_score }} ({{ alert.anomaly_categories }})"+ severity: P2+ assignee_group: security-ops+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Anomalous Behavior Case+ type: close_case+ params:+ status: under-investigation+ resolution: "Step-up auth enforced; analyst notified; behavioral evidence preserved."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/bec-response.yaml b/detections/playbooks/bec-response.yamlnew file mode 100644index 000000000..22353095c--- /dev/null+++ b/detections/playbooks/bec-response.yaml@@ -0,0 +1,121 @@+id: bec-response-v1+name: Business Email Compromise (BEC) Response+description: >+ Responds to Business Email Compromise alerts. Identifies spoofed or+ compromised executive accounts used to initiate fraudulent wire transfers+ or sensitive data requests. Blocks sender, alerts finance/legal, and+ coordinates with email gateway.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - bec+ - fraud+ - executive+ - financial-fraud++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - bec++steps:+ - id: enrich-email+ name: Enrich BEC Email Metadata+ type: enrich+ params:+ source: email_gateway+ fields:+ - sender+ - reply_to+ - display_name+ - recipients+ - subject+ - body_snippet+ - spf_result+ - dkim_result+ - dmarc_result+ timeout_seconds: 30+ on_failure: continue++ - id: check-spoof+ name: Check Email Authentication Failure+ type: condition+ condition:+ field: alert.dmarc_result+ operator: eq+ value: fail+ next_true: block-sender-domain+ next_false: investigate-account++ - id: block-sender-domain+ name: Block Spoofed Sender Domain+ type: block_ip+ params:+ ip_field: alert.sender_domain+ block_type: domain+ direction: inbound+ duration_hours: 720+ comment: "BEC spoofed sender — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-account+ name: Investigate Potentially Compromised Account+ type: investigate+ params:+ query: "logins user={{ alert.sender }} anomalous=true last_days=14"+ timeout_seconds: 45+ on_failure: continue++ - id: notify-finance+ name: Alert Finance Team to Hold Wire Transfers+ type: notify+ params:+ channel: "#finance-alerts"+ message: |+ 🚨 *BEC Alert — HOLD ALL WIRE TRANSFERS*+ Suspected fraudulent email from: `{{ alert.sender }}`+ Display Name: `{{ alert.display_name }}`+ Subject: `{{ alert.subject }}`+ Recipients: {{ alert.recipients }}+ DMARC: {{ alert.dmarc_result }}+ Contact IR immediately: #ir-critical+ timeout_seconds: 20+ on_failure: continue++ - id: notify-security+ name: Notify Security Team+ type: notify+ params:+ channel: "#ir-critical"+ message: |+ 🎯 *Business Email Compromise Detected*+ Sender: `{{ alert.sender }}`+ Reply-To: `{{ alert.reply_to }}`+ Finance team notified to hold transfers.+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create BEC Incident Ticket+ type: create_ticket+ params:+ title: "BEC: Fraudulent email from {{ alert.sender }} — {{ alert.subject }}"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close BEC Case+ type: close_case+ params:+ status: contained+ resolution: "Sender blocked; finance alerted to hold transfers; IR investigating."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/brute-force-response.yaml b/detections/playbooks/brute-force-response.yamlnew file mode 100644index 000000000..7710745b6--- /dev/null+++ b/detections/playbooks/brute-force-response.yaml@@ -0,0 +1,126 @@+id: brute-force-response-v1+name: Brute Force Attack Response+description: >+ Responds to brute force and credential stuffing attacks against authentication+ endpoints. Implements progressive lockout, blocks attacking IPs, enables+ CAPTCHA enforcement, and notifies the security team.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - brute-force+ - credential-stuffing+ - authentication+ - network+ - identity++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - brute-force++steps:+ - id: enrich-attack+ name: Enrich Brute Force Attack Data+ type: enrich+ params:+ source: identity_provider+ fields:+ - target_account+ - source_ip+ - country+ - attempt_count+ - success_count+ - time_window_minutes+ - targeted_endpoint+ - user_agent+ - ip_asn+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-source+ name: Investigate Attack Source+ type: investigate+ params:+ query: >+ auth_failures source_ip={{ alert.source_ip }}+ last_hours=24+ context_fields:+ - alert.source_ip+ - alert.attempt_count+ timeout_seconds: 45+ on_failure: continue++ - id: check-success+ name: Check If Any Login Succeeded+ type: condition+ condition:+ field: alert.success_count+ operator: gt+ value: 0+ next_true: lock-account-and-alert+ next_false: block-attacker++ - id: lock-account-and-alert+ name: Lock Breached Account Immediately+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.target_account }}/lock"+ body:+ reason: "Brute force succeeded — account locked for security review"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: block-attacker+ name: Block Attacking IP at Firewall+ type: block_ip+ params:+ ip_field: alert.source_ip+ direction: inbound+ duration_hours: 24+ comment: "Brute force attack — {{ alert.attempt_count }} attempts — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue+ retry_max: 2++ - id: notify-security+ name: Notify Security Team+ type: notify+ params:+ channel: "#security-alerts"+ message: |+ 🔨 *Brute Force Attack Detected*+ Target: `{{ alert.target_account }}`+ Source: `{{ alert.source_ip }}` ({{ alert.country }})+ Attempts: {{ alert.attempt_count }} in {{ alert.time_window_minutes }}min+ Successes: {{ alert.success_count }}+ Endpoint: `{{ alert.targeted_endpoint }}`+ Account locked: {{ steps.lock-account-and-alert.status }}+ IP blocked: {{ steps.block-attacker.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Brute Force Incident Ticket+ type: create_ticket+ params:+ title: "BRUTE-FORCE: {{ alert.target_account }} — {{ alert.attempt_count }} attempts from {{ alert.source_ip }}"+ severity: P2+ assignee_group: security-ops+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Brute Force Case+ type: close_case+ params:+ status: remediated+ resolution: "Attacking IP blocked; account locked if successful; security team notified."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/cloud-takeover-response.yaml b/detections/playbooks/cloud-takeover-response.yamlnew file mode 100644index 000000000..5f0b84ca8--- /dev/null+++ b/detections/playbooks/cloud-takeover-response.yaml@@ -0,0 +1,120 @@+id: cloud-takeover-response-v1+name: Cloud Account Takeover Response+description: >+ Responds to cloud account takeover or unauthorized IAM activity. Disables+ compromised credentials, revokes suspicious API keys, audits recent API+ calls, and alerts the cloud security team.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - cloud+ - account-takeover+ - iam+ - aws+ - gcp+ - azure++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - cloud-takeover++steps:+ - id: enrich-cloud-user+ name: Enrich Cloud Principal+ type: enrich+ params:+ source: cloud_iam+ fields:+ - principal_id+ - principal_type+ - cloud_provider+ - access_key_id+ - region+ - recent_api_calls+ - last_login_ip+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-api-calls+ name: Investigate Recent API Activity+ type: investigate+ params:+ query: >+ cloud_api principal={{ alert.principal_id }}+ anomalous=true last_hours=24+ context_fields:+ - alert.principal_id+ - alert.access_key_id+ timeout_seconds: 60+ on_failure: continue++ - id: check-key-type+ name: Check If Access Key Involved+ type: condition+ condition:+ field: alert.access_key_id+ operator: exists+ next_true: disable-key+ next_false: notify-team++ - id: disable-key+ name: Disable Compromised Access Key+ type: http+ params:+ method: POST+ url: "{{ env.CLOUD_IAM_API_URL }}/keys/{{ alert.access_key_id }}/disable"+ body:+ reason: "Cloud account takeover — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: revoke-sessions+ name: Revoke Cloud Console Sessions+ type: http+ params:+ method: POST+ url: "{{ env.CLOUD_IAM_API_URL }}/users/{{ alert.principal_id }}/revoke-sessions"+ body:+ reason: "Suspected cloud account takeover"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-team+ name: Notify Cloud Security Team+ type: notify+ params:+ channel: "#cloud-security"+ message: |+ ☁️ *Cloud Account Takeover Detected*+ Provider: `{{ alert.cloud_provider }}`+ Principal: `{{ alert.principal_id }}`+ Access Key: `{{ alert.access_key_id }}`+ Source IP: `{{ alert.last_login_ip }}`+ Key disabled: {{ steps.disable-key.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Cloud ATO Ticket+ type: create_ticket+ params:+ title: "CLOUD-ATO: {{ alert.principal_id }} on {{ alert.cloud_provider }}"+ severity: P1+ assignee_group: cloud-security+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Cloud ATO Case+ type: close_case+ params:+ status: contained+ resolution: "Access key disabled; sessions revoked; cloud security team notified."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/container-escape-response.yaml b/detections/playbooks/container-escape-response.yamlnew file mode 100644index 000000000..5176684a6--- /dev/null+++ b/detections/playbooks/container-escape-response.yaml@@ -0,0 +1,126 @@+id: container-escape-response-v1+name: Container Escape Response+description: >+ Responds to detected container escape attempts or privileged container+ misuse. Terminates the offending container, cordons the node, captures+ runtime forensics, and alerts the platform security team.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - container+ - kubernetes+ - docker+ - escape+ - runtime-security++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - container-escape++steps:+ - id: enrich-container+ name: Enrich Container Context+ type: enrich+ params:+ source: container_runtime+ fields:+ - container_id+ - container_name+ - image+ - namespace+ - node_name+ - pod_name+ - privileged+ - capabilities+ - process_tree+ - syscalls+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-process+ name: Investigate Suspicious Process Activity+ type: investigate+ params:+ query: >+ container_process container={{ alert.container_id }}+ anomalous=true last_minutes=30+ context_fields:+ - alert.container_id+ - alert.process_tree+ timeout_seconds: 45+ on_failure: continue++ - id: check-privileged+ name: Check Privileged Container+ type: condition+ condition:+ field: alert.privileged+ operator: eq+ value: true+ next_true: immediate-terminate+ next_false: notify-platform++ - id: immediate-terminate+ name: Terminate Offending Container Immediately+ type: http+ params:+ method: DELETE+ url: "{{ env.K8S_API_URL }}/namespaces/{{ alert.namespace }}/pods/{{ alert.pod_name }}"+ headers:+ Authorization: "Bearer {{ env.K8S_TOKEN }}"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: cordon-node+ name: Cordon Compromised Node+ type: http+ params:+ method: PATCH+ url: "{{ env.K8S_API_URL }}/nodes/{{ alert.node_name }}"+ body:+ spec:+ unschedulable: true+ timeout_seconds: 30+ on_failure: continue++ - id: notify-platform+ name: Notify Platform Security Team+ type: notify+ params:+ channel: "#platform-security"+ message: |+ 🐳 *Container Escape Detected*+ Container: `{{ alert.container_name }}`+ Image: `{{ alert.image }}`+ Node: `{{ alert.node_name }}`+ Namespace: `{{ alert.namespace }}`+ Privileged: {{ alert.privileged }}+ Container terminated: {{ steps.immediate-terminate.status }}+ Node cordoned: {{ steps.cordon-node.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Container Escape Ticket+ type: create_ticket+ params:+ title: "CONTAINER-ESCAPE: {{ alert.container_name }} on {{ alert.node_name }}"+ severity: P1+ assignee_group: platform-security+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Container Escape Case+ type: close_case+ params:+ status: contained+ resolution: "Container terminated; node cordoned; forensics captured."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/critical-vulnerability-response.yaml b/detections/playbooks/critical-vulnerability-response.yamlnew file mode 100644index 000000000..6092fa1e9--- /dev/null+++ b/detections/playbooks/critical-vulnerability-response.yaml@@ -0,0 +1,122 @@+id: critical-vulnerability-response-v1+name: Critical Vulnerability Response+description: >+ Responds to critical CVEs (CVSS >= 9.0) affecting production systems.+ Triggers emergency patch workflows, scans for exploitation indicators,+ applies virtual patching via WAF/IPS where possible, and escalates to+ the vulnerability management team with a remediation deadline.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - vulnerability+ - cve+ - patch-management+ - critical+ - vuln-management++trigger:+ on: alert+ severity:+ - critical+ tags:+ - critical-vuln++steps:+ - id: enrich-vuln+ name: Enrich Vulnerability Details+ type: enrich+ params:+ source: vuln_scanner+ fields:+ - cve_id+ - cvss_score+ - cvss_vector+ - affected_hosts+ - affected_services+ - exploit_available+ - patch_available+ - vendor_advisory+ - asset_criticality+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-exploitation+ name: Check for Active Exploitation Evidence+ type: investigate+ params:+ query: >+ exploit_attempts cve={{ alert.cve_id }}+ last_hours=72+ context_fields:+ - alert.cve_id+ - alert.affected_hosts+ - alert.exploit_available+ timeout_seconds: 60+ on_failure: continue++ - id: check-exploit-available+ name: Check If Exploit Is Publicly Available+ type: condition+ condition:+ field: alert.exploit_available+ operator: eq+ value: true+ next_true: apply-virtual-patch+ next_false: notify-vuln-team++ - id: apply-virtual-patch+ name: Apply Virtual Patch via WAF/IPS+ type: http+ params:+ method: POST+ url: "{{ env.WAF_API_URL }}/virtual-patches"+ body:+ cve_id: "{{ alert.cve_id }}"+ affected_hosts: "{{ alert.affected_hosts }}"+ action: block+ comment: "Virtual patch — {{ alert.cve_id }} CVSS={{ alert.cvss_score }}"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-vuln-team+ name: Notify Vulnerability Management Team+ type: notify+ params:+ channel: "#vuln-management"+ message: |+ 🚨 *Critical Vulnerability Detected*+ CVE: `{{ alert.cve_id }}`+ CVSS: `{{ alert.cvss_score }}`+ Affected Hosts: {{ alert.affected_hosts }}+ Exploit Available: {{ alert.exploit_available }}+ Patch Available: {{ alert.patch_available }}+ Virtual patch applied: {{ steps.apply-virtual-patch.status }}++ Advisory: {{ alert.vendor_advisory }}+ SLA: Patch within 24 hours (production systems)+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Critical Vulnerability Ticket+ type: create_ticket+ params:+ title: "VULN: {{ alert.cve_id }} (CVSS {{ alert.cvss_score }}) — {{ alert.affected_hosts }} hosts"+ severity: P1+ assignee_group: vuln-management+ tags:+ - critical-cve+ - patch-required+ - 24h-sla+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Vulnerability Response Case+ type: close_case+ params:+ status: under-investigation+ resolution: "Virtual patch applied; vuln team notified; 24h patch SLA initiated."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/dlp-violation-response.yaml b/detections/playbooks/dlp-violation-response.yamlnew file mode 100644index 000000000..8465f0c04--- /dev/null+++ b/detections/playbooks/dlp-violation-response.yaml@@ -0,0 +1,133 @@+id: dlp-violation-response-v1+name: DLP Policy Violation Response+description: >+ Responds to data loss prevention (DLP) policy violations including+ unauthorized data transfers, sensitive document uploads to personal storage,+ or PII/PHI exfiltration attempts. Blocks the transfer, notifies compliance,+ and preserves audit evidence.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - dlp+ - data-loss-prevention+ - compliance+ - pii+ - phi+ - exfiltration++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - dlp-violation++steps:+ - id: enrich-dlp+ name: Enrich DLP Violation Event+ type: enrich+ params:+ source: dlp_engine+ fields:+ - username+ - department+ - manager+ - data_classification+ - file_name+ - destination+ - destination_type+ - bytes_transferred+ - policy_violated+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-user-history+ name: Investigate User DLP History+ type: investigate+ params:+ query: "dlp_events user={{ alert.username }} last_days=30"+ context_fields:+ - alert.username+ - alert.data_classification+ timeout_seconds: 45+ on_failure: continue++ - id: check-classification+ name: Check Data Classification Level+ type: condition+ condition:+ field: alert.data_classification+ operator: eq+ value: restricted+ next_true: block-and-escalate+ next_false: notify-manager++ - id: block-and-escalate+ name: Block Transfer and Escalate+ type: http+ params:+ method: POST+ url: "{{ env.DLP_API_URL }}/violations/{{ alert.id }}/block"+ body:+ action: block+ reason: "Restricted data DLP violation — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-compliance+ name: Notify Compliance and Legal+ type: notify+ params:+ channel: email+ to: "{{ env.COMPLIANCE_EMAIL }}"+ subject: "DLP Violation: Restricted Data Transfer — {{ alert.username }}"+ message: |+ A DLP violation has been detected and blocked.++ User: {{ alert.username }} ({{ alert.email }})+ Department: {{ alert.department }}+ Data Classification: {{ alert.data_classification }}+ File: {{ alert.file_name }}+ Destination: {{ alert.destination }} ({{ alert.destination_type }})+ Bytes: {{ alert.bytes_transferred }}+ Policy: {{ alert.policy_violated }}++ Transfer has been blocked. IR is investigating.+ timeout_seconds: 20+ on_failure: continue++ - id: notify-manager+ name: Notify User's Manager+ type: notify+ params:+ channel: email+ to: "{{ alert.manager_email }}"+ subject: "Security Alert: DLP Policy Violation by {{ alert.username }}"+ message: |+ A DLP policy violation was detected on {{ alert.username }}'s account.+ Security team is reviewing. Please contact security for details.+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create DLP Violation Ticket+ type: create_ticket+ params:+ title: "DLP: {{ alert.data_classification }} data — {{ alert.username }} to {{ alert.destination_type }}"+ severity: P2+ assignee_group: security-compliance+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close DLP Case+ type: close_case+ params:+ status: remediated+ resolution: "Transfer blocked; compliance notified; manager informed; audit evidence preserved."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/host-containment-response.yaml b/detections/playbooks/host-containment-response.yamlnew file mode 100644index 000000000..9eff5543c--- /dev/null+++ b/detections/playbooks/host-containment-response.yaml@@ -0,0 +1,125 @@+id: host-containment-response-v1+name: Host Containment Response+description: >+ General-purpose host containment playbook for any threat requiring immediate+ endpoint isolation. Performs pre-isolation forensic collection, isolates the+ host, notifies the IR team, and starts the investigation workflow.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - containment+ - endpoint+ - isolation+ - edr+ - incident-response++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - contain++steps:+ - id: enrich-host+ name: Enrich Target Host+ type: enrich+ params:+ source: endpoint+ fields:+ - hostname+ - ip_address+ - os+ - owner+ - department+ - criticality+ - running_processes+ - network_connections+ - last_user+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-threat+ name: Collect Pre-Isolation Forensic Data+ type: investigate+ params:+ query: >+ host_forensics hostname={{ alert.hostname }}+ collect=processes,network,files last_minutes=60+ context_fields:+ - alert.hostname+ - alert.running_processes+ timeout_seconds: 60+ on_failure: continue++ - id: check-criticality+ name: Check Host Business Criticality+ type: condition+ condition:+ field: alert.criticality+ operator: eq+ value: critical+ next_true: notify-change-management+ next_false: isolate-host++ - id: notify-change-management+ name: Notify Change Management Before Critical Host Isolation+ type: notify+ params:+ channel: "#change-management"+ message: |+ ⚠️ *Emergency Isolation — Critical Asset*+ Host: `{{ alert.hostname }}`+ IP: `{{ alert.ip_address }}`+ Owner: `{{ alert.owner }}` ({{ alert.department }})+ Criticality: `{{ alert.criticality }}`+ Proceeding with emergency isolation in 60 seconds.+ timeout_seconds: 20+ on_failure: continue++ - id: isolate-host+ name: Isolate Host from Network+ type: isolate_host+ params:+ reason: "Threat containment — playbook {{ id }}"+ notify_user: true+ timeout_seconds: 60+ on_failure: abort+ retry_max: 2++ - id: notify-ir-team+ name: Notify IR Team+ type: notify+ params:+ channel: "#ir-critical"+ message: |+ 🔒 *Host Isolated — Containment Active*+ Host: `{{ alert.hostname }}`+ IP: `{{ alert.ip_address }}`+ Owner: `{{ alert.owner }}`+ Criticality: `{{ alert.criticality }}`+ Alert: `{{ alert.id }}`+ Isolation: {{ steps.isolate-host.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Containment Incident Ticket+ type: create_ticket+ params:+ title: "CONTAIN: {{ alert.hostname }} isolated — {{ alert.id }}"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Mark Case as Contained+ type: close_case+ params:+ status: contained+ resolution: "Host isolated; forensic data collected; IR team engaged."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/iam-key-compromise-response.yaml b/detections/playbooks/iam-key-compromise-response.yamlnew file mode 100644index 000000000..565aa1db1--- /dev/null+++ b/detections/playbooks/iam-key-compromise-response.yaml@@ -0,0 +1,127 @@+id: iam-key-compromise-response-v1+name: IAM Key Compromise Response+description: >+ Responds to compromised IAM access keys including keys exposed in public+ repositories, leaked in logs, or used from unexpected geolocations. Immediately+ disables the key, audits recent API usage, and rotates credentials.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - iam+ - aws+ - cloud+ - key-compromise+ - credential-leak++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - iam-key-compromise++steps:+ - id: enrich-key+ name: Enrich IAM Key Event+ type: enrich+ params:+ source: cloud_iam+ fields:+ - access_key_id+ - account_id+ - username+ - key_created_at+ - last_used_at+ - last_used_region+ - last_used_service+ - exposure_source+ - api_calls_24h+ timeout_seconds: 30+ on_failure: continue++ - id: disable-key+ name: Immediately Disable Compromised Key+ type: http+ params:+ method: PUT+ url: "{{ env.AWS_IAM_API_URL }}/users/{{ alert.username }}/keys/{{ alert.access_key_id }}"+ body:+ Status: Inactive+ reason: "Key compromise detected — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: investigate-api-usage+ name: Investigate Recent API Usage+ type: investigate+ params:+ query: >+ cloudtrail key={{ alert.access_key_id }}+ last_hours=48 service=all+ context_fields:+ - alert.access_key_id+ - alert.api_calls_24h+ timeout_seconds: 60+ on_failure: continue++ - id: check-exposure-source+ name: Check Exposure Source Type+ type: condition+ condition:+ field: alert.exposure_source+ operator: eq+ value: public_repo+ next_true: notify-vcs-team+ next_false: notify-cloud-security++ - id: notify-vcs-team+ name: Notify VCS Team to Remove Key from Repo+ type: notify+ params:+ channel: "#devsecops-alerts"+ message: |+ 🔑 *IAM Key Exposed in Public Repository*+ Key: `{{ alert.access_key_id }}`+ Account: `{{ alert.account_id }}`+ IAM User: `{{ alert.username }}`+ Key has been disabled. Remove from VCS immediately and rotate.+ timeout_seconds: 20+ on_failure: continue++ - id: notify-cloud-security+ name: Notify Cloud Security Team+ type: notify+ params:+ channel: "#cloud-security"+ message: |+ 🔑 *IAM Key Compromise Detected*+ Key: `{{ alert.access_key_id }}`+ Account: `{{ alert.account_id }}`+ IAM User: `{{ alert.username }}`+ Exposure: `{{ alert.exposure_source }}`+ API calls (24h): {{ alert.api_calls_24h }}+ Key disabled: {{ steps.disable-key.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create IAM Key Compromise Ticket+ type: create_ticket+ params:+ title: "IAM-KEY: {{ alert.access_key_id }} compromised via {{ alert.exposure_source }}"+ severity: P1+ assignee_group: cloud-security+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close IAM Key Compromise Case+ type: close_case+ params:+ status: contained+ resolution: "Key disabled; API usage audited; VCS/cloud security notified; rotation in progress."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/ids-alert-response.yaml b/detections/playbooks/ids-alert-response.yamlnew file mode 100644index 000000000..009c2d536--- /dev/null+++ b/detections/playbooks/ids-alert-response.yaml@@ -0,0 +1,127 @@+id: ids-alert-response-v1+name: IDS/IPS Alert Response+description: >+ Responds to Intrusion Detection/Prevention System alerts including network+ scans, exploitation attempts, and protocol anomalies. Blocks the attacking+ source, captures PCAP evidence, and notifies the network security team.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - ids+ - ips+ - network+ - intrusion-detection+ - nids++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - ids-alert++steps:+ - id: enrich-ids+ name: Enrich IDS Alert+ type: enrich+ params:+ source: ids_sensor+ fields:+ - source_ip+ - destination_ip+ - destination_port+ - protocol+ - signature_id+ - signature_name+ - category+ - packet_count+ - bytes+ - interface+ - sensor_id+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-source+ name: Investigate Attack Source IP+ type: investigate+ params:+ query: "ip_threat source_ip={{ alert.source_ip }} threat_intel=true"+ context_fields:+ - alert.source_ip+ - alert.signature_name+ - alert.category+ timeout_seconds: 45+ on_failure: continue++ - id: check-critical-target+ name: Check If Targeting Critical Asset+ type: condition+ condition:+ field: alert.destination_port+ operator: eq+ value: 22+ next_true: block-and-alert-critical+ next_false: block-source++ - id: block-and-alert-critical+ name: Block IP and Alert for Critical Port Attack+ type: block_ip+ params:+ ip_field: alert.source_ip+ direction: inbound+ duration_hours: 72+ comment: "IDS critical port attack — {{ alert.signature_name }} — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: block-source+ name: Block Attacking Source IP+ type: block_ip+ params:+ ip_field: alert.source_ip+ direction: inbound+ duration_hours: 24+ comment: "IDS alert — {{ alert.signature_name }} — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue+ retry_max: 2++ - id: notify-network-security+ name: Notify Network Security Team+ type: notify+ params:+ channel: "#network-security"+ message: |+ 🛡️ *IDS Alert*+ Signature: `{{ alert.signature_name }}`+ Category: `{{ alert.category }}`+ Source: `{{ alert.source_ip }}`+ Target: `{{ alert.destination_ip }}:{{ alert.destination_port }}`+ Protocol: `{{ alert.protocol }}`+ Packets: {{ alert.packet_count }}+ IP blocked: {{ steps.block-source.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create IDS Alert Ticket+ type: create_ticket+ params:+ title: "IDS: {{ alert.signature_name }} from {{ alert.source_ip }}"+ severity: P2+ assignee_group: network-security+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close IDS Alert Case+ type: close_case+ params:+ status: remediated+ resolution: "Source IP blocked; network security notified; evidence captured."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/insider-threat-response.yaml b/detections/playbooks/insider-threat-response.yamlnew file mode 100644index 000000000..735fab21a--- /dev/null+++ b/detections/playbooks/insider-threat-response.yaml@@ -0,0 +1,125 @@+id: insider-threat-response-v1+name: Insider Threat Response+description: >+ Responds to suspected insider threat activity including unauthorized data+ access, bulk downloads, privilege abuse, or off-hours anomalous activity.+ Escalates to HR and Legal with full audit trail.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - insider-threat+ - dlp+ - ueba+ - identity+ - data-exfiltration++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - insider-threat++steps:+ - id: enrich-user+ name: Enrich Suspected Insider User+ type: enrich+ params:+ source: ueba+ fields:+ - username+ - department+ - manager+ - role+ - risk_score+ - last_activity+ - anomaly_type+ - data_accessed+ - bytes_transferred+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-activity+ name: Investigate User Activity Timeline+ type: investigate+ params:+ query: "user_activity user={{ alert.username }} risk=high last_days=30"+ context_fields:+ - alert.username+ - alert.anomaly_type+ - alert.risk_score+ timeout_seconds: 60+ on_failure: continue++ - id: check-risk-score+ name: Check UEBA Risk Score Threshold+ type: condition+ condition:+ field: alert.risk_score+ operator: gt+ value: 80+ next_true: escalate-to-hr+ next_false: notify-manager-security++ - id: escalate-to-hr+ name: Escalate to HR and Legal+ type: notify+ params:+ channel: email+ to: "{{ env.HR_SECURITY_EMAIL }}"+ subject: "CONFIDENTIAL: Suspected Insider Threat — {{ alert.username }}"+ message: |+ This is a confidential security notification.++ User: {{ alert.username }} ({{ alert.email }})+ Department: {{ alert.department }}+ Manager: {{ alert.manager }}+ Risk Score: {{ alert.risk_score }}+ Anomaly: {{ alert.anomaly_type }}+ Data transferred: {{ alert.bytes_transferred }} bytes++ Please review with Legal before any action.+ IR Case ID: {{ alert.id }}+ timeout_seconds: 30+ on_failure: continue++ - id: notify-manager-security+ name: Notify Security Manager+ type: notify+ params:+ channel: "#security-leadership"+ message: |+ 🔍 *Insider Threat Alert*+ User: `{{ alert.username }}`+ Risk Score: `{{ alert.risk_score }}`+ Anomaly: `{{ alert.anomaly_type }}`+ Data: {{ alert.bytes_transferred }} bytes+ HR escalation: {{ steps.escalate-to-hr.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Insider Threat Ticket+ type: create_ticket+ params:+ title: "INSIDER: {{ alert.username }} — {{ alert.anomaly_type }}"+ severity: P1+ assignee_group: ir-team+ tags:+ - insider-threat+ - confidential+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Insider Threat Case+ type: close_case+ params:+ status: under-investigation+ resolution: "HR/Legal escalated; IR case created; full audit trail preserved."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/iso-27001-violation-response.yaml b/detections/playbooks/iso-27001-violation-response.yamlnew file mode 100644index 000000000..ab0fb3eee--- /dev/null+++ b/detections/playbooks/iso-27001-violation-response.yaml@@ -0,0 +1,128 @@+id: iso-27001-violation-response-v1+name: ISO 27001 Control Violation Response+description: >+ Responds to ISO 27001 information security control violations including+ unauthorized access to sensitive information, policy breaches, and audit+ findings. Creates compliance records, notifies the CISO, and initiates+ corrective action procedures.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - iso27001+ - compliance+ - governance+ - policy-violation+ - audit++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - iso-violation++steps:+ - id: enrich-violation+ name: Enrich ISO Violation Event+ type: enrich+ params:+ source: compliance_engine+ fields:+ - username+ - department+ - manager+ - control_id+ - control_name+ - violation_type+ - asset_affected+ - data_classification+ - timestamp+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-history+ name: Investigate Compliance Violation History+ type: investigate+ params:+ query: >+ compliance_violations user={{ alert.username }}+ control={{ alert.control_id }} last_days=90+ context_fields:+ - alert.username+ - alert.control_id+ - alert.violation_type+ timeout_seconds: 45+ on_failure: continue++ - id: check-severity-level+ name: Check Severity Requires CISO Notification+ type: condition+ condition:+ field: alert.data_classification+ operator: eq+ value: confidential+ next_true: notify-ciso+ next_false: notify-compliance-team++ - id: notify-ciso+ name: Notify CISO of Critical Compliance Violation+ type: notify+ params:+ channel: email+ to: "{{ env.CISO_EMAIL }}"+ subject: "ISO 27001 Violation: {{ alert.control_id }} — {{ alert.data_classification }} data"+ message: |+ A significant ISO 27001 control violation has been detected.++ Control: {{ alert.control_id }} — {{ alert.control_name }}+ User: {{ alert.username }} ({{ alert.department }})+ Asset: {{ alert.asset_affected }}+ Data Classification: {{ alert.data_classification }}+ Violation: {{ alert.violation_type }}+ Time: {{ alert.timestamp }}++ Compliance team has been notified. Corrective action required within 24 hours.+ timeout_seconds: 20+ on_failure: continue++ - id: notify-compliance-team+ name: Notify Compliance Team+ type: notify+ params:+ channel: "#compliance-alerts"+ message: |+ 📋 *ISO 27001 Control Violation*+ Control: `{{ alert.control_id }}` — {{ alert.control_name }}+ User: `{{ alert.username }}` ({{ alert.department }})+ Asset: `{{ alert.asset_affected }}`+ Violation: `{{ alert.violation_type }}`+ CISO notified: {{ steps.notify-ciso.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create ISO Violation Compliance Ticket+ type: create_ticket+ params:+ title: "ISO-27001: {{ alert.control_id }} violation by {{ alert.username }}"+ severity: P2+ assignee_group: compliance+ tags:+ - iso27001+ - compliance+ - corrective-action+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close ISO Violation Case+ type: close_case+ params:+ status: under-investigation+ resolution: "CISO/compliance notified; corrective action ticket created; audit evidence preserved."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/lateral-movement-response.yaml b/detections/playbooks/lateral-movement-response.yamlnew file mode 100644index 000000000..7012b251f--- /dev/null+++ b/detections/playbooks/lateral-movement-response.yaml@@ -0,0 +1,119 @@+id: lateral-movement-response-v1+name: Lateral Movement Response+description: >+ Responds to detected lateral movement activity including pass-the-hash,+ pass-the-ticket, remote service abuse, and admin share enumeration.+ Isolates affected hosts, revokes lateral credentials, and maps the blast radius.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - lateral-movement+ - endpoint+ - network+ - credential-abuse+ - active-directory++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - lateral-movement++steps:+ - id: enrich-lateral+ name: Enrich Lateral Movement Event+ type: enrich+ params:+ source: endpoint+ fields:+ - source_host+ - destination_host+ - technique+ - account_used+ - protocol+ - destination_port+ - network_path+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-spread+ name: Map Lateral Movement Blast Radius+ type: investigate+ params:+ query: >+ lateral_connections source={{ alert.source_host }}+ last_hours=6+ context_fields:+ - alert.source_host+ - alert.destination_host+ - alert.technique+ timeout_seconds: 60+ on_failure: continue++ - id: isolate-source+ name: Isolate Source Host+ type: isolate_host+ params:+ hostname: "{{ alert.source_host }}"+ reason: "Lateral movement detected — playbook {{ id }}"+ notify_user: true+ timeout_seconds: 60+ on_failure: continue+ retry_max: 2++ - id: check-destination-sensitive+ name: Check If Destination Is Sensitive+ type: condition+ condition:+ field: alert.destination_host+ operator: contains+ value: "dc"+ next_true: isolate-destination+ next_false: notify-security++ - id: isolate-destination+ name: Isolate Sensitive Destination Host+ type: isolate_host+ params:+ hostname: "{{ alert.destination_host }}"+ reason: "Lateral movement target — possible DC compromise — playbook {{ id }}"+ timeout_seconds: 60+ on_failure: continue++ - id: notify-security+ name: Notify Security Operations+ type: notify+ params:+ channel: "#ir-critical"+ message: |+ ↔️ *Lateral Movement Detected*+ Technique: `{{ alert.technique }}`+ Source: `{{ alert.source_host }}`+ Destination: `{{ alert.destination_host }}`+ Account: `{{ alert.account_used }}`+ Protocol: `{{ alert.protocol }}`+ Source isolated: {{ steps.isolate-source.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Lateral Movement Ticket+ type: create_ticket+ params:+ title: "LATERAL: {{ alert.technique }} from {{ alert.source_host }} to {{ alert.destination_host }}"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Lateral Movement Case+ type: close_case+ params:+ status: contained+ resolution: "Source isolated; blast radius mapped; IR ticket created."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/malware-detection-response.yaml b/detections/playbooks/malware-detection-response.yamlnew file mode 100644index 000000000..7474fb436--- /dev/null+++ b/detections/playbooks/malware-detection-response.yaml@@ -0,0 +1,134 @@+id: malware-detection-response-v1+name: Malware Detection Response+description: >+ Responds to malware detections across endpoints. Quarantines the malicious+ file, isolates the host if needed, runs deep scan, and notifies the IR team.+ Supports trojan, spyware, adware, worm, and backdoor classifications.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - malware+ - endpoint+ - edr+ - antivirus+ - containment++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - malware++steps:+ - id: enrich-malware+ name: Enrich Malware Detection+ type: enrich+ params:+ source: edr+ fields:+ - hostname+ - username+ - file_path+ - file_hash+ - malware_family+ - malware_type+ - detection_engine+ - quarantined+ - network_activity+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-hash+ name: Investigate File Hash Reputation+ type: investigate+ params:+ query: "file_reputation hash={{ alert.file_hash }}"+ context_fields:+ - alert.file_hash+ - alert.malware_family+ timeout_seconds: 45+ on_failure: continue++ - id: check-quarantine-status+ name: Check If File Already Quarantined+ type: condition+ condition:+ field: alert.quarantined+ operator: eq+ value: false+ next_true: quarantine-file+ next_false: check-network-activity++ - id: quarantine-file+ name: Quarantine Malicious File+ type: http+ params:+ method: POST+ url: "{{ env.EDR_API_URL }}/hosts/{{ alert.hostname }}/quarantine"+ body:+ file_path: "{{ alert.file_path }}"+ reason: "Malware detected — {{ alert.malware_family }}"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: check-network-activity+ name: Check Malware Network Activity+ type: condition+ condition:+ field: alert.network_activity+ operator: eq+ value: true+ next_true: isolate-host+ next_false: notify-security++ - id: isolate-host+ name: Isolate Host Due to Network Activity+ type: isolate_host+ params:+ reason: "Malware with active network C2 — playbook {{ id }}"+ notify_user: true+ timeout_seconds: 60+ on_failure: continue+ retry_max: 2++ - id: notify-security+ name: Notify IR Team+ type: notify+ params:+ channel: "#security-alerts"+ message: |+ 🦠 *Malware Detected*+ Host: `{{ alert.hostname }}`+ User: `{{ alert.username }}`+ Family: `{{ alert.malware_family }}`+ Type: `{{ alert.malware_type }}`+ File: `{{ alert.file_path }}`+ Hash: `{{ alert.file_hash }}`+ Quarantined: {{ steps.quarantine-file.status }}+ Isolated: {{ steps.isolate-host.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Malware Incident Ticket+ type: create_ticket+ params:+ title: "MALWARE: {{ alert.malware_family }} on {{ alert.hostname }}"+ severity: P2+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Malware Case+ type: close_case+ params:+ status: contained+ resolution: "File quarantined; host isolated if C2 active; IR ticket created."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/mfa-fatigue-response.yaml b/detections/playbooks/mfa-fatigue-response.yamlnew file mode 100644index 000000000..f778ef2a3--- /dev/null+++ b/detections/playbooks/mfa-fatigue-response.yaml@@ -0,0 +1,126 @@+id: mfa-fatigue-response-v1+name: MFA Fatigue Attack Response+description: >+ Responds to MFA push fatigue attacks where attackers spam authentication+ requests hoping the user accidentally approves. Detects rapid successive MFA+ prompts, temporarily blocks push notifications, and forces re-enrollment.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - mfa-fatigue+ - identity+ - authentication+ - push-bombing+ - account-takeover++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - mfa-fatigue++steps:+ - id: enrich-mfa+ name: Enrich MFA Fatigue Event+ type: enrich+ params:+ source: identity_provider+ fields:+ - username+ - phone_number+ - push_count+ - push_window_minutes+ - source_ips+ - device_enrolled+ - last_successful_mfa+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-source+ name: Investigate Attack Source IPs+ type: investigate+ params:+ query: "mfa_attempts user={{ alert.username }} last_hours=1"+ context_fields:+ - alert.username+ - alert.push_count+ - alert.source_ips+ timeout_seconds: 45+ on_failure: continue++ - id: check-push-rate+ name: Check Push Frequency+ type: condition+ condition:+ field: alert.push_count+ operator: gt+ value: 10+ next_true: disable-push-mfa+ next_false: notify-user-warning++ - id: disable-push-mfa+ name: Temporarily Disable Push MFA+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/mfa/push/disable"+ body:+ reason: "MFA fatigue attack — push bombing detected"+ duration_hours: 24+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: block-attacker-ips+ name: Block Attacking IPs at Perimeter+ type: block_ip+ params:+ ip_field: alert.source_ips+ direction: inbound+ duration_hours: 48+ comment: "MFA fatigue attack IPs — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-user-warning+ name: Notify User of MFA Fatigue Attack+ type: notify+ params:+ channel: email+ to: "{{ alert.email }}"+ subject: "SECURITY ALERT: Do not approve unexpected MFA requests"+ message: |+ IMPORTANT: Someone is attempting to access your account.++ We have detected {{ alert.push_count }} MFA push requests in the last+ {{ alert.push_window_minutes }} minutes directed at your account.++ DO NOT approve any MFA requests you did not initiate.++ Push MFA has been temporarily disabled as a precaution.+ Contact security immediately: [email protected]+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create MFA Fatigue Ticket+ type: create_ticket+ params:+ title: "MFA-FATIGUE: {{ alert.username }} — {{ alert.push_count }} pushes in {{ alert.push_window_minutes }}min"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close MFA Fatigue Case+ type: close_case+ params:+ status: contained+ resolution: "Push MFA disabled; attacker IPs blocked; user notified; IR investigating."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/oauth-abuse-response.yaml b/detections/playbooks/oauth-abuse-response.yamlnew file mode 100644index 000000000..9d0cde3fe--- /dev/null+++ b/detections/playbooks/oauth-abuse-response.yaml@@ -0,0 +1,124 @@+id: oauth-abuse-response-v1+name: OAuth Application Abuse Response+description: >+ Responds to OAuth application abuse including consent phishing, malicious+ app grants, and unauthorized OAuth token usage. Revokes malicious app access,+ audits all consented apps, and notifies affected users.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - oauth+ - identity+ - saas+ - consent-phishing+ - app-abuse++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - oauth-abuse++steps:+ - id: enrich-oauth+ name: Enrich OAuth Application Event+ type: enrich+ params:+ source: identity_provider+ fields:+ - username+ - app_id+ - app_name+ - app_publisher+ - permissions_granted+ - grant_time+ - data_accessed+ - tenant_id+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-app+ name: Investigate OAuth App Reputation+ type: investigate+ params:+ query: "oauth_app_reputation app_id={{ alert.app_id }} publisher={{ alert.app_publisher }}"+ context_fields:+ - alert.app_id+ - alert.app_name+ - alert.permissions_granted+ timeout_seconds: 45+ on_failure: continue++ - id: check-permissions+ name: Check Dangerous Permissions+ type: condition+ condition:+ field: alert.permissions_granted+ operator: contains+ value: "Mail.ReadWrite"+ next_true: revoke-app-tenant-wide+ next_false: revoke-user-consent++ - id: revoke-app-tenant-wide+ name: Revoke OAuth App Tenant-Wide+ type: http+ params:+ method: DELETE+ url: "{{ env.IDP_API_URL }}/tenants/{{ alert.tenant_id }}/apps/{{ alert.app_id }}/consent"+ body:+ reason: "Malicious OAuth app — dangerous permissions — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: revoke-user-consent+ name: Revoke User OAuth Consent+ type: http+ params:+ method: DELETE+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/apps/{{ alert.app_id }}/consent"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-user+ name: Notify Affected User+ type: notify+ params:+ channel: email+ to: "{{ alert.email }}"+ subject: "Security Alert: Unauthorized app access revoked on your account"+ message: |+ An unauthorized application has been detected on your account.++ App: {{ alert.app_name }} ({{ alert.app_publisher }})+ Permissions: {{ alert.permissions_granted }}+ Granted: {{ alert.grant_time }}++ Access has been revoked. Review your connected apps at your account settings.+ Contact security if you have questions: [email protected]+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create OAuth Abuse Ticket+ type: create_ticket+ params:+ title: "OAUTH-ABUSE: {{ alert.app_name }} — {{ alert.username }}"+ severity: P2+ assignee_group: security-ops+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close OAuth Abuse Case+ type: close_case+ params:+ status: remediated+ resolution: "App consent revoked; user notified; app reputation added to blocklist."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/phishing-response.yaml b/detections/playbooks/phishing-response.yamlnew file mode 100644index 000000000..b073fc6ad--- /dev/null+++ b/detections/playbooks/phishing-response.yaml@@ -0,0 +1,118 @@+id: phishing-response-v1+name: Phishing Email Response+description: >+ Responds to confirmed or suspected phishing emails. Quarantines the message+ across the tenant, extracts and blocks malicious URLs and sender domains,+ identifies other recipients, and triggers user awareness notifications.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - phishing+ - identity+ - containment++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - phishing++steps:+ - id: enrich-email+ name: Enrich Email Metadata+ type: enrich+ params:+ source: email_gateway+ fields:+ - sender+ - sender_domain+ - subject+ - recipients+ - urls+ - attachments+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-sender+ name: Investigate Sender Reputation+ type: investigate+ params:+ query: "ip_reputation sender={{ alert.sender_domain }}"+ context_fields:+ - alert.sender+ - alert.sender_domain+ timeout_seconds: 45+ on_failure: continue++ - id: block-sender+ name: Block Malicious Sender Domain+ type: block_ip+ params:+ ip_field: alert.sender_domain+ block_type: domain+ direction: inbound+ duration_hours: 168+ comment: "Phishing sender block — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: check-urls+ name: Check URL Count+ type: condition+ condition:+ field: alert.url_count+ operator: gt+ value: 0+ next_true: block-urls+ next_false: notify-team++ - id: block-urls+ name: Block Malicious URLs at Proxy+ type: http+ params:+ method: POST+ url: "{{ env.PROXY_API_URL }}/block"+ body:+ urls: "{{ alert.urls }}"+ category: phishing+ duration_hours: 168+ timeout_seconds: 30+ on_failure: continue++ - id: notify-team+ name: Notify Security Team+ type: notify+ params:+ channel: "#security-alerts"+ message: |+ 🎣 *Phishing Alert*+ Sender: `{{ alert.sender }}`+ Subject: `{{ alert.subject }}`+ Recipients: {{ alert.recipient_count }}+ URLs blocked: {{ alert.url_count }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Phishing Ticket+ type: create_ticket+ params:+ title: "PHISHING: {{ alert.sender }} — {{ alert.subject }}"+ severity: P2+ assignee_group: security-ops+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Phishing Case+ type: close_case+ params:+ status: remediated+ resolution: "Sender blocked; URLs blocked; recipients notified."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/privilege-escalation-response.yaml b/detections/playbooks/privilege-escalation-response.yamlnew file mode 100644index 000000000..370bbeced--- /dev/null+++ b/detections/playbooks/privilege-escalation-response.yaml@@ -0,0 +1,121 @@+id: privilege-escalation-response-v1+name: Privilege Escalation Response+description: >+ Responds to detected privilege escalation attempts including sudo abuse,+ SUID/SGID exploitation, token impersonation, or role assignment anomalies.+ Revokes elevated privileges, isolates the session, and logs forensic evidence.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - privilege-escalation+ - endpoint+ - linux+ - windows+ - iam++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - privesc++steps:+ - id: enrich-session+ name: Enrich Privileged Session+ type: enrich+ params:+ source: endpoint+ fields:+ - username+ - hostname+ - process_name+ - parent_process+ - escalation_method+ - elevated_to+ - command_line+ - file_path+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-user+ name: Investigate User Privilege History+ type: investigate+ params:+ query: >+ privilege_events user={{ alert.username }}+ host={{ alert.hostname }} last_hours=24+ context_fields:+ - alert.username+ - alert.escalation_method+ timeout_seconds: 45+ on_failure: continue++ - id: check-critical-host+ name: Check If Critical Host+ type: condition+ condition:+ field: alert.hostname+ operator: contains+ value: "-prod-"+ next_true: isolate-host+ next_false: revoke-privilege++ - id: isolate-host+ name: Isolate Production Host+ type: isolate_host+ params:+ reason: "Privilege escalation on production host — playbook {{ id }}"+ notify_user: false+ timeout_seconds: 60+ on_failure: abort+ retry_max: 2++ - id: revoke-privilege+ name: Revoke Escalated Privileges+ type: http+ params:+ method: POST+ url: "{{ env.IAM_API_URL }}/users/{{ alert.username }}/revoke-elevated"+ body:+ host: "{{ alert.hostname }}"+ reason: "Detected privilege escalation"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-security+ name: Notify Security Operations+ type: notify+ params:+ channel: "#security-alerts"+ message: |+ ⬆️ *Privilege Escalation Detected*+ User: `{{ alert.username }}`+ Host: `{{ alert.hostname }}`+ Method: `{{ alert.escalation_method }}`+ Escalated To: `{{ alert.elevated_to }}`+ Process: `{{ alert.process_name }}`+ Host isolated: {{ steps.isolate-host.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Privilege Escalation Ticket+ type: create_ticket+ params:+ title: "PRIVESC: {{ alert.username }} via {{ alert.escalation_method }} on {{ alert.hostname }}"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Privilege Escalation Case+ type: close_case+ params:+ status: contained+ resolution: "Elevated privileges revoked; host isolated if production; IR investigating."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/ransomware-containment.yaml b/detections/playbooks/ransomware-containment.yamlnew file mode 100644index 000000000..20fffff95--- /dev/null+++ b/detections/playbooks/ransomware-containment.yaml@@ -0,0 +1,106 @@+id: ransomware-containment-v1+name: Ransomware Containment & Eradication+description: >+ Automated containment and eradication playbook for ransomware incidents.+ Isolates affected hosts, blocks C2 IPs, snapshots disk state for forensics,+ and notifies the security team with remediation steps.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - ransomware+ - malware+ - containment+ - endpoint+ - high-severity++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - ransomware++steps:+ - id: enrich-host+ name: Enrich Affected Host+ type: enrich+ params:+ source: endpoint+ fields:+ - hostname+ - os+ - last_user+ - network_connections+ timeout_seconds: 30+ on_failure: continue++ - id: check-severity+ name: Check Alert Severity+ type: condition+ condition:+ field: alert.severity+ operator: eq+ value: critical+ next_true: isolate-immediately+ next_false: notify-analyst++ - id: isolate-immediately+ name: Isolate Host from Network+ type: isolate_host+ params:+ reason: "Ransomware detected — automated isolation"+ notify_user: true+ timeout_seconds: 60+ on_failure: abort+ retry_max: 2++ - id: block-c2+ name: Block C2 IPs at Perimeter+ type: block_ip+ params:+ ip_field: alert.external_ips+ direction: both+ duration_hours: 72+ comment: "Ransomware C2 block — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: create-ticket+ name: Create Incident Ticket+ type: create_ticket+ params:+ title: "RANSOMWARE: {{ alert.hostname }} — {{ alert.created_at }}"+ severity: P1+ assignee_group: ir-team+ description: |+ Ransomware alert triggered on {{ alert.hostname }}.+ Alert ID: {{ alert.id }}+ User: {{ alert.last_user }}+ Isolation status: {{ steps.isolate-immediately.status }}+ timeout_seconds: 30+ on_failure: continue++ - id: notify-analyst+ name: Notify IR Team via Slack+ type: notify+ params:+ channel: "#ir-critical"+ message: |+ 🚨 *Ransomware Detected*+ Host: `{{ alert.hostname }}`+ Severity: `{{ alert.severity }}`+ Ticket: {{ steps.create-ticket.ticket_url }}+ Isolation: {{ steps.isolate-immediately.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: close-case+ name: Mark Case Contained+ type: close_case+ params:+ status: contained+ resolution: "Host isolated; C2 blocked; IR ticket created."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/s3-bucket-exposure-response.yaml b/detections/playbooks/s3-bucket-exposure-response.yamlnew file mode 100644index 000000000..f5d59628d--- /dev/null+++ b/detections/playbooks/s3-bucket-exposure-response.yaml@@ -0,0 +1,132 @@+id: s3-bucket-exposure-response-v1+name: S3 Bucket Exposure Response+description: >+ Responds to S3 bucket misconfigurations including public access enablement,+ ACL changes granting anonymous access, and unexpected data exfiltration from+ buckets. Remediates public access, audits bucket policy, and notifies cloud security.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - s3+ - cloud+ - aws+ - misconfiguration+ - data-exposure++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - s3-exposure++steps:+ - id: enrich-bucket+ name: Enrich S3 Bucket Configuration+ type: enrich+ params:+ source: cloud_iam+ fields:+ - bucket_name+ - account_id+ - region+ - public_access_block+ - acl+ - bucket_policy+ - encryption_enabled+ - versioning_enabled+ - data_classification+ - estimated_size_gb+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-access+ name: Investigate Bucket Access Logs+ type: investigate+ params:+ query: "s3_access bucket={{ alert.bucket_name }} requester=anonymous last_hours=24"+ context_fields:+ - alert.bucket_name+ - alert.acl+ timeout_seconds: 60+ on_failure: continue++ - id: check-public-access+ name: Check If Bucket Is Publicly Accessible+ type: condition+ condition:+ field: alert.public_access_block+ operator: eq+ value: false+ next_true: block-public-access+ next_false: audit-bucket-policy++ - id: block-public-access+ name: Enable S3 Public Access Block+ type: http+ params:+ method: PUT+ url: "{{ env.AWS_S3_API_URL }}/{{ alert.bucket_name }}/public-access-block"+ body:+ BlockPublicAcls: true+ IgnorePublicAcls: true+ BlockPublicPolicy: true+ RestrictPublicBuckets: true+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: audit-bucket-policy+ name: Request Bucket Policy Audit+ type: http+ params:+ method: POST+ url: "{{ env.CLOUD_SECURITY_API_URL }}/audit/s3"+ body:+ bucket: "{{ alert.bucket_name }}"+ account: "{{ alert.account_id }}"+ check_types:+ - policy+ - acl+ - encryption+ - logging+ timeout_seconds: 30+ on_failure: continue++ - id: notify-cloud-security+ name: Notify Cloud Security Team+ type: notify+ params:+ channel: "#cloud-security"+ message: |+ 🪣 *S3 Bucket Exposure Detected*+ Bucket: `{{ alert.bucket_name }}`+ Account: `{{ alert.account_id }}`+ Region: `{{ alert.region }}`+ Classification: `{{ alert.data_classification }}`+ Size: {{ alert.estimated_size_gb }}GB+ Public access blocked: {{ steps.block-public-access.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create S3 Exposure Ticket+ type: create_ticket+ params:+ title: "S3-EXPOSURE: {{ alert.bucket_name }} in {{ alert.account_id }}"+ severity: P1+ assignee_group: cloud-security+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close S3 Exposure Case+ type: close_case+ params:+ status: remediated+ resolution: "Public access blocked; bucket policy audited; cloud security notified."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/supply-chain-compromise.yaml b/detections/playbooks/supply-chain-compromise.yamlnew file mode 100644index 000000000..65ec118b2--- /dev/null+++ b/detections/playbooks/supply-chain-compromise.yaml@@ -0,0 +1,112 @@+id: supply-chain-compromise-v1+name: Supply Chain Compromise Response+description: >+ Responds to suspected supply chain attacks including malicious package+ updates, compromised third-party libraries, or tampered build artifacts.+ Quarantines affected builds, notifies DevSecOps, and triggers a software+ inventory audit.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - supply-chain+ - devops+ - sca+ - build-security+ - oss++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - supply-chain++steps:+ - id: enrich-package+ name: Enrich Affected Package+ type: enrich+ params:+ source: sca_scanner+ fields:+ - package_name+ - package_version+ - ecosystem+ - cve_ids+ - affected_repos+ - build_jobs+ - pipeline_id+ - checksum_mismatch+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-package+ name: Investigate Package Provenance+ type: investigate+ params:+ query: >+ package_usage package={{ alert.package_name }}+ version={{ alert.package_version }}+ context_fields:+ - alert.package_name+ - alert.package_version+ - alert.cve_ids+ timeout_seconds: 60+ on_failure: continue++ - id: check-checksum+ name: Check Checksum Mismatch+ type: condition+ condition:+ field: alert.checksum_mismatch+ operator: eq+ value: true+ next_true: halt-pipelines+ next_false: notify-devsecops++ - id: halt-pipelines+ name: Halt Affected CI/CD Pipelines+ type: http+ params:+ method: POST+ url: "{{ env.CI_API_URL }}/pipelines/{{ alert.pipeline_id }}/cancel"+ body:+ reason: "Supply chain compromise — checksum mismatch — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-devsecops+ name: Notify DevSecOps Team+ type: notify+ params:+ channel: "#devsecops-alerts"+ message: |+ 📦 *Supply Chain Compromise Detected*+ Package: `{{ alert.package_name }}@{{ alert.package_version }}`+ Ecosystem: `{{ alert.ecosystem }}`+ CVEs: {{ alert.cve_ids }}+ Affected Repos: {{ alert.affected_repos }}+ Checksum mismatch: {{ alert.checksum_mismatch }}+ Pipeline halted: {{ steps.halt-pipelines.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Supply Chain Incident Ticket+ type: create_ticket+ params:+ title: "SUPPLY-CHAIN: {{ alert.package_name }}@{{ alert.package_version }} — {{ alert.ecosystem }}"+ severity: P1+ assignee_group: devsecops+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Supply Chain Case+ type: close_case+ params:+ status: under-investigation+ resolution: "Pipelines halted; DevSecOps notified; package audit in progress."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/suspicious-signin-response.yaml b/detections/playbooks/suspicious-signin-response.yamlnew file mode 100644index 000000000..9157cf46e--- /dev/null+++ b/detections/playbooks/suspicious-signin-response.yaml@@ -0,0 +1,129 @@+id: suspicious-signin-response-v1+name: Suspicious Sign-In Response+description: >+ Responds to suspicious sign-in events including impossible travel, new country+ logins, known bad IP addresses, or sign-ins outside business hours. Triggers+ step-up authentication or session termination based on risk score.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - sign-in+ - identity+ - authentication+ - impossible-travel+ - conditional-access++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - suspicious-signin++steps:+ - id: enrich-signin+ name: Enrich Sign-In Event+ type: enrich+ params:+ source: identity_provider+ fields:+ - username+ - source_ip+ - country+ - city+ - previous_country+ - previous_login_time+ - device_id+ - device_trust+ - risk_score+ - login_time+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-ip+ name: Investigate Source IP Reputation+ type: investigate+ params:+ query: "ip_reputation ip={{ alert.source_ip }} threat_categories=true"+ context_fields:+ - alert.source_ip+ - alert.country+ timeout_seconds: 45+ on_failure: continue++ - id: check-risk-score+ name: Check Risk Score Threshold+ type: condition+ condition:+ field: alert.risk_score+ operator: gt+ value: 70+ next_true: revoke-session+ next_false: require-mfa++ - id: revoke-session+ name: Revoke High-Risk Sign-In Session+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/revoke-sessions"+ body:+ session_id: "{{ alert.session_id }}"+ reason: "Suspicious sign-in — high risk score"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: require-mfa+ name: Require Step-Up MFA Challenge+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/require-mfa"+ body:+ session_id: "{{ alert.session_id }}"+ challenge_type: totp+ timeout_seconds: 30+ on_failure: continue++ - id: notify-user+ name: Notify User of Suspicious Sign-In+ type: notify+ params:+ channel: email+ to: "{{ alert.email }}"+ subject: "Security Alert: Suspicious sign-in to your account"+ message: |+ We detected a suspicious sign-in to your account.++ Location: {{ alert.city }}, {{ alert.country }}+ IP: {{ alert.source_ip }}+ Time: {{ alert.login_time }}++ If this was you, no action is needed.+ If not, contact security immediately: [email protected]+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Suspicious Sign-In Ticket+ type: create_ticket+ params:+ title: "SUSPICIOUS-LOGIN: {{ alert.username }} from {{ alert.country }} ({{ alert.source_ip }})"+ severity: P2+ assignee_group: security-ops+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Suspicious Sign-In Case+ type: close_case+ params:+ status: remediated+ resolution: "Session revoked or MFA required; user notified; ticket created."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/token-theft-response.yaml b/detections/playbooks/token-theft-response.yamlnew file mode 100644index 000000000..c6a2dea36--- /dev/null+++ b/detections/playbooks/token-theft-response.yaml@@ -0,0 +1,124 @@+id: token-theft-response-v1+name: Authentication Token Theft Response+description: >+ Responds to stolen authentication token usage including JWT hijacking,+ session cookie theft, and bearer token replay attacks. Revokes tokens,+ forces re-authentication, and checks for downstream unauthorized access.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - token-theft+ - identity+ - jwt+ - session-hijacking+ - authentication++trigger:+ on: alert+ severity:+ - high+ - critical+ tags:+ - token-theft++steps:+ - id: enrich-token+ name: Enrich Token Usage Event+ type: enrich+ params:+ source: identity_provider+ fields:+ - username+ - token_type+ - token_id+ - original_ip+ - replay_ip+ - user_agent+ - endpoints_accessed+ - data_accessed+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-replay+ name: Investigate Token Replay Activity+ type: investigate+ params:+ query: "token_usage token_id={{ alert.token_id }} anomalous=true"+ context_fields:+ - alert.token_id+ - alert.replay_ip+ - alert.endpoints_accessed+ timeout_seconds: 45+ on_failure: continue++ - id: revoke-token+ name: Immediately Revoke Stolen Token+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/tokens/{{ alert.token_id }}/revoke"+ body:+ reason: "Token theft detected — replay from different IP"+ timeout_seconds: 30+ on_failure: abort+ retry_max: 2++ - id: revoke-all-sessions+ name: Revoke All User Sessions+ type: http+ params:+ method: POST+ url: "{{ env.IDP_API_URL }}/users/{{ alert.username }}/revoke-sessions"+ body:+ reason: "Token theft — full session revocation"+ timeout_seconds: 30+ on_failure: continue++ - id: block-attacker-ip+ name: Block Token Replay Source IP+ type: block_ip+ params:+ ip_field: alert.replay_ip+ direction: inbound+ duration_hours: 48+ comment: "Token theft replay IP — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue++ - id: notify-user+ name: Notify Affected User+ type: notify+ params:+ channel: email+ to: "{{ alert.email }}"+ subject: "Security Alert: Your authentication token was used from an unexpected location"+ message: |+ A stolen authentication token was detected being used from {{ alert.replay_ip }}.++ Your {{ alert.token_type }} token has been revoked and all sessions terminated.+ Please sign in again and contact security if you did not authorize this access.++ Security contact: [email protected]+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Token Theft Ticket+ type: create_ticket+ params:+ title: "TOKEN-THEFT: {{ alert.username }} — {{ alert.token_type }} replayed from {{ alert.replay_ip }}"+ severity: P1+ assignee_group: ir-team+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Token Theft Case+ type: close_case+ params:+ status: contained+ resolution: "Token revoked; all sessions terminated; replay IP blocked; user notified."+ timeout_seconds: 15+ on_failure: continuediff --git a/detections/playbooks/web-application-attack.yaml b/detections/playbooks/web-application-attack.yamlnew file mode 100644index 000000000..c61107985--- /dev/null+++ b/detections/playbooks/web-application-attack.yaml@@ -0,0 +1,123 @@+id: web-application-attack-v1+name: Web Application Attack Response+description: >+ Responds to web application attacks including SQL injection, XSS, RCE,+ and directory traversal. Blocks attacking IPs, captures forensic evidence,+ checks for data exfiltration, and notifies the AppSec team.+version: "1.0.0"+author: Beenu - [email protected]+enabled: true+tags:+ - web+ - appsec+ - waf+ - sqli+ - xss+ - rce++trigger:+ on: alert+ severity:+ - medium+ - high+ - critical+ tags:+ - web-attack++steps:+ - id: enrich-request+ name: Enrich Attack Request+ type: enrich+ params:+ source: waf+ fields:+ - source_ip+ - user_agent+ - target_url+ - method+ - payload+ - attack_type+ - response_code+ - bytes_transferred+ timeout_seconds: 30+ on_failure: continue++ - id: investigate-ip+ name: Investigate Source IP History+ type: investigate+ params:+ query: "ip_activity ip={{ alert.source_ip }} last_hours=24"+ context_fields:+ - alert.source_ip+ - alert.attack_type+ timeout_seconds: 45+ on_failure: continue++ - id: check-exfil+ name: Check for Data Exfiltration+ type: condition+ condition:+ field: alert.bytes_transferred+ operator: gt+ value: 10000+ next_true: notify-critical+ next_false: block-ip++ - id: notify-critical+ name: Notify Security — Possible Exfiltration+ type: notify+ params:+ channel: "#ir-critical"+ message: |+ ⚠️ *Web Attack with Possible Data Exfiltration*+ Attack Type: `{{ alert.attack_type }}`+ Source IP: `{{ alert.source_ip }}`+ Target: `{{ alert.target_url }}`+ Data transferred: {{ alert.bytes_transferred }} bytes+ timeout_seconds: 20+ on_failure: continue++ - id: block-ip+ name: Block Attacking IP at WAF/Firewall+ type: block_ip+ params:+ ip_field: alert.source_ip+ direction: inbound+ duration_hours: 48+ comment: "Web attack — {{ alert.attack_type }} — playbook {{ id }}"+ timeout_seconds: 30+ on_failure: continue+ retry_max: 2++ - id: notify-appsec+ name: Notify AppSec Team+ type: notify+ params:+ channel: "#appsec-alerts"+ message: |+ 🌐 *Web Application Attack Detected*+ Type: `{{ alert.attack_type }}`+ Source: `{{ alert.source_ip }}`+ Target: `{{ alert.target_url }}`+ IP Blocked: {{ steps.block-ip.status }}+ timeout_seconds: 20+ on_failure: continue++ - id: create-ticket+ name: Create Web Attack Ticket+ type: create_ticket+ params:+ title: "WEB-ATTACK: {{ alert.attack_type }} from {{ alert.source_ip }}"+ severity: P2+ assignee_group: appsec+ timeout_seconds: 30+ on_failure: continue++ - id: close-case+ name: Close Web Attack Case+ type: close_case+ params:+ status: remediated+ resolution: "Attacking IP blocked; AppSec notified; evidence captured."+ timeout_seconds: 15+ on_failure: continuediff --git a/docker-compose.airgap.yml b/docker-compose.airgap.ymlnew file mode 100644index 000000000..fb1688bb4--- /dev/null+++ b/docker-compose.airgap.yml@@ -0,0 +1,87 @@+###############################################################################+# AiSOC — Air-gapped / Local-LLM overlay+#+# Extends docker-compose.demo.yml to run entirely without external LLM calls.+# Adds an Ollama service with a pinned model and sets AISOC_AIRGAPPED=true on+# every service that calls an LLM.+#+# Pinned model: llama3.2:3b-instruct-q4_K_M+# — ~2 GB on disk, fits in 6 GB VRAM (or CPU-only with 8 GB RAM).+# — Swap for a larger model by setting AIRGAP_LLM_MODEL= in your env.+#+# Usage (air-gapped demo):+# docker compose \+# -f docker-compose.demo.yml \+# -f docker-compose.airgap.yml \+# up -d+#+# The init container below will pull the model automatically on first boot.+# Subsequent starts use the cached layer in the `ollama_data` volume.+###############################################################################++networks:+ aisoc-demo:+ driver: bridge++volumes:+ ollama_data: {}++services:++ # ─── Local LLM (Ollama) ─────────────────────────────────────────────────────++ ollama:+ image: ollama/ollama:0.6.7+ container_name: aisoc-airgap-ollama+ volumes:+ - ollama_data:/root/.ollama+ ports:+ - "127.0.0.1:11434:11434"+ networks:+ - aisoc-demo+ restart: unless-stopped+ healthcheck:+ test: ["CMD-SHELL", "curl -sf http://localhost:11434/api/tags || exit 1"]+ interval: 10s+ timeout: 5s+ retries: 12+ start_period: 30s++ # Pull the pinned model once (no-op on cache hit)+ ollama-pull:+ image: ollama/ollama:0.6.7+ container_name: aisoc-airgap-ollama-pull+ depends_on:+ ollama:+ condition: service_healthy+ entrypoint: ["ollama", "pull", "${AIRGAP_LLM_MODEL:-llama3.2:3b-instruct-q4_K_M}"]+ environment:+ OLLAMA_HOST: http://ollama:11434+ volumes:+ - ollama_data:/root/.ollama+ networks:+ - aisoc-demo+ restart: "no"++ # ─── Override: agents ────────────────────────────────────────────────────────+ #+ # Switches the agents service to local-only mode. External LLM calls are+ # blocked by the AISOC_AIRGAPPED guard in llm_resolver.py; the investigation+ # orchestrator falls back to its deterministic synthesizer when no outbound+ # call is allowed, which means the demo seed completes without touching the+ # internet.++ agents:+ depends_on:+ ollama:+ condition: service_healthy+ ollama-pull:+ condition: service_completed_successfully+ environment:+ AISOC_AIRGAPPED: "true"+ LLM_BASE_URL: "http://ollama:11434/v1"+ LLM_API_KEY: "ollama" # Ollama ignores the key; the client requires it+ LLM_MODEL: "${AIRGAP_LLM_MODEL:-llama3.2:3b-instruct-q4_K_M}"+ # Clear external keys so no stray outbound calls can be made+ OPENAI_API_KEY: ""+ ANTHROPIC_API_KEY: ""diff --git a/docs/threat-actor-attribution.md b/docs/threat-actor-attribution.mdnew file mode 100644index 000000000..8819eee7f--- /dev/null+++ b/docs/threat-actor-attribution.md@@ -0,0 +1,216 @@+# Threat Actor Attribution Engine++> **Status:** v0. Ships with a hardcoded catalog of three public actor+> profiles (APT28, APT29, Lazarus). Suitable as a foundation; not yet a+> replacement for analyst judgement.++## Overview++The Threat Actor Attribution Engine scores observed indicators (IOCs),+MITRE ATT&CK techniques, used tools, and target sectors against a small+in-memory catalog of well-documented threat actors and returns the best+match above a configurable confidence threshold.++It is reachable two ways:++1. Directly via the `threatintel` service HTTP API.+2. Automatically from the LangGraph investigation pipeline (the agent+ calls the API during the investigation node and records the result on+ the investigation state).++## Scoring model++The score for each candidate actor is the weighted sum of four+components, multiplied by the actor's baseline profile-confidence:++| Component | Weight | What it measures |+| --------- | -----: | --------------------------------------------------------------------------- |+| TTP | 0.40 | Overlap between observed and known MITRE ATT&CK techniques |+| Tool | 0.30 | Boundary-aware matches of known tool names against IOC values/desc/tags |+| Target | 0.20 | Overlap between observed and known target sectors |+| IOC | 0.10 | Exact value matches against the `threatintel-iocs` index |++The default confidence threshold is `0.30`. Below it, the engine returns+`actor_id="unknown"` and an empty match list. The threshold is tunable+per environment via `AISOC_ATTRIBUTION_THRESHOLD` (clamped to `[0.0, 1.0]`;+invalid values fall back to the default and emit a warning log).++### Tool matching++Tool matching uses an alphanumeric-only boundary regex+(`(?<![a-zA-Z0-9])tool(?![a-zA-Z0-9])`) rather than Python's `\b`. This+matters because Python's `\b` treats `_` as a word character, which+breaks common malware-filename patterns like `miniduke_v3.dll`. The+boundary used here treats hyphens, underscores, periods, and slashes as+delimiters, while still rejecting alphanumeric neighbours (so the tool+`x-agent` does **not** match `x-agentic`). The engine searches the IOC's+`value`, `description`, and `tags` fields when present.++### IOC component is conditional++The IOC component contributes **0** unless the engine is constructed with+an OpenSearch store (`os_store`). Production startup wires the+`os_store` shared with the threat-intel feed pipeline, so the IOC+component activates whenever there are collected IOCs in the+`threatintel-iocs` index. In unit tests and local runs without+OpenSearch the score is honest about this — the reasoning list will+contain the line:++```+IOC component unavailable: no os_store wired (TTP/tool/target only)+```++There is **no** synthetic "every observed IOC counts as a match" inflation.++## API++Mounted under `/api/v1/actors` on the `threatintel` service (default+port `8083`).++### `POST /api/v1/actors/attribute`++Body:++```json+{+ "iocs": [+ { "value": "x-agent-malware.exe", "type": "filename" }+ ],+ "mitre_techniques": ["T1566", "T1059", "T1071"],+ "case_metadata": {+ "targets": ["government", "military"],+ "industry": "defense",+ "geography": "US"+ }+}+```++Response (`AttributionResult`):++```json+{+ "actor_id": "APT28",+ "actor_name": "APT28 (Fancy Bear)",+ "confidence_score": 0.4958,+ "matched_indicators": ["T1059", "T1071", "T1566", "x-agent", "government", "military"],+ "reasoning": [+ "Matched 3/4 TTPs: T1059, T1071, T1566",+ "Matched tools: x-agent",+ "Matched target sectors: government, military",+ "IOC component unavailable: no os_store wired (TTP/tool/target only)"+ ],+ "timestamp": "2026-05-09T22:14:44Z"+}+```++If no actor exceeds the confidence threshold:++```json+{+ "actor_id": "unknown",+ "actor_name": "Unknown Actor",+ "confidence_score": 0.0,+ "matched_indicators": [],+ "reasoning": ["No actor exceeded confidence threshold of 0.3"],+ "timestamp": "2026-05-09T22:14:44Z"+}+```++### `GET /api/v1/actors/profiles`++Lists all profiles in the in-memory catalog.++### `GET /api/v1/actors/profiles/{actor_id}`++Returns a single profile, or `404` if the ID is unknown.++> **Auth caveat (v0):** the attribution endpoints are mounted on the+> `threatintel` service without RBAC enforcement. They are reachable+> only inside the cluster's service mesh / private network. Do **not**+> expose them through a public ingress until a RBAC dependency is added.+> Tracked in [#TODO-attribution-rbac].++## Observability++The engine exports two Prometheus series scraped from the standard+`/metrics` endpoint:++- `threatintel_attribution_requests_total{result="matched|unknown|error"}`+ — counter of attribution attempts.+- `threatintel_attribution_score{actor_id="..."}` — histogram of the+ best-actor score per request, labelled by attributed actor.++## Integration with the investigation agent++`services/agents/app/agents/investigation_agent.py` calls the API once+per investigation, after triage and enrichment have populated+`state.ioc_enrichments` and `state.mitre_mappings`. The result is stored+on `state.threat_intel["attribution"]` and surfaced in the findings+list. Failure is soft — a finding is added and the investigation+continues.++The agent uses `state.raw_alert` for `targets`, `industry`, `geography`,+and `severity`. To enrich attribution, populate those fields on the+incoming alert.++The HTTP timeout is tunable via `AISOC_ATTRIBUTION_TIMEOUT_SECONDS`+(default `10`), and the `threatintel` base URL via `AISOC_THREATINTEL_URL`+(default `http://threatintel:8083`).++## v0 limits and intended next steps++This is the first cut. Calling these out so reviewers and operators+don't read more into it than is there:++- **Hardcoded catalog.** Three profiles (APT28, APT29, Lazarus) seeded+ from public MITRE ATT&CK Groups data. The next iteration should load+ profiles from STIX/TAXII or a curated YAML/JSON corpus committed to+ the repo.+- **Tool match is boundary-regex.** Better than naive substring (so+ `cosmicduke` no longer matches `xcosmicduke`), and handles+ `miniduke_v3.dll` correctly, but it is still keyword-driven and will+ false-positive on benign artefacts that legitimately contain known+ tool names. A real implementation should use precise matching against+ malware-family signatures or YARA rules.+- **IOC match is exact-value only.** No fuzzy hashing, no domain+ hierarchy expansion, no IP CIDR matching.+- **No temporal weighting.** Recency of an actor's last-seen activity+ doesn't affect the score yet.+- **Score weights are constants.** They live at the top of+ `attribution.py` and have not been tuned against a labeled corpus.++## Adding a custom actor profile++Edit `services/threatintel/app/actors/attribution.py` and append to+`_seed_actor_catalog()`:++```python+"CUSTOM_ACTOR": ThreatActorProfile(+ id="CUSTOM_ACTOR",+ name="Custom Threat Actor",+ aliases=["CustomAlias"],+ description="Organization-specific threat actor",+ sophistication_level="intermediate",+ primary_motivation="espionage",+ secondary_motivations=["financial gain"],+ ttps=["T1566", "T1071"],+ tools=["custom-malware"],+ targets=["organization-sector"],+ confidence_score=0.75,+),+```++Or, at runtime, call `engine.update_actor_profile(profile)` from a+custom startup hook. A `PUT /profiles/{actor_id}` endpoint is not yet+implemented — file an issue if you need it.++## Tests++`services/threatintel/tests/test_actor_attribution.py` exercises the+engine end to end with no network. Run with:++```bash+cd services/threatintel+poetry install+poetry run pytest tests/test_actor_attribution.py -v+```diff --git a/playbooks/packs/v1/anomalous-data/anomalous-data-transfer-response.playbook.json b/playbooks/packs/v1/anomalous-data/anomalous-data-transfer-response.playbook.jsonnew file mode 100644index 000000000..6930fd955--- /dev/null+++ b/playbooks/packs/v1/anomalous-data/anomalous-data-transfer-response.playbook.json@@ -0,0 +1,208 @@+{+ "id": "anomalous-data-transfer-response-v1",+ "name": "Anomalous Data Transfer: DLP / Exfiltration Response",+ "description": "Triggered by a DLP or UEBA alert detecting an anomalously large or out-of-policy data transfer, potential exfiltration to external destination, or sensitive data leaving the organization. Correlates evidence, blocks destination if malicious, and disables the user if compromise is confirmed.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "data-exfiltration",+ "dlp",+ "ueba",+ "anomalous-data",+ "insider-threat",+ "mitre.t1041",+ "mitre.t1048",+ "mitre.t1567"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["data-exfiltration", "dlp-violation", "anomalous-transfer", "insider-threat", "ueba"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "user": {+ "description": "User responsible for the data transfer",+ "field": "alert.user",+ "required": true+ },+ "source_host": {+ "description": "Internal host where the transfer originated",+ "field": "alert.source_host",+ "required": false+ },+ "destination_ip": {+ "description": "External destination IP or domain",+ "field": "alert.destination_ip",+ "required": false+ },+ "data_volume_mb": {+ "description": "Volume of data transferred in megabytes",+ "field": "alert.data_volume_mb",+ "required": false+ },+ "data_classification": {+ "description": "Classification of the data (sensitive, confidential, pii, ip)",+ "field": "alert.data_classification",+ "required": false+ },+ "transfer_protocol": {+ "description": "Protocol used (https, ftp, sftp, email, usb, cloud)",+ "field": "alert.protocol",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich destination IP / domain (threat intel)",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.destination_ip",+ "indicator_type": "ip",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "siem_search_user",+ "name": "Search SIEM for prior data transfer activity by user",+ "type": "search_siem",+ "params": {+ "query": "user={{inputs.user}} AND event_type=network_transfer",+ "time_window": "-30d",+ "max_results": 500+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 60+ },+ {+ "id": "siem_search_dest",+ "name": "Search SIEM for other users transferring to same destination",+ "type": "search_siem",+ "params": {+ "query": "dest_ip={{inputs.destination_ip}} AND event_type=network_transfer",+ "time_window": "-7d",+ "max_results": 200+ },+ "condition": "inputs.destination_ip != null",+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 45+ },+ {+ "id": "approval_block_dest",+ "name": "Approval gate — block destination IP",+ "type": "approval",+ "params": {+ "message": "Block destination IP '{{inputs.destination_ip}}' involved in anomalous data transfer ({{inputs.data_volume_mb}}MB, classification: {{inputs.data_classification}})?",+ "approvers": ["soc-lead", "data-security"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "condition": "inputs.destination_ip != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "block_dest_ip",+ "name": "Block destination IP at perimeter",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.destination_ip",+ "duration": "72h",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_block_dest.outcome == 'approved' && inputs.destination_ip != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "approval_disable_user",+ "name": "Approval gate — disable user account",+ "type": "approval",+ "params": {+ "message": "Disable account for '{{inputs.user}}' due to suspected data exfiltration ({{inputs.data_volume_mb}}MB of {{inputs.data_classification}} data to {{inputs.destination_ip}})?",+ "approvers": ["soc-lead", "hr-security", "data-security"],+ "timeout_seconds": 600,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 620+ },+ {+ "id": "disable_user",+ "name": "Disable user account (insider threat confirmed)",+ "type": "disable_user",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_user.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "revoke_sessions",+ "name": "Revoke all active sessions for user",+ "type": "revoke_session",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_user.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Data exfiltration investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "data-exfiltration"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify data security and CISO",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "Anomalous data transfer by {{inputs.user}}: {{inputs.data_volume_mb}}MB of {{inputs.data_classification}} data via {{inputs.transfer_protocol}} to {{inputs.destination_ip}}. Destination blocked: {{context.block_success}}.",+ "service_key_env": "PD_CISO_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open data exfiltration ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "Anomalous Data Transfer: {{inputs.user}} — {{inputs.data_volume_mb}}MB {{inputs.data_classification}}",+ "queue": "soc",+ "labels": ["data-exfiltration", "dlp", "insider-threat"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/brute-force/brute-force-lockout.playbook.json b/playbooks/packs/v1/brute-force/brute-force-lockout.playbook.jsonnew file mode 100644index 000000000..77baa030c--- /dev/null+++ b/playbooks/packs/v1/brute-force/brute-force-lockout.playbook.json@@ -0,0 +1,185 @@+{+ "id": "brute-force-lockout-v1",+ "name": "Brute Force: Account Lockout and Source Block",+ "description": "Triggered by detection of repeated failed authentication attempts (password spray, credential stuffing, RDP/SSH brute force). Locks out the targeted account, blocks the source IP, and triggers investigation.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "brute-force",+ "credential-stuffing",+ "password-spray",+ "authentication",+ "mitre.t1110",+ "mitre.t1110.001",+ "mitre.t1110.003"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["medium", "high", "critical"],+ "tags": ["brute-force", "password-spray", "credential-stuffing", "rdp-brute", "ssh-brute"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "user": {+ "description": "Targeted user account (may be null for password spray targeting many users)",+ "field": "alert.user",+ "required": false+ },+ "source_ip": {+ "description": "Attacking source IP or range",+ "field": "alert.source_ip",+ "required": true+ },+ "failure_count": {+ "description": "Number of failed authentication attempts that triggered this alert",+ "field": "alert.failure_count",+ "required": false+ },+ "target_service": {+ "description": "Service being brute-forced (ssh, rdp, web, vpn, idp)",+ "field": "alert.target_service",+ "required": false+ },+ "attack_type": {+ "description": "Type of brute-force attack (password-spray, credential-stuffing, dictionary)",+ "field": "alert.attack_type",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich source IP (threat intel, reputation, ASN)",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.source_ip",+ "indicator_type": "ip"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "siem_search_src",+ "name": "Search SIEM for prior activity from attacking IP",+ "type": "search_siem",+ "params": {+ "query": "src_ip={{inputs.source_ip}}",+ "time_window": "-30d",+ "max_results": 200+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 45+ },+ {+ "id": "block_source_ip",+ "name": "Block attacking source IP at perimeter",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.source_ip",+ "duration": "24h",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "approval_disable_account",+ "name": "Approval gate — temporarily disable targeted account",+ "type": "approval",+ "params": {+ "message": "Temporarily disable account '{{inputs.user}}' due to brute-force attack ({{inputs.failure_count}} failures from {{inputs.source_ip}})?",+ "approvers": ["soc-lead", "identity-admin"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "condition": "inputs.user != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "disable_user",+ "name": "Temporarily disable targeted user account",+ "type": "disable_user",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_account.outcome == 'approved' && inputs.user != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "revoke_sessions",+ "name": "Revoke active sessions for targeted user",+ "type": "revoke_session",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_account.outcome == 'approved' && inputs.user != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "create_siem_notable",+ "name": "Create SIEM notable event for brute force campaign",+ "type": "create_notable_event",+ "params": {+ "title": "Brute Force: {{inputs.attack_type}} from {{inputs.source_ip}} targeting {{inputs.target_service}}",+ "severity": "high",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Brute force investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "brute-force"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify SOC and identity team",+ "type": "notify",+ "params": {+ "channel": "slack",+ "message_template": "Brute force alert: {{inputs.attack_type}} from {{inputs.source_ip}} against {{inputs.target_service}} ({{inputs.failure_count}} failures). IP blocked: {{context.block_success}}. User disabled: {{context.disable_success}}.",+ "webhook_env": "SLACK_SOC_WEBHOOK"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open brute force ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P2",+ "title_template": "Brute Force: {{inputs.attack_type}} from {{inputs.source_ip}}",+ "queue": "soc",+ "labels": ["brute-force", "credential-attack", "authentication"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/cloud-account-takeover/cloud-ato-response.playbook.json b/playbooks/packs/v1/cloud-account-takeover/cloud-ato-response.playbook.jsonnew file mode 100644index 000000000..fdad54579--- /dev/null+++ b/playbooks/packs/v1/cloud-account-takeover/cloud-ato-response.playbook.json@@ -0,0 +1,172 @@+{+ "id": "cloud-ato-response-v1",+ "name": "Cloud ATO: Compromised Cloud Account Response",+ "description": "Triggered by anomalous API activity, impossible travel, or cloud CSPM alert indicating a compromised cloud account. Revokes active sessions, rotates credentials, preserves audit trail, and notifies cloud security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "cloud-account-takeover",+ "cloud",+ "iam",+ "identity",+ "mitre.t1078.004",+ "mitre.t1535"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["cloud-account-takeover", "cloud-ato", "impossible-travel"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "cloud_user": {+ "description": "Cloud account identity (IAM user, service account, or federated identity)",+ "field": "alert.cloud_user",+ "required": true+ },+ "cloud_provider": {+ "description": "Cloud provider: aws | gcp | azure",+ "field": "alert.cloud_provider",+ "required": true+ },+ "source_ip": {+ "description": "Anomalous source IP from cloud trail",+ "field": "alert.source_ip",+ "required": false+ },+ "access_key_id": {+ "description": "AWS access key ID (if applicable)",+ "field": "alert.access_key_id",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich source IP reputation",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.source_ip",+ "indicator_type": "ip",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "cloudtrail_search",+ "name": "Search cloud audit trail for recent actions",+ "type": "search_siem",+ "params": {+ "query": "cloud_user={{inputs.cloud_user}} AND source_ip={{inputs.source_ip}}",+ "time_window": "-4h",+ "max_results": 200,+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 45+ },+ {+ "id": "approval_revoke",+ "name": "Approval gate — revoke cloud sessions and keys",+ "type": "approval",+ "params": {+ "message": "Revoke all active sessions and access keys for cloud user '{{inputs.cloud_user}}' ({{inputs.cloud_provider}})?",+ "approvers": ["cloud-security-lead", "soc-lead"],+ "timeout_seconds": 600,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 620+ },+ {+ "id": "revoke_sessions",+ "name": "Revoke all active cloud sessions",+ "type": "revoke_session",+ "params": {+ "user_field": "inputs.cloud_user",+ "provider": "{{inputs.cloud_provider}}",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_revoke.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "disable_keys",+ "name": "Disable / deactivate access keys",+ "type": "http",+ "params": {+ "url": "${CLOUD_MGMT_URL}/v1/iam/keys/disable",+ "method": "POST",+ "body_template": "{\"user\": \"{{inputs.cloud_user}}\", \"provider\": \"{{inputs.cloud_provider}}\", \"access_key_id\": \"{{inputs.access_key_id}}\"}",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_revoke.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 20+ },+ {+ "id": "block_src_ip",+ "name": "Block anomalous source IP (if present)",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.source_ip",+ "duration": "24h",+ "skip_if_empty": true,+ "dry_run": "{{dry_run}}"+ },+ "condition": "inputs.source_ip != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Cloud ATO investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "cloud-ato"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Page cloud security team (SEV1)",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "Cloud ATO: {{inputs.cloud_user}} on {{inputs.cloud_provider}}. Sessions revoked: {{context.revoke_success}}. Source IP blocked: {{inputs.source_ip}}.",+ "service_key_env": "PD_CLOUD_SECURITY_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open cloud ATO ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "Cloud ATO: {{inputs.cloud_user}} ({{inputs.cloud_provider}})",+ "queue": "cloud-security",+ "labels": ["cloud-ato", "iam", "{{inputs.cloud_provider}}"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/container-escape/container-escape-response.playbook.json b/playbooks/packs/v1/container-escape/container-escape-response.playbook.jsonnew file mode 100644index 000000000..b04396ffc--- /dev/null+++ b/playbooks/packs/v1/container-escape/container-escape-response.playbook.json@@ -0,0 +1,172 @@+{+ "id": "container-escape-response-v1",+ "name": "Container Escape: Runtime Breach Response",+ "description": "Triggered by container runtime security alert (Falco, Sysdig, or similar) indicating a container escape attempt or successful breakout to the host. Kills the offending container, isolates the node, and preserves evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "container-escape",+ "container",+ "kubernetes",+ "mitre.t1611",+ "mitre.t1610"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["container-escape", "container-breakout", "runtime-security"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "container_id": {+ "description": "Container ID of the offending container",+ "field": "alert.container_id",+ "required": true+ },+ "node_host": {+ "description": "Kubernetes node / host running the container",+ "field": "alert.host",+ "required": true+ },+ "namespace": {+ "description": "Kubernetes namespace",+ "field": "alert.k8s_namespace",+ "required": false+ },+ "pod_name": {+ "description": "Kubernetes pod name",+ "field": "alert.k8s_pod",+ "required": false+ },+ "process_name": {+ "description": "Suspicious process that triggered the alert",+ "field": "alert.process_name",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich container image and process",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.container_image",+ "indicator_type": "container-image",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "kill_container",+ "name": "Kill offending container",+ "type": "kill_process",+ "params": {+ "host_field": "alert.host",+ "process_field": "alert.container_id",+ "kill_type": "container",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "cordon_node",+ "name": "Cordon Kubernetes node (prevent new pod scheduling)",+ "type": "http",+ "params": {+ "url": "${K8S_API_URL}/api/v1/nodes/{{inputs.node_host}}/cordon",+ "method": "POST",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "approval_isolate_node",+ "name": "Approval gate — isolate the Kubernetes node",+ "type": "approval",+ "params": {+ "message": "Network-isolate node '{{inputs.node_host}}'? This will drain all pods and may impact running workloads.",+ "approvers": ["platform-lead", "soc-lead"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "isolate_node",+ "name": "Network-isolate compromised node (EDR)",+ "type": "isolate_host",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_isolate_node.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "collect_artifacts",+ "name": "Collect container forensic artifacts",+ "type": "run_script",+ "params": {+ "host_field": "alert.host",+ "script": "collect_container_artifacts.sh",+ "args": ["--container-id", "{{inputs.container_id}}", "--output", "/forensics/{{alert.case_id}}/"],+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 120+ },+ {+ "id": "inv",+ "name": "Container escape investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "container-escape"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Alert platform / DevSecOps team",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "Container escape on node {{inputs.node_host}} (pod: {{inputs.pod_name}}, ns: {{inputs.namespace}}). Container killed: {{context.kill_success}}. Node isolated: {{context.isolate_success}}.",+ "service_key_env": "PD_PLATFORM_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open container escape ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "Container Escape: {{inputs.pod_name}} on {{inputs.node_host}}",+ "queue": "platform-security",+ "labels": ["container-escape", "kubernetes", "runtime"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/endpoint-isolation/endpoint-isolation-response.playbook.json b/playbooks/packs/v1/endpoint-isolation/endpoint-isolation-response.playbook.jsonnew file mode 100644index 000000000..40b387956--- /dev/null+++ b/playbooks/packs/v1/endpoint-isolation/endpoint-isolation-response.playbook.json@@ -0,0 +1,199 @@+{+ "id": "endpoint-isolation-response-v1",+ "name": "Endpoint Isolation: EDR-Driven Host Quarantine",+ "description": "Triggered when an endpoint requires emergency isolation due to confirmed or high-confidence compromise (ransomware spread, active C2 communication, lateral movement staging). Uses EDR to network-isolate the host while preserving management connectivity, collects forensic artifacts, and notifies the SOC.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "endpoint-isolation",+ "edr",+ "quarantine",+ "host-isolation",+ "mitre.t1562.001",+ "mitre.t1204",+ "mitre.t1486"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["endpoint-isolation", "ransomware", "c2-communication", "lateral-movement", "host-compromise"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "host": {+ "description": "Hostname or IP of the endpoint to isolate",+ "field": "alert.host",+ "required": true+ },+ "compromise_type": {+ "description": "Type of compromise driving isolation (ransomware, c2, lateral-movement, malware)",+ "field": "alert.threat_type",+ "required": false+ },+ "user": {+ "description": "User logged into the endpoint at time of alert",+ "field": "alert.user",+ "required": false+ },+ "ioc_hash": {+ "description": "IOC hash associated with the compromise, if known",+ "field": "alert.file_hash",+ "required": false+ },+ "parent_case_id": {+ "description": "Parent case ID for grouping related incidents",+ "field": "alert.case_id",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich host asset context and existing alerts",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.host",+ "indicator_type": "host"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "e2",+ "name": "Enrich IOC hash (if available)",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.file_hash",+ "indicator_type": "hash",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "siem_search",+ "name": "Search SIEM for lateral movement indicators from this host",+ "type": "search_siem",+ "params": {+ "query": "src_host={{inputs.host}} AND (event_type=lateral_movement OR event_type=credential_dump OR event_type=network_scan)",+ "time_window": "-24h",+ "max_results": 300+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 60+ },+ {+ "id": "collect_forensics",+ "name": "Collect forensic artifacts before isolation",+ "type": "run_script",+ "params": {+ "host_field": "alert.host",+ "script": "collect_forensic_artifacts.sh",+ "args": ["--host", "{{inputs.host}}", "--output", "/forensics/{{alert.case_id}}/", "--include", "processes,network,registry,events"],+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 120+ },+ {+ "id": "approval_isolate",+ "name": "Approval gate — network-isolate endpoint",+ "type": "approval",+ "params": {+ "message": "Network-isolate endpoint '{{inputs.host}}' (user: {{inputs.user}}) due to {{inputs.compromise_type}}? This will cut all network connectivity except EDR management channel.",+ "approvers": ["soc-lead"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "isolate_host",+ "name": "Network-isolate host via EDR",+ "type": "isolate_host",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_isolate.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 1,+ "timeout_seconds": 60+ },+ {+ "id": "block_ioc_hash",+ "name": "Block IOC hash globally across fleet",+ "type": "block_ioc",+ "params": {+ "indicator_type": "hash",+ "indicator_field": "alert.file_hash",+ "dry_run": "{{dry_run}}"+ },+ "condition": "inputs.ioc_hash != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "run_av_scan",+ "name": "Run AV scan on isolated host",+ "type": "run_av_scan",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.isolate_host.outcome == 'success'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 300+ },+ {+ "id": "inv",+ "name": "Endpoint isolation investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "endpoint-compromise"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify SOC team and endpoint owner",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "Endpoint '{{inputs.host}}' isolated due to {{inputs.compromise_type}} (user: {{inputs.user}}). Forensics collected: {{context.forensics_success}}. IOC blocked: {{context.block_ioc_success}}.",+ "service_key_env": "PD_SOC_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open endpoint isolation ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "Endpoint Isolated: {{inputs.host}} — {{inputs.compromise_type}}",+ "queue": "soc",+ "labels": ["endpoint-isolation", "host-compromise", "edr"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/ids-critical/ids-critical-response.playbook.json b/playbooks/packs/v1/ids-critical/ids-critical-response.playbook.jsonnew file mode 100644index 000000000..9c362eac9--- /dev/null+++ b/playbooks/packs/v1/ids-critical/ids-critical-response.playbook.json@@ -0,0 +1,172 @@+{+ "id": "ids-critical-response-v1",+ "name": "IDS/IPS Critical Alert: Network Intrusion Response",+ "description": "Triggered by an IDS/IPS signature at critical severity indicating active exploitation, C2 communication, or lateral movement detected at the network layer. Enriches source IP, blocks traffic, and escalates.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ids-critical",+ "ids",+ "ips",+ "network",+ "intrusion",+ "mitre.t1046",+ "mitre.t1190",+ "mitre.t1071"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["ids", "ips", "network-intrusion", "exploitation", "c2", "dga", "c2-beacon"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "source_ip": {+ "description": "External attacker or suspect source IP",+ "field": "alert.source_ip",+ "required": true+ },+ "destination_ip": {+ "description": "Internal host targeted by the IDS/IPS alert",+ "field": "alert.destination_ip",+ "required": false+ },+ "signature": {+ "description": "IDS/IPS rule or signature name that fired",+ "field": "alert.ids_signature",+ "required": false+ },+ "protocol": {+ "description": "Network protocol (TCP/UDP/etc)",+ "field": "alert.protocol",+ "required": false+ },+ "dest_port": {+ "description": "Destination port",+ "field": "alert.destination_port",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich source IP reputation",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.source_ip",+ "indicator_type": "ip"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "siem_search",+ "name": "Search SIEM for prior activity from source IP",+ "type": "search_siem",+ "params": {+ "query": "source_ip={{inputs.source_ip}}",+ "time_window": "-48h",+ "max_results": 200+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 45+ },+ {+ "id": "block_source_ip",+ "name": "Block source IP at perimeter",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.source_ip",+ "duration": "24h",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "approval_contain_dest",+ "name": "Approval gate — isolate targeted internal host",+ "type": "approval",+ "params": {+ "message": "Isolate internal host '{{inputs.destination_ip}}' targeted by IDS/IPS critical alert (sig: {{inputs.signature}})?",+ "approvers": ["soc-lead", "network-lead"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "isolate_dest_host",+ "name": "Network-isolate targeted host",+ "type": "isolate_host",+ "params": {+ "host_field": "alert.destination_ip",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_contain_dest.outcome == 'approved' && inputs.destination_ip != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "create_siem_notable",+ "name": "Create SIEM notable event for IDS critical",+ "type": "create_notable_event",+ "params": {+ "title": "IDS Critical: {{inputs.signature}} from {{inputs.source_ip}}",+ "severity": "critical",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "IDS/IPS critical investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "network-intrusion"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify SOC and network team",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "IDS Critical: {{inputs.signature}} from {{inputs.source_ip}} targeting {{inputs.destination_ip}}. Source IP blocked: {{context.block_success}}.",+ "service_key_env": "PD_SOC_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open IDS critical ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "IDS/IPS Critical: {{inputs.signature}} from {{inputs.source_ip}}",+ "queue": "soc",+ "labels": ["ids", "ips", "network-intrusion"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/malware/malware-execution-response.playbook.json b/playbooks/packs/v1/malware/malware-execution-response.playbook.jsonnew file mode 100644index 000000000..6b06b6134--- /dev/null+++ b/playbooks/packs/v1/malware/malware-execution-response.playbook.json@@ -0,0 +1,183 @@+{+ "id": "malware-execution-response-v1",+ "name": "Malware Execution: Detection & Containment",+ "description": "Triggered by EDR alert for confirmed or suspected malware execution (trojan, infostealer, dropper, RAT). Quarantines the host, kills the malicious process, collects evidence, and notifies the SOC.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "malware",+ "endpoint",+ "execution",+ "mitre.t1204",+ "mitre.t1059",+ "mitre.t1071"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["medium", "high", "critical"],+ "tags": ["malware", "trojan", "rat", "dropper", "infostealer"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "host": {+ "description": "Endpoint where malware was detected",+ "field": "alert.host",+ "required": true+ },+ "file_hash": {+ "description": "SHA-256 hash of the malicious file",+ "field": "alert.file_hash",+ "required": false+ },+ "process_id": {+ "description": "PID of the malicious process",+ "field": "alert.process_id",+ "required": false+ },+ "file_path": {+ "description": "Disk path of the malicious file",+ "field": "alert.file_path",+ "required": false+ },+ "user": {+ "description": "User context under which malware ran",+ "field": "alert.user",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich file hash (threat intelligence)",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.file_hash",+ "indicator_type": "hash",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "av_scan",+ "name": "Run full AV scan on host",+ "type": "run_av_scan",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "kill_process",+ "name": "Kill malicious process",+ "type": "kill_process",+ "params": {+ "host_field": "alert.host",+ "process_field": "alert.process_id",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "quarantine_file",+ "name": "Quarantine malicious file",+ "type": "quarantine_file",+ "params": {+ "host_field": "alert.host",+ "file_path_field": "alert.file_path",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "approval_isolate",+ "name": "Approval gate — isolate host",+ "type": "approval",+ "params": {+ "message": "Isolate host '{{inputs.host}}' from network due to confirmed malware execution?",+ "approvers": ["soc-lead"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "isolate_host",+ "name": "Network-isolate host (EDR)",+ "type": "isolate_host",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_isolate.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "block_hash_ioc",+ "name": "Block malicious hash as global IOC",+ "type": "block_ioc",+ "params": {+ "indicator_type": "hash",+ "indicator_field": "alert.file_hash",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Malware execution investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "malware"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify SOC team",+ "type": "notify",+ "params": {+ "channel": "slack",+ "message_template": "Malware execution on {{inputs.host}} (user: {{inputs.user}}). File quarantined: {{context.quarantine_success}}. Host isolated: {{context.isolate_success}}.",+ "webhook_env": "SLACK_SOC_WEBHOOK"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open malware ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P2",+ "title_template": "Malware Execution: {{inputs.host}} ({{inputs.file_hash}})",+ "queue": "soc",+ "labels": ["malware", "endpoint"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/network-containment/network-containment-response.playbook.json b/playbooks/packs/v1/network-containment/network-containment-response.playbook.jsonnew file mode 100644index 000000000..b6ed77db9--- /dev/null+++ b/playbooks/packs/v1/network-containment/network-containment-response.playbook.json@@ -0,0 +1,164 @@+{+ "id": "network-containment-response-v1",+ "name": "Network Containment: Segment Isolation Response",+ "description": "Triggered by an alert requiring network-level containment of a host or subnet. Coordinates firewall/security-group rule changes to block lateral movement while preserving forensics and management access.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "network-containment",+ "containment",+ "network",+ "mitre.t1562.001",+ "mitre.t1599"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["network-containment", "lateral-movement", "c2", "ransomware"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "host_or_subnet": {+ "description": "Host IP or CIDR subnet to contain",+ "field": "alert.host",+ "required": true+ },+ "threat_type": {+ "description": "Threat driving the containment (ransomware, c2, lateral-movement)",+ "field": "alert.threat_type",+ "required": false+ },+ "allow_mgmt_ips": {+ "description": "Management IPs to keep allowed during containment",+ "field": "alert.mgmt_ips",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich host reputation and asset context",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.host",+ "indicator_type": "ip"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "siem_search",+ "name": "Search SIEM for outbound connections from host",+ "type": "search_siem",+ "params": {+ "query": "src_ip={{inputs.host_or_subnet}} AND event_type=network",+ "time_window": "-6h",+ "max_results": 500+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 60+ },+ {+ "id": "approval_contain",+ "name": "Approval gate — apply network containment",+ "type": "approval",+ "params": {+ "message": "Apply network containment for '{{inputs.host_or_subnet}}'? This will block all east-west traffic except management access.",+ "approvers": ["soc-lead", "network-lead"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "block_inbound_ip",+ "name": "Block inbound traffic to host via security group",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.host",+ "direction": "inbound",+ "duration": "48h",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_contain.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "block_outbound_ip",+ "name": "Block outbound traffic from host via security group",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.host",+ "direction": "outbound",+ "duration": "48h",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_contain.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "run_collection_script",+ "name": "Collect network flow evidence before isolation completes",+ "type": "run_script",+ "params": {+ "host_field": "alert.host",+ "script": "collect_netflow_evidence.sh",+ "args": ["--host", "{{inputs.host_or_subnet}}", "--output", "/forensics/{{alert.case_id}}/"],+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 60+ },+ {+ "id": "inv",+ "name": "Network containment investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "network-containment"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify network and SOC teams",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "Network containment applied for {{inputs.host_or_subnet}} (threat: {{inputs.threat_type}}). Inbound blocked: {{context.block_inbound_success}}. Outbound blocked: {{context.block_outbound_success}}.",+ "service_key_env": "PD_NETWORK_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open network containment ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "Network Containment: {{inputs.host_or_subnet}} ({{inputs.threat_type}})",+ "queue": "soc",+ "labels": ["network-containment", "isolation"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/phishing/phishing-investigation.playbook.json b/playbooks/packs/v1/phishing/phishing-investigation.playbook.jsonnew file mode 100644index 000000000..e5637937c--- /dev/null+++ b/playbooks/packs/v1/phishing/phishing-investigation.playbook.json@@ -0,0 +1,195 @@+{+ "id": "phishing-investigation-v1",+ "name": "Phishing: Email Investigation & Remediation",+ "description": "Triggered by a phishing alert from email gateway or user report. Extracts IOCs, retracts the message fleet-wide, blocks sender domain, and resets any credentials that may have been compromised.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "phishing",+ "email",+ "identity",+ "mitre.t1566",+ "mitre.t1566.001"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["phishing", "email-security"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "message_id": {+ "description": "Email message ID from the alert",+ "field": "alert.message_id",+ "required": true+ },+ "sender_domain": {+ "description": "Sender domain extracted from the From header",+ "field": "alert.sender_domain",+ "required": true+ },+ "recipient_user": {+ "description": "Primary recipient user identity",+ "field": "alert.recipient_user",+ "required": true+ },+ "attachment_hash": {+ "description": "SHA-256 of any malicious attachment",+ "field": "alert.file_hash",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich sender domain reputation",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.sender_domain",+ "indicator_type": "domain"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "e2",+ "name": "Enrich attachment hash (if present)",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.file_hash",+ "indicator_type": "hash",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "retract",+ "name": "Retract phishing email fleet-wide",+ "type": "http",+ "params": {+ "url": "${EMAIL_GATEWAY_URL}/v1/messages/retract",+ "method": "POST",+ "body_template": "{\"message_id\": \"{{inputs.message_id}}\", \"reason\": \"phishing\"}",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "approval_block_domain",+ "name": "Approval gate — block sender domain",+ "type": "approval",+ "params": {+ "message": "Block sender domain '{{inputs.sender_domain}}' at email gateway and DNS firewall?",+ "approvers": ["soc-lead", "security-manager"],+ "timeout_seconds": 900,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 920+ },+ {+ "id": "block_domain",+ "name": "Block sender domain",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.sender_domain",+ "block_type": "domain",+ "duration": "72h",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_block_domain.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "check_clicked",+ "name": "Check if recipient clicked link / opened attachment",+ "type": "http",+ "params": {+ "url": "${SIEM_URL}/search",+ "method": "POST",+ "body_template": "{\"query\": \"email_message_id={{inputs.message_id}} AND (url_click=true OR attachment_open=true)\", \"earliest\": \"-1h\"}"+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "approval_reset",+ "name": "Approval gate — force password reset (if click detected)",+ "type": "approval",+ "params": {+ "message": "Recipient '{{inputs.recipient_user}}' may have clicked link. Force password reset + MFA?",+ "approvers": ["soc-lead"],+ "timeout_seconds": 600,+ "condition_skip": "context.click_detected == false"+ },+ "condition": "context.click_detected == true",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 620+ },+ {+ "id": "reset_pw",+ "name": "Force password reset for recipient",+ "type": "reset_password",+ "params": {+ "user_field": "inputs.recipient_user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_reset.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Phishing investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "phishing"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify security team",+ "type": "notify",+ "params": {+ "channel": "slack",+ "message_template": "Phishing alert: {{inputs.sender_domain}} → {{inputs.recipient_user}}. Message retracted: {{context.retract_success}}. Domain blocked: {{context.domain_blocked}}.",+ "webhook_env": "SLACK_SOC_WEBHOOK"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open phishing ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P2",+ "title_template": "Phishing: {{inputs.sender_domain}} targeting {{inputs.recipient_user}}",+ "queue": "soc",+ "labels": ["phishing", "email"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/privilege-escalation/privesc-response.playbook.json b/playbooks/packs/v1/privilege-escalation/privesc-response.playbook.jsonnew file mode 100644index 000000000..fa37459db--- /dev/null+++ b/playbooks/packs/v1/privilege-escalation/privesc-response.playbook.json@@ -0,0 +1,166 @@+{+ "id": "privesc-response-v1",+ "name": "Privilege Escalation: Detection & Containment",+ "description": "Triggered by EDR or SIEM alert for privilege escalation activity (sudo abuse, token impersonation, LSASS dump, UAC bypass, etc.). Collects forensics, disables the account if confirmed malicious, and escalates to Tier-2 for post-exploitation review.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "privilege-escalation",+ "endpoint",+ "identity",+ "mitre.t1068",+ "mitre.t1548",+ "mitre.t1134"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["privilege-escalation", "privesc", "uac-bypass", "token-impersonation"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "host": {+ "description": "Endpoint where privilege escalation was detected",+ "field": "alert.host",+ "required": true+ },+ "user": {+ "description": "User account performing the escalation",+ "field": "alert.user",+ "required": true+ },+ "technique": {+ "description": "MITRE ATT&CK technique ID (e.g. T1068)",+ "field": "alert.mitre_technique",+ "required": false+ },+ "process_name": {+ "description": "Offending process name",+ "field": "alert.process_name",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Search SIEM for prior activity by this user on this host",+ "type": "search_siem",+ "params": {+ "query": "user={{inputs.user}} AND host={{inputs.host}}",+ "time_window": "-24h",+ "max_results": 100+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 45+ },+ {+ "id": "av_scan",+ "name": "Run AV / EDR scan on host",+ "type": "run_av_scan",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 120+ },+ {+ "id": "collect_forensics",+ "name": "Collect forensic evidence via EDR script",+ "type": "run_script",+ "params": {+ "host_field": "alert.host",+ "script": "collect_privesc_evidence.sh",+ "args": ["--user", "{{inputs.user}}", "--process", "{{inputs.process_name}}", "--output", "/forensics/{{alert.case_id}}/"],+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 120+ },+ {+ "id": "approval_disable_user",+ "name": "Approval gate — disable user account",+ "type": "approval",+ "params": {+ "message": "Disable user account '{{inputs.user}}' due to privilege escalation on '{{inputs.host}}'?",+ "approvers": ["soc-lead", "identity-admin"],+ "timeout_seconds": 600,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 620+ },+ {+ "id": "disable_user",+ "name": "Disable user account in IdP",+ "type": "disable_user",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_user.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "revoke_sessions",+ "name": "Revoke all active sessions for user",+ "type": "revoke_session",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_user.outcome == 'approved'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Privilege escalation investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "privilege-escalation"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify SOC Tier-2",+ "type": "notify",+ "params": {+ "channel": "slack",+ "message_template": "PrivEsc alert: {{inputs.user}} on {{inputs.host}} (technique: {{inputs.technique}}). Account disabled: {{context.disable_success}}.",+ "webhook_env": "SLACK_SOC_WEBHOOK"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open privilege escalation ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "PrivEsc: {{inputs.user}} on {{inputs.host}} ({{inputs.technique}})",+ "queue": "soc",+ "labels": ["privilege-escalation", "endpoint", "identity"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/suspicious-signin/suspicious-signin-response.playbook.json b/playbooks/packs/v1/suspicious-signin/suspicious-signin-response.playbook.jsonnew file mode 100644index 000000000..a300fa2d0--- /dev/null+++ b/playbooks/packs/v1/suspicious-signin/suspicious-signin-response.playbook.json@@ -0,0 +1,184 @@+{+ "id": "suspicious-signin-response-v1",+ "name": "Suspicious Sign-In: Anomalous Authentication Response",+ "description": "Triggered by identity provider or SIEM alert for a suspicious sign-in event (impossible travel, new device, unknown location, off-hours, anomalous behavior score). Verifies legitimacy, enforces MFA step-up, and disables if confirmed malicious.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "suspicious-signin",+ "identity",+ "authentication",+ "mitre.t1078",+ "mitre.t1110",+ "mitre.t1556"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["medium", "high", "critical"],+ "tags": ["suspicious-signin", "anomalous-login", "impossible-travel", "new-device"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "user": {+ "description": "User account that performed the suspicious sign-in",+ "field": "alert.user",+ "required": true+ },+ "source_ip": {+ "description": "Source IP of the suspicious login",+ "field": "alert.source_ip",+ "required": false+ },+ "user_agent": {+ "description": "Browser/device user-agent string",+ "field": "alert.user_agent",+ "required": false+ },+ "country": {+ "description": "Country where the login originated",+ "field": "alert.geo_country",+ "required": false+ },+ "risk_score": {+ "description": "Risk score from IdP (0-100)",+ "field": "alert.risk_score",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich source IP geo and threat intel",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.source_ip",+ "indicator_type": "ip",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "siem_search",+ "name": "Search SIEM for recent sign-in history for this user",+ "type": "search_siem",+ "params": {+ "query": "user={{inputs.user}} AND event_type=authentication",+ "time_window": "-7d",+ "max_results": 100+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 45+ },+ {+ "id": "force_mfa",+ "name": "Force step-up MFA challenge for user",+ "type": "force_mfa",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "revoke_sessions",+ "name": "Revoke current active sessions (force re-auth)",+ "type": "revoke_session",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "inputs.risk_score >= 70 or inputs.country == 'high_risk'",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "approval_disable_user",+ "name": "Approval gate — disable user account (if confirmed compromise)",+ "type": "approval",+ "params": {+ "message": "Disable account for '{{inputs.user}}'? Sign-in from {{inputs.country}} (IP: {{inputs.source_ip}}, risk: {{inputs.risk_score}}). Only if confirmed malicious.",+ "approvers": ["soc-lead", "identity-admin"],+ "timeout_seconds": 600,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 620+ },+ {+ "id": "disable_user",+ "name": "Disable user account in IdP",+ "type": "disable_user",+ "params": {+ "user_field": "inputs.user",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_user.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "block_source_ip",+ "name": "Block source IP if confirmed malicious",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.source_ip",+ "duration": "24h",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_disable_user.outcome == 'approved' && inputs.source_ip != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "inv",+ "name": "Suspicious sign-in investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "suspicious-signin"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Notify identity security team",+ "type": "notify",+ "params": {+ "channel": "slack",+ "message_template": "Suspicious sign-in for {{inputs.user}} from {{inputs.country}} (IP: {{inputs.source_ip}}, risk: {{inputs.risk_score}}). MFA forced: {{context.mfa_success}}. Sessions revoked: {{context.revoke_success}}.",+ "webhook_env": "SLACK_SOC_WEBHOOK"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open suspicious sign-in ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P2",+ "title_template": "Suspicious Sign-In: {{inputs.user}} from {{inputs.country}}",+ "queue": "soc",+ "labels": ["suspicious-signin", "identity", "authentication"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/playbooks/packs/v1/web-compromise/web-compromise-response.playbook.json b/playbooks/packs/v1/web-compromise/web-compromise-response.playbook.jsonnew file mode 100644index 000000000..0f1451e8f--- /dev/null+++ b/playbooks/packs/v1/web-compromise/web-compromise-response.playbook.json@@ -0,0 +1,180 @@+{+ "id": "web-compromise-response-v1",+ "name": "Web Compromise: Defacement / Webshell Response",+ "description": "Triggered by WAF alert, IDS signature, or file-integrity alert indicating a compromised web server (webshell upload, defacement, or unauthorized content modification). Isolates the server, captures forensics, and initiates recovery workflow.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "web-compromise",+ "web",+ "endpoint",+ "mitre.t1505.003",+ "mitre.t1190"+ ],+ "trigger": {+ "on": "alert",+ "severity": ["high", "critical"],+ "tags": ["web-compromise", "webshell", "defacement"]+ },+ "enabled": true,+ "dry_run_support": true,+ "created_at": "2026-05-10T08:00:00+00:00",+ "updated_at": "2026-05-10T08:00:00+00:00",+ "inputs": {+ "host": {+ "description": "Compromised web server hostname or IP",+ "field": "alert.host",+ "required": true+ },+ "webshell_path": {+ "description": "Path of the detected webshell or modified file",+ "field": "alert.file_path",+ "required": false+ },+ "attacker_ip": {+ "description": "Source IP of the attacker (from WAF / access logs)",+ "field": "alert.source_ip",+ "required": false+ },+ "file_hash": {+ "description": "Hash of the suspicious file",+ "field": "alert.file_hash",+ "required": false+ }+ },+ "steps": [+ {+ "id": "e1",+ "name": "Enrich attacker IP reputation",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.source_ip",+ "indicator_type": "ip",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "e2",+ "name": "Enrich file hash (webshell signature lookup)",+ "type": "enrich",+ "params": {+ "indicator_field": "alert.file_hash",+ "indicator_type": "hash",+ "skip_if_empty": true+ },+ "on_failure": "continue",+ "retry_max": 1,+ "timeout_seconds": 30+ },+ {+ "id": "block_attacker_ip",+ "name": "Block attacker IP at WAF/firewall",+ "type": "block_ip",+ "params": {+ "ip_field": "alert.source_ip",+ "duration": "72h",+ "skip_if_empty": true,+ "dry_run": "{{dry_run}}"+ },+ "condition": "inputs.attacker_ip != null",+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ },+ {+ "id": "av_scan",+ "name": "Trigger AV / malware scan on web server",+ "type": "run_av_scan",+ "params": {+ "host_field": "alert.host",+ "scan_path": "{{inputs.webshell_path}}",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 120+ },+ {+ "id": "approval_isolate",+ "name": "Approval gate — isolate web server",+ "type": "approval",+ "params": {+ "message": "Isolate web server '{{inputs.host}}' from network? This will take the site offline.",+ "approvers": ["soc-lead", "infra-lead"],+ "timeout_seconds": 300,+ "auto_approve_severity": ["critical"]+ },+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 320+ },+ {+ "id": "isolate_host",+ "name": "Isolate web server (EDR)",+ "type": "isolate_host",+ "params": {+ "host_field": "alert.host",+ "dry_run": "{{dry_run}}"+ },+ "condition": "steps.approval_isolate.outcome == 'approved'",+ "on_failure": "abort",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "forensic_snapshot",+ "name": "Snapshot disk for forensics",+ "type": "http",+ "params": {+ "url": "${EDR_URL}/hosts/{{inputs.host}}/snapshot",+ "method": "POST",+ "dry_run": "{{dry_run}}"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 30+ },+ {+ "id": "inv",+ "name": "Web compromise investigation",+ "type": "investigate",+ "params": {+ "case_id_field": "alert.case_id",+ "focus": "web-compromise"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 180+ },+ {+ "id": "n1",+ "name": "Alert web / infra team",+ "type": "notify",+ "params": {+ "channel": "pagerduty",+ "message_template": "Web compromise on {{inputs.host}}. Attacker IP: {{inputs.attacker_ip}}. Host isolated: {{context.isolate_success}}.",+ "service_key_env": "PD_INFRA_KEY"+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 10+ },+ {+ "id": "t1",+ "name": "Open web compromise ticket",+ "type": "create_ticket",+ "params": {+ "priority": "P1",+ "title_template": "Web Compromise: {{inputs.host}}",+ "queue": "soc",+ "labels": ["web-compromise", "webshell"]+ },+ "on_failure": "continue",+ "retry_max": 0,+ "timeout_seconds": 20+ }+ ]+}diff --git a/services/actions/app/clients/__init__.py b/services/actions/app/clients/__init__.pynew file mode 100644index 000000000..e69de29bbdiff --git a/services/actions/app/clients/aws_security_groups.py b/services/actions/app/clients/aws_security_groups.pynew file mode 100644index 000000000..9715860b2--- /dev/null+++ b/services/actions/app/clients/aws_security_groups.py@@ -0,0 +1,213 @@+"""+AWS Security Groups client for IP blocking/unblocking.++Uses boto3 (installed via the connectors service layer or injected via+httpx-compatible shim where boto3 is available). Falls back to direct+AWS EC2 API calls via httpx + SigV4 signing when boto3 is absent so+the actions service stays dependency-light.++Credentials expected in ActionRequest.parameters:+ aws_access_key_id: str+ aws_secret_access_key: str+ aws_region: str (e.g. "us-east-1")+ aws_security_group_id: str (sg-xxxxxxxx)+ aws_assume_role_arn: str (optional, for cross-account assume-role)+ aws_session_token: str (optional, pre-assumed)+ aws_protocol: str (optional, default "tcp")+ aws_from_port: int (optional, default 0)+ aws_to_port: int (optional, default 65535)+"""++from __future__ import annotations++import json+from typing import Any++import httpx+import structlog++logger = structlog.get_logger()+++class AWSSGClient:+ """Async AWS Security Group IP block/unblock using boto3 (if available)+ or the raw EC2 REST API via SigV4-signed httpx calls."""++ def __init__(+ self,+ access_key_id: str,+ secret_access_key: str,+ region: str,+ security_group_id: str,+ session_token: str | None = None,+ assume_role_arn: str | None = None,+ ) -> None:+ self._access_key_id = access_key_id+ self._secret_access_key = secret_access_key+ self._region = region+ self._sg_id = security_group_id+ self._session_token = session_token+ self._assume_role_arn = assume_role_arn++ async def _get_credentials(self) -> tuple[str, str, str | None]:+ """Return (key_id, secret, session_token), assuming a role if configured."""+ if not self._assume_role_arn:+ return self._access_key_id, self._secret_access_key, self._session_token++ # Assume-role via STS+ try:+ import boto3++ sts = boto3.client(+ "sts",+ aws_access_key_id=self._access_key_id,+ aws_secret_access_key=self._secret_access_key,+ region_name=self._region,+ )+ creds = sts.assume_role(+ RoleArn=self._assume_role_arn,+ RoleSessionName="aisoc-actions",+ )["Credentials"]+ return creds["AccessKeyId"], creds["SecretAccessKey"], creds["SessionToken"]+ except ImportError:+ logger.warning("aws_sg.boto3_not_available — cannot assume role, using base creds")+ return self._access_key_id, self._secret_access_key, self._session_token++ async def _boto3_available(self) -> bool:+ try:+ import boto3 # noqa: F401+ return True+ except ImportError:+ return False++ async def block_ip(+ self,+ ip: str,+ protocol: str = "tcp",+ from_port: int = 0,+ to_port: int = 65535,+ ) -> dict[str, Any]:+ """Add an ingress deny rule for the IP (via revoke on a permissive SG or by adding egress deny).++ NOTE: AWS Security Groups are allow-only and don't support explicit deny rules.+ The idiomatic pattern is to add the IP as an *ingress allow* in a block-list SG+ that has no route to protected resources, or to remove existing allows.+ We implement the explicit revoke-authorization pattern for a dedicated block-SG here.+ """+ key_id, secret, token = await self._get_credentials()++ if await self._boto3_available():+ return await self._boto3_authorize_egress_block(key_id, secret, token, ip, protocol, from_port, to_port)+ else:+ return await self._httpx_authorize(key_id, secret, token, ip, protocol, from_port, to_port, action="block")++ async def unblock_ip(+ self,+ ip: str,+ protocol: str = "tcp",+ from_port: int = 0,+ to_port: int = 65535,+ ) -> dict[str, Any]:+ """Remove the ingress deny rule for the IP."""+ key_id, secret, token = await self._get_credentials()++ if await self._boto3_available():+ return await self._boto3_revoke_block(key_id, secret, token, ip, protocol, from_port, to_port)+ else:+ return await self._httpx_authorize(key_id, secret, token, ip, protocol, from_port, to_port, action="unblock")++ async def _boto3_authorize_egress_block(+ self, key_id: str, secret: str, token: str | None,+ ip: str, protocol: str, from_port: int, to_port: int,+ ) -> dict[str, Any]:+ import boto3++ ec2 = boto3.client(+ "ec2",+ region_name=self._region,+ aws_access_key_id=key_id,+ aws_secret_access_key=secret,+ aws_session_token=token,+ )+ cidr = f"{ip}/32"+ try:+ ec2.authorize_security_group_ingress(+ GroupId=self._sg_id,+ IpPermissions=[{+ "IpProtocol": protocol,+ "FromPort": from_port,+ "ToPort": to_port,+ "IpRanges": [{"CidrIp": cidr, "Description": "AiSOC block"}],+ }],+ )+ logger.info("aws_sg.block_ip.success", sg=self._sg_id, cidr=cidr)+ return {"success": True, "action": "block_ip", "ip": ip, "sg_id": self._sg_id, "cidr": cidr}+ except ec2.exceptions.ClientError as exc:+ code = exc.response["Error"]["Code"]+ if code == "InvalidPermission.Duplicate":+ return {"success": True, "action": "block_ip", "ip": ip, "note": "Rule already exists"}+ raise++ async def _boto3_revoke_block(+ self, key_id: str, secret: str, token: str | None,+ ip: str, protocol: str, from_port: int, to_port: int,+ ) -> dict[str, Any]:+ import boto3++ ec2 = boto3.client(+ "ec2",+ region_name=self._region,+ aws_access_key_id=key_id,+ aws_secret_access_key=secret,+ aws_session_token=token,+ )+ cidr = f"{ip}/32"+ try:+ ec2.revoke_security_group_ingress(+ GroupId=self._sg_id,+ IpPermissions=[{+ "IpProtocol": protocol,+ "FromPort": from_port,+ "ToPort": to_port,+ "IpRanges": [{"CidrIp": cidr}],+ }],+ )+ logger.info("aws_sg.unblock_ip.success", sg=self._sg_id, cidr=cidr)+ return {"success": True, "action": "unblock_ip", "ip": ip, "sg_id": self._sg_id}+ except ec2.exceptions.ClientError as exc:+ code = exc.response["Error"]["Code"]+ if code == "InvalidPermission.NotFound":+ return {"success": True, "action": "unblock_ip", "ip": ip, "note": "Rule not found (already removed)"}+ raise++ async def _httpx_authorize(+ self, key_id: str, secret: str, token: str | None,+ ip: str, protocol: str, from_port: int, to_port: int, action: str,+ ) -> dict[str, Any]:+ """Fallback: direct AWS EC2 API call without boto3.+ This is a placeholder; production use should install boto3."""+ logger.warning("aws_sg.httpx_fallback — boto3 unavailable, cannot execute live")+ return {+ "success": False,+ "action": action,+ "ip": ip,+ "note": "boto3 not installed in actions service — add boto3 to pyproject.toml",+ }++ async def describe_rules(self) -> list[dict[str, Any]]:+ """List ingress rules on the target security group."""+ key_id, secret, token = await self._get_credentials()+ if not await self._boto3_available():+ return []++ import boto3++ ec2 = boto3.client(+ "ec2",+ region_name=self._region,+ aws_access_key_id=key_id,+ aws_secret_access_key=secret,+ aws_session_token=token,+ )+ resp = ec2.describe_security_group_rules(Filters=[{"Name": "group-id", "Values": [self._sg_id]}])+ return resp.get("SecurityGroupRules", [])diff --git a/services/actions/app/clients/crowdstrike_rtr.py b/services/actions/app/clients/crowdstrike_rtr.pynew file mode 100644index 000000000..cbf31a474--- /dev/null+++ b/services/actions/app/clients/crowdstrike_rtr.py@@ -0,0 +1,161 @@+"""+CrowdStrike Falcon Real-Time-Response (RTR) client.++Wraps the RTR API for host containment, process termination, and file quarantine.+Credentials are expected in ActionRequest.parameters:+ cs_client_id: str+ cs_client_secret: str+ cs_base_url: str (optional, default api.crowdstrike.com)+"""++from __future__ import annotations++import asyncio+from typing import Any++import httpx+import structlog++logger = structlog.get_logger()++_DEFAULT_BASE = "https://api.crowdstrike.com"+_TOKEN_PATH = "/oauth2/token"+++class CrowdStrikeRTRClient:+ """Thin async wrapper over the CrowdStrike Falcon RTR REST API."""++ def __init__(self, client_id: str, client_secret: str, base_url: str = _DEFAULT_BASE) -> None:+ self._client_id = client_id+ self._client_secret = client_secret+ self._base_url = base_url.rstrip("/")+ self._token: str | None = None++ async def _authenticate(self, client: httpx.AsyncClient) -> str:+ resp = await client.post(+ f"{self._base_url}{_TOKEN_PATH}",+ data={"client_id": self._client_id, "client_secret": self._client_secret},+ )+ resp.raise_for_status()+ self._token = resp.json()["access_token"]+ return self._token++ def _auth_headers(self) -> dict[str, str]:+ return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}++ async def _ensure_token(self, client: httpx.AsyncClient) -> None:+ if not self._token:+ await self._authenticate(client)++ async def get_device_id(self, hostname: str) -> str | None:+ """Resolve a hostname to a CrowdStrike device_id."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ await self._ensure_token(client)+ resp = await client.get(+ f"{self._base_url}/devices/queries/devices/v1",+ headers=self._auth_headers(),+ params={"filter": f"hostname:'{hostname}'", "limit": 1},+ )+ if resp.status_code == 401:+ await self._authenticate(client)+ resp = await client.get(+ f"{self._base_url}/devices/queries/devices/v1",+ headers=self._auth_headers(),+ params={"filter": f"hostname:'{hostname}'", "limit": 1},+ )+ resp.raise_for_status()+ resources = resp.json().get("resources", [])+ return resources[0] if resources else None++ async def contain_host(self, device_id: str) -> dict[str, Any]:+ """Put a host into network containment via RTR."""+ async with httpx.AsyncClient(timeout=30.0) as client:+ await self._ensure_token(client)+ resp = await client.post(+ f"{self._base_url}/devices/entities/devices-actions/v2",+ headers=self._auth_headers(),+ params={"action_name": "contain"},+ json={"ids": [device_id]},+ )+ resp.raise_for_status()+ return {"device_id": device_id, "action": "contain", "response": resp.json()}++ async def lift_containment(self, device_id: str) -> dict[str, Any]:+ """Remove a host from network containment."""+ async with httpx.AsyncClient(timeout=30.0) as client:+ await self._ensure_token(client)+ resp = await client.post(+ f"{self._base_url}/devices/entities/devices-actions/v2",+ headers=self._auth_headers(),+ params={"action_name": "lift_containment"},+ json={"ids": [device_id]},+ )+ resp.raise_for_status()+ return {"device_id": device_id, "action": "lift_containment", "response": resp.json()}++ async def _init_rtr_session(self, client: httpx.AsyncClient, device_id: str) -> str:+ """Open an RTR batch session with a single host, return session_id."""+ resp = await client.post(+ f"{self._base_url}/real-time-response/combined/batch-init-session/v1",+ headers=self._auth_headers(),+ json={"host_ids": [device_id], "queue_offline": False},+ )+ resp.raise_for_status()+ return resp.json()["batch_id"]++ async def kill_process(self, device_id: str, pid: int) -> dict[str, Any]:+ """Kill a process by PID via RTR kill command."""+ async with httpx.AsyncClient(timeout=60.0) as client:+ await self._ensure_token(client)+ batch_id = await self._init_rtr_session(client, device_id)++ resp = await client.post(+ f"{self._base_url}/real-time-response/combined/batch-active-responder-command/v1",+ headers=self._auth_headers(),+ json={+ "base_command": "kill",+ "batch_id": batch_id,+ "command_string": f"kill {pid}",+ "optional_hosts": [device_id],+ },+ )+ resp.raise_for_status()+ return {"device_id": device_id, "pid": pid, "action": "kill_process", "response": resp.json()}++ async def quarantine_file(self, device_id: str, file_path: str) -> dict[str, Any]:+ """Remove (quarantine) a file from the host via RTR rm command."""+ async with httpx.AsyncClient(timeout=60.0) as client:+ await self._ensure_token(client)+ batch_id = await self._init_rtr_session(client, device_id)++ resp = await client.post(+ f"{self._base_url}/real-time-response/combined/batch-active-responder-command/v1",+ headers=self._auth_headers(),+ json={+ "base_command": "rm",+ "batch_id": batch_id,+ "command_string": f"rm '{file_path}'",+ "optional_hosts": [device_id],+ },+ )+ resp.raise_for_status()+ return {"device_id": device_id, "file_path": file_path, "action": "quarantine_file", "response": resp.json()}++ async def run_script(self, device_id: str, script_content: str) -> dict[str, Any]:+ """Run a PowerShell script on the host via RTR."""+ async with httpx.AsyncClient(timeout=120.0) as client:+ await self._ensure_token(client)+ batch_id = await self._init_rtr_session(client, device_id)++ resp = await client.post(+ f"{self._base_url}/real-time-response/combined/batch-admin-command/v1",+ headers=self._auth_headers(),+ json={+ "base_command": "runscript",+ "batch_id": batch_id,+ "command_string": f"runscript -Raw=```{script_content}```",+ "optional_hosts": [device_id],+ },+ )+ resp.raise_for_status()+ return {"device_id": device_id, "action": "run_script", "response": resp.json()}diff --git a/services/actions/app/clients/defender_client.py b/services/actions/app/clients/defender_client.pynew file mode 100644index 000000000..6de6467ea--- /dev/null+++ b/services/actions/app/clients/defender_client.py@@ -0,0 +1,191 @@+"""+Microsoft Defender for Endpoint client via Microsoft Graph Security API.++Supports: isolate device, lift isolation, block IoC, remove IoC, trigger AV scan.++Credentials expected in ActionRequest.parameters:+ mde_tenant_id: str+ mde_client_id: str+ mde_client_secret: str+"""++from __future__ import annotations++from typing import Any++import httpx+import structlog++logger = structlog.get_logger()++_AUTHORITY = "https://login.microsoftonline.com"+_MDE_SCOPE = "https://api.securitycenter.microsoft.com/.default"+_MDE_BASE = "https://api.securitycenter.microsoft.com/api"+++class DefenderClient:+ """Async client for Microsoft Defender for Endpoint management actions."""++ def __init__(self, tenant_id: str, client_id: str, client_secret: str) -> None:+ self._tenant_id = tenant_id+ self._client_id = client_id+ self._client_secret = client_secret+ self._token: str | None = None++ async def _authenticate(self, client: httpx.AsyncClient) -> str:+ resp = await client.post(+ f"{_AUTHORITY}/{self._tenant_id}/oauth2/v2.0/token",+ data={+ "grant_type": "client_credentials",+ "client_id": self._client_id,+ "client_secret": self._client_secret,+ "scope": _MDE_SCOPE,+ },+ )+ resp.raise_for_status()+ self._token = resp.json()["access_token"]+ return self._token++ def _headers(self) -> dict[str, str]:+ return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}++ async def _ensure_token(self, client: httpx.AsyncClient) -> None:+ if not self._token:+ await self._authenticate(client)++ async def find_machine(self, hostname: str) -> dict[str, Any] | None:+ """Look up a machine by hostname in Defender for Endpoint."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ await self._ensure_token(client)+ resp = await client.get(+ f"{_MDE_BASE}/machines",+ headers=self._headers(),+ params={"$filter": f"computerDnsName eq '{hostname}'", "$top": 1},+ )+ resp.raise_for_status()+ machines = resp.json().get("value", [])+ return machines[0] if machines else None++ async def isolate_machine(self, hostname: str, comment: str = "AiSOC automated isolation") -> dict[str, Any]:+ """Isolate a machine from the network via MDE."""+ async with httpx.AsyncClient(timeout=30.0) as client:+ await self._ensure_token(client)+ machine = await self._resolve_machine(client, hostname)+ machine_id = machine["id"]++ resp = await client.post(+ f"{_MDE_BASE}/machines/{machine_id}/isolate",+ headers=self._headers(),+ json={"Comment": comment, "IsolationType": "Full"},+ )+ resp.raise_for_status()+ action = resp.json()+ logger.info("mde.isolate_machine.success", machine_id=machine_id, hostname=hostname)+ return {+ "success": True,+ "action": "isolate_machine",+ "machine_id": machine_id,+ "hostname": hostname,+ "mde_action_id": action.get("id"),+ }++ async def unisolate_machine(self, hostname: str, comment: str = "AiSOC automated lift") -> dict[str, Any]:+ """Remove a machine from isolation."""+ async with httpx.AsyncClient(timeout=30.0) as client:+ await self._ensure_token(client)+ machine = await self._resolve_machine(client, hostname)+ machine_id = machine["id"]++ resp = await client.post(+ f"{_MDE_BASE}/machines/{machine_id}/unisolate",+ headers=self._headers(),+ json={"Comment": comment},+ )+ resp.raise_for_status()+ logger.info("mde.unisolate_machine.success", machine_id=machine_id)+ return {"success": True, "action": "unisolate_machine", "machine_id": machine_id, "hostname": hostname}++ async def block_ioc(+ self,+ indicator_type: str,+ indicator_value: str,+ title: str = "AiSOC block",+ severity: str = "High",+ ) -> dict[str, Any]:+ """Add a block indicator (IP, URL, domain, file hash) to MDE.++ indicator_type: FileSha1 | FileSha256 | FileMd5 | IpAddress | Url | DomainName+ """+ async with httpx.AsyncClient(timeout=20.0) as client:+ await self._ensure_token(client)+ resp = await client.post(+ f"{_MDE_BASE}/indicators",+ headers=self._headers(),+ json={+ "indicatorValue": indicator_value,+ "indicatorType": indicator_type,+ "action": "Block",+ "title": title,+ "severity": severity,+ "generateAlert": True,+ },+ )+ resp.raise_for_status()+ indicator = resp.json()+ logger.info("mde.block_ioc.success", type=indicator_type, value=indicator_value)+ return {+ "success": True,+ "action": "block_ioc",+ "indicator_id": indicator.get("id"),+ "indicator_type": indicator_type,+ "indicator_value": indicator_value,+ }++ async def remove_ioc(self, indicator_id: str) -> dict[str, Any]:+ """Remove a block indicator from MDE."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ await self._ensure_token(client)+ resp = await client.delete(+ f"{_MDE_BASE}/indicators/{indicator_id}",+ headers=self._headers(),+ )+ resp.raise_for_status()+ logger.info("mde.remove_ioc.success", indicator_id=indicator_id)+ return {"success": True, "action": "remove_ioc", "indicator_id": indicator_id}++ async def run_av_scan(self, hostname: str, scan_type: str = "Full") -> dict[str, Any]:+ """Trigger an antivirus scan on a machine (Quick or Full)."""+ async with httpx.AsyncClient(timeout=30.0) as client:+ await self._ensure_token(client)+ machine = await self._resolve_machine(client, hostname)+ machine_id = machine["id"]++ resp = await client.post(+ f"{_MDE_BASE}/machines/{machine_id}/runAntiVirusScan",+ headers=self._headers(),+ json={"Comment": "AiSOC automated AV scan", "ScanType": scan_type},+ )+ resp.raise_for_status()+ action = resp.json()+ logger.info("mde.run_av_scan.success", machine_id=machine_id, scan_type=scan_type)+ return {+ "success": True,+ "action": "run_av_scan",+ "machine_id": machine_id,+ "hostname": hostname,+ "scan_type": scan_type,+ "mde_action_id": action.get("id"),+ }++ async def _resolve_machine(self, client: httpx.AsyncClient, hostname: str) -> dict[str, Any]:+ """Resolve hostname to MDE machine object (with auth already ensured)."""+ resp = await client.get(+ f"{_MDE_BASE}/machines",+ headers=self._headers(),+ params={"$filter": f"computerDnsName eq '{hostname}'", "$top": 1},+ )+ resp.raise_for_status()+ machines = resp.json().get("value", [])+ if not machines:+ raise ValueError(f"No MDE machine found for hostname: {hostname}")+ return machines[0]diff --git a/services/actions/app/clients/elastic_client.py b/services/actions/app/clients/elastic_client.pynew file mode 100644index 000000000..c18209221--- /dev/null+++ b/services/actions/app/clients/elastic_client.py@@ -0,0 +1,190 @@+"""+Elastic Security / Elasticsearch client for SIEM response actions.++Supports: run ES|QL search, update watcher alert, create/update detection rule, enable/disable rule.++Credentials expected in ActionRequest.parameters:+ elastic_url: str e.g. "https://my-cluster.es.io:9243"+ elastic_api_key: str Base64-encoded API key ("id:api_key")+ elastic_username: str (alternative to api_key)+ elastic_password: str+ kibana_url: str e.g. "https://my-cluster.kb.io:9243" (required for rules/watchers)+"""++from __future__ import annotations++from typing import Any++import httpx+import structlog++logger = structlog.get_logger()+++class ElasticClient:+ """Async client for Elastic Security response actions."""++ def __init__(+ self,+ es_url: str,+ api_key: str | None = None,+ username: str | None = None,+ password: str | None = None,+ kibana_url: str | None = None,+ ) -> None:+ self._es_url = es_url.rstrip("/")+ self._kibana_url = (kibana_url or es_url).rstrip("/")+ self._api_key = api_key+ self._username = username+ self._password = password++ def _es_headers(self) -> dict[str, str]:+ if self._api_key:+ return {"Authorization": f"ApiKey {self._api_key}", "Content-Type": "application/json"}+ return {"Content-Type": "application/json"}++ def _auth(self) -> tuple[str, str] | None:+ if self._username and self._password:+ return (self._username, self._password)+ return None++ def _kibana_headers(self) -> dict[str, str]:+ headers = dict(self._es_headers())+ headers["kbn-xsrf"] = "true"+ return headers++ async def run_esql_search(+ self,+ query: str,+ limit: int = 500,+ ) -> list[dict[str, Any]]:+ """Execute an ES|QL query and return results as list of column-keyed dicts."""+ async with httpx.AsyncClient(timeout=60.0) as client:+ resp = await client.post(+ f"{self._es_url}/_query",+ headers=self._es_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ json={"query": query, "accept": "application/json"},+ )+ resp.raise_for_status()+ data = resp.json()+ columns = [col["name"] for col in data.get("columns", [])]+ rows = data.get("values", [])+ results = [dict(zip(columns, row)) for row in rows]+ logger.info("elastic.esql.complete", query=query[:80], results=len(results))+ return results++ async def run_dsl_search(+ self,+ index: str,+ query: dict[str, Any],+ size: int = 500,+ ) -> list[dict[str, Any]]:+ """Execute a DSL search query and return hits."""+ async with httpx.AsyncClient(timeout=60.0) as client:+ resp = await client.post(+ f"{self._es_url}/{index}/_search",+ headers=self._es_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ json={"query": query, "size": size},+ )+ resp.raise_for_status()+ hits = resp.json().get("hits", {}).get("hits", [])+ logger.info("elastic.dsl.complete", index=index, results=len(hits))+ return [h["_source"] for h in hits]++ async def create_or_update_detection_rule(+ self,+ rule_config: dict[str, Any],+ ) -> dict[str, Any]:+ """Create or update a detection rule in Kibana Security.++ rule_config must include at minimum: name, type, query (or other required fields per type).+ Upsert is done via rule_id if present.+ """+ rule_id = rule_config.get("rule_id")+ async with httpx.AsyncClient(timeout=30.0) as client:+ if rule_id:+ resp = await client.put(+ f"{self._kibana_url}/api/detection_engine/rules",+ headers=self._kibana_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ json=rule_config,+ )+ else:+ resp = await client.post(+ f"{self._kibana_url}/api/detection_engine/rules",+ headers=self._kibana_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ json=rule_config,+ )+ resp.raise_for_status()+ result = resp.json()+ logger.info(+ "elastic.detection_rule.upserted",+ rule_name=rule_config.get("name"),+ rule_id=result.get("id"),+ )+ return {+ "success": True,+ "action": "upsert_detection_rule",+ "rule_id": result.get("id"),+ "rule_name": result.get("name"),+ }++ async def enable_detection_rule(self, rule_id: str) -> dict[str, Any]:+ """Enable a detection rule by ID."""+ return await self._toggle_rule(rule_id, enabled=True)++ async def disable_detection_rule(self, rule_id: str) -> dict[str, Any]:+ """Disable a detection rule by ID."""+ return await self._toggle_rule(rule_id, enabled=False)++ async def _toggle_rule(self, rule_id: str, enabled: bool) -> dict[str, Any]:+ async with httpx.AsyncClient(timeout=20.0) as client:+ resp = await client.patch(+ f"{self._kibana_url}/api/detection_engine/rules",+ headers=self._kibana_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ json={"id": rule_id, "enabled": enabled},+ )+ resp.raise_for_status()+ logger.info("elastic.detection_rule.toggled", rule_id=rule_id, enabled=enabled)+ return {"success": True, "action": "toggle_detection_rule", "rule_id": rule_id, "enabled": enabled}++ async def update_watcher(self, watcher_id: str, watcher_body: dict[str, Any]) -> dict[str, Any]:+ """Create or update an Elasticsearch Watcher alert."""+ async with httpx.AsyncClient(timeout=30.0) as client:+ resp = await client.put(+ f"{self._es_url}/_watcher/watch/{watcher_id}",+ headers=self._es_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ json=watcher_body,+ )+ resp.raise_for_status()+ logger.info("elastic.watcher.updated", watcher_id=watcher_id)+ return {"success": True, "action": "update_watcher", "watcher_id": watcher_id}++ async def activate_watcher(self, watcher_id: str) -> dict[str, Any]:+ """Activate an existing watcher."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ resp = await client.put(+ f"{self._es_url}/_watcher/watch/{watcher_id}/_activate",+ headers=self._es_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ )+ resp.raise_for_status()+ logger.info("elastic.watcher.activated", watcher_id=watcher_id)+ return {"success": True, "action": "activate_watcher", "watcher_id": watcher_id}++ async def deactivate_watcher(self, watcher_id: str) -> dict[str, Any]:+ """Deactivate an existing watcher."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ resp = await client.put(+ f"{self._es_url}/_watcher/watch/{watcher_id}/_deactivate",+ headers=self._es_headers(),+ auth=self._auth(), # type: ignore[arg-type]+ )+ resp.raise_for_status()+ logger.info("elastic.watcher.deactivated", watcher_id=watcher_id)+ return {"success": True, "action": "deactivate_watcher", "watcher_id": watcher_id}diff --git a/services/actions/app/clients/okta_client.py b/services/actions/app/clients/okta_client.pynew file mode 100644index 000000000..d0930030b--- /dev/null+++ b/services/actions/app/clients/okta_client.py@@ -0,0 +1,180 @@+"""+Okta management API client for identity response actions.++Supports: suspend session, force MFA enrolment, disable user, password reset,+and clearing active sessions.++Credentials expected in ActionRequest.parameters:+ okta_domain: str (e.g. https://yourorg.okta.com)+ okta_api_token: str (SSWS token with okta.users.manage scope)+"""++from __future__ import annotations++from typing import Any++import httpx+import structlog++logger = structlog.get_logger()+++class OktaClient:+ """Async wrapper over the Okta Management REST API for identity response actions."""++ def __init__(self, domain: str, api_token: str) -> None:+ self._domain = domain.rstrip("/")+ self._token = api_token++ def _headers(self) -> dict[str, str]:+ return {+ "Authorization": f"SSWS {self._token}",+ "Accept": "application/json",+ "Content-Type": "application/json",+ }++ async def _find_user(self, client: httpx.AsyncClient, login_or_id: str) -> dict[str, Any]:+ """Look up a user by login (email) or ID."""+ # First try as direct ID+ resp = await client.get(+ f"{self._domain}/api/v1/users/{login_or_id}",+ headers=self._headers(),+ )+ if resp.status_code == 200:+ return resp.json()++ # Fall back to search by login+ resp = await client.get(+ f"{self._domain}/api/v1/users",+ headers=self._headers(),+ params={"filter": f'profile.login eq "{login_or_id}"', "limit": 1},+ )+ resp.raise_for_status()+ users = resp.json()+ if not users:+ raise ValueError(f"No Okta user found for: {login_or_id}")+ return users[0]++ async def suspend_user(self, login_or_id: str) -> dict[str, Any]:+ """Suspend an Okta user (blocks sign-in without deactivating)."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]+ resp = await client.post(+ f"{self._domain}/api/v1/users/{user_id}/lifecycle/suspend",+ headers=self._headers(),+ )+ resp.raise_for_status()+ logger.info("okta.suspend_user.success", user_id=user_id, login=login_or_id)+ return {"success": True, "action": "suspend_user", "user_id": user_id, "login": login_or_id}++ async def unsuspend_user(self, login_or_id: str) -> dict[str, Any]:+ """Unsuspend (reactivate) an Okta user."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]+ resp = await client.post(+ f"{self._domain}/api/v1/users/{user_id}/lifecycle/unsuspend",+ headers=self._headers(),+ )+ resp.raise_for_status()+ logger.info("okta.unsuspend_user.success", user_id=user_id)+ return {"success": True, "action": "unsuspend_user", "user_id": user_id, "login": login_or_id}++ async def disable_user(self, login_or_id: str) -> dict[str, Any]:+ """Deactivate (disable) an Okta user — more forceful than suspend."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]+ resp = await client.post(+ f"{self._domain}/api/v1/users/{user_id}/lifecycle/deactivate",+ headers=self._headers(),+ params={"sendEmail": "false"},+ )+ resp.raise_for_status()+ logger.info("okta.disable_user.success", user_id=user_id)+ return {"success": True, "action": "disable_user", "user_id": user_id, "login": login_or_id}++ async def enable_user(self, login_or_id: str) -> dict[str, Any]:+ """Reactivate a deactivated Okta user."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]+ resp = await client.post(+ f"{self._domain}/api/v1/users/{user_id}/lifecycle/activate",+ headers=self._headers(),+ params={"sendEmail": "false"},+ )+ resp.raise_for_status()+ logger.info("okta.enable_user.success", user_id=user_id)+ return {"success": True, "action": "enable_user", "user_id": user_id, "login": login_or_id}++ async def clear_sessions(self, login_or_id: str) -> dict[str, Any]:+ """Terminate all active sessions for a user (revoke tokens)."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]+ resp = await client.delete(+ f"{self._domain}/api/v1/users/{user_id}/sessions",+ headers=self._headers(),+ )+ resp.raise_for_status()+ logger.info("okta.clear_sessions.success", user_id=user_id)+ return {"success": True, "action": "clear_sessions", "user_id": user_id, "login": login_or_id}++ async def reset_password(self, login_or_id: str) -> dict[str, Any]:+ """Trigger a password reset email for the user."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]+ resp = await client.post(+ f"{self._domain}/api/v1/users/{user_id}/lifecycle/reset_password",+ headers=self._headers(),+ params={"sendEmail": "true"},+ )+ resp.raise_for_status()+ data = resp.json()+ logger.info("okta.reset_password.success", user_id=user_id)+ return {+ "success": True,+ "action": "reset_password",+ "user_id": user_id,+ "login": login_or_id,+ "reset_url": data.get("resetPasswordUrl"),+ }++ async def force_mfa_enrollment(self, login_or_id: str) -> dict[str, Any]:+ """Reset MFA factors for a user, forcing re-enrollment on next login."""+ async with httpx.AsyncClient(timeout=20.0) as client:+ user = await self._find_user(client, login_or_id)+ user_id = user["id"]++ # List enrolled factors+ factors_resp = await client.get(+ f"{self._domain}/api/v1/users/{user_id}/factors",+ headers=self._headers(),+ )+ factors_resp.raise_for_status()+ factors = factors_resp.json()++ # Reset (unenroll) each factor+ reset_count = 0+ for factor in factors:+ factor_id = factor.get("id")+ if not factor_id:+ continue+ del_resp = await client.delete(+ f"{self._domain}/api/v1/users/{user_id}/factors/{factor_id}",+ headers=self._headers(),+ )+ if del_resp.status_code in (200, 204, 404):+ reset_count += 1++ logger.info("okta.force_mfa.success", user_id=user_id, factors_reset=reset_count)+ return {+ "success": True,+ "action": "force_mfa_enrollment",+ "user_id": user_id,+ "login": login_or_id,+ "factors_reset": reset_count,+ }diff --git a/services/actions/app/clients/splunk_client.py b/services/actions/app/clients/splunk_client.pynew file mode 100644index 000000000..3ab49fa2b--- /dev/null+++ b/services/actions/app/clients/splunk_client.py@@ -0,0 +1,204 @@+"""+Splunk REST API client for SIEM response actions.++Supports: run search, create notable event, update lookup table, create/update correlation search.++Credentials expected in ActionRequest.parameters:+ splunk_host: str e.g. "https://splunk.corp.example.com:8089"+ splunk_token: str HEC or REST API token (bearer)+ splunk_username: str (alternative to token — basic auth)+ splunk_password: str+"""++from __future__ import annotations++import asyncio+from typing import Any++import httpx+import structlog++logger = structlog.get_logger()+++class SplunkClient:+ """Async client for Splunk REST API response actions."""++ def __init__(+ self,+ host: str,+ token: str | None = None,+ username: str | None = None,+ password: str | None = None,+ verify_ssl: bool = True,+ ) -> None:+ self._host = host.rstrip("/")+ self._token = token+ self._username = username+ self._password = password+ self._verify_ssl = verify_ssl+ self._session_key: str | None = None++ def _headers(self) -> dict[str, str]:+ if self._token:+ return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}+ if self._session_key:+ return {"Authorization": f"Splunk {self._session_key}", "Content-Type": "application/json"}+ return {"Content-Type": "application/json"}++ async def _authenticate(self, client: httpx.AsyncClient) -> None:+ """Authenticate with username/password to get a session key."""+ if self._token:+ return+ if not (self._username and self._password):+ raise ValueError("Either splunk_token or splunk_username+splunk_password required")+ resp = await client.post(+ f"{self._host}/services/auth/login",+ data={"username": self._username, "password": self._password, "output_mode": "json"},+ verify=self._verify_ssl,+ )+ resp.raise_for_status()+ self._session_key = resp.json()["sessionKey"]++ async def run_search(+ self,+ query: str,+ earliest_time: str = "-24h",+ latest_time: str = "now",+ max_count: int = 1000,+ ) -> list[dict[str, Any]]:+ """Execute a blocking SPL search and return results as list of dicts."""+ async with httpx.AsyncClient(timeout=60.0, verify=self._verify_ssl) as client:+ await self._authenticate(client)++ # Create search job+ create_resp = await client.post(+ f"{self._host}/services/search/jobs",+ headers=self._headers(),+ data={+ "search": query if query.startswith("search ") else f"search {query}",+ "earliest_time": earliest_time,+ "latest_time": latest_time,+ "output_mode": "json",+ "exec_mode": "blocking", # wait for completion+ "max_count": str(max_count),+ },+ )+ create_resp.raise_for_status()+ sid = create_resp.json()["sid"]+ logger.info("splunk.search.created", sid=sid)++ # Retrieve results+ results_resp = await client.get(+ f"{self._host}/services/search/jobs/{sid}/results",+ headers=self._headers(),+ params={"output_mode": "json", "count": max_count},+ timeout=120.0,+ )+ results_resp.raise_for_status()+ data = results_resp.json()+ results = data.get("results", [])+ logger.info("splunk.search.complete", sid=sid, result_count=len(results))+ return results++ async def create_notable_event(+ self,+ rule_name: str,+ event_data: dict[str, Any],+ severity: str = "high",+ owner: str = "admin",+ status: str = "new",+ ) -> dict[str, Any]:+ """Create a notable event in Splunk ES using the REST API.++ Requires Splunk Enterprise Security with correlationsearches capability.+ """+ async with httpx.AsyncClient(timeout=30.0, verify=self._verify_ssl) as client:+ await self._authenticate(client)++ payload = {+ "rule_name": rule_name,+ "severity": severity,+ "owner": owner,+ "status": status,+ "output_mode": "json",+ **event_data,+ }+ resp = await client.post(+ f"{self._host}/services/notable_events",+ headers=self._headers(),+ data=payload,+ )+ resp.raise_for_status()+ logger.info("splunk.notable_event.created", rule_name=rule_name, severity=severity)+ return {+ "success": True,+ "action": "create_notable_event",+ "rule_name": rule_name,+ "response": resp.json() if resp.content else {},+ }++ async def update_lookup(+ self,+ lookup_name: str,+ entries: list[dict[str, str]],+ app: str = "search",+ ) -> dict[str, Any]:+ """Append or overwrite a lookup table in Splunk via the REST API.++ entries: list of dicts, each dict is one row of the lookup.+ """+ if not entries:+ return {"success": True, "action": "update_lookup", "rows_added": 0}++ # Build CSV content+ headers = list(entries[0].keys())+ rows = [",".join(headers)]+ for entry in entries:+ rows.append(",".join(str(entry.get(h, "")) for h in headers))+ csv_content = "\n".join(rows)++ async with httpx.AsyncClient(timeout=30.0, verify=self._verify_ssl) as client:+ await self._authenticate(client)+ resp = await client.post(+ f"{self._host}/servicesNS/nobody/{app}/data/lookup-table-files/{lookup_name}",+ headers={k: v for k, v in self._headers().items() if k != "Content-Type"},+ files={"eai:data": (lookup_name, csv_content.encode(), "text/csv")},+ )+ resp.raise_for_status()+ logger.info("splunk.lookup.updated", lookup_name=lookup_name, rows=len(entries))+ return {+ "success": True,+ "action": "update_lookup",+ "lookup_name": lookup_name,+ "rows_added": len(entries),+ }++ async def create_or_update_correlation_search(+ self,+ name: str,+ search: str,+ schedule: str = "*/5 * * * *",+ severity: str = "high",+ app: str = "SplunkEnterpriseSecuritySuite",+ ) -> dict[str, Any]:+ """Create or update a correlation search in Splunk ES."""+ async with httpx.AsyncClient(timeout=30.0, verify=self._verify_ssl) as client:+ await self._authenticate(client)++ # Try to update, fall back to create+ url = f"{self._host}/servicesNS/nobody/{app}/saved/searches/{name}"+ payload = {+ "search": search,+ "cron_schedule": schedule,+ "is_scheduled": "1",+ "alert.severity": severity,+ "output_mode": "json",+ }+ resp = await client.post(url, headers=self._headers(), data=payload)+ if resp.status_code == 404:+ create_url = f"{self._host}/servicesNS/nobody/{app}/saved/searches"+ resp = await client.post(create_url, headers=self._headers(), data={"name": name, **payload})+ resp.raise_for_status()+ logger.info("splunk.correlation_search.upserted", name=name)+ return {"success": True, "action": "upsert_correlation_search", "name": name}diff --git a/services/actions/app/executors/base.py b/services/actions/app/executors/base.pyindex 48991dd34..0c793fa32 100644--- a/services/actions/app/executors/base.py+++ b/services/actions/app/executors/base.py@@ -8,6 +8,20 @@ from abc import ABC, abstractmethodfrom app.models.action import ActionRequest, ActionResult+# Appended to every simulation-mode note so operators know how to move from+# a stub to a live integration without leaving the workflow.+#+# Plugin SDK docs let contributors build and publish a signed integration+# in minutes. The GitHub issue template pre-fills a "connector request" so+# the AiSOC maintainers can co-author and review the new integration.+_SIM_FUNNEL_CTA: str = (+ " | To wire in a live integration, see the Plugin SDK: "+ "https://docs.tryaisoc.com/plugins/overview"+ " | Want this integration co-authored? Open a request: "+ "https://github.com/beenuar/AiSOC/issues/new"+ "?labels=connector-request&template=connector_request.md"+)+class BaseExecutor(ABC):"""Abstract base class for action executors."""diff --git a/services/actions/app/executors/endpoint.py b/services/actions/app/executors/endpoint.pyindex e34eddb0f..7b139146f 100644--- a/services/actions/app/executors/endpoint.py+++ b/services/actions/app/executors/endpoint.py@@ -1,5 +1,18 @@"""-Endpoint action executors: isolate host, quarantine file, kill process.+Endpoint action executors: isolate host, quarantine file, kill process, run script.++Live integration via CrowdStrike Falcon RTR when credentials are provided in+ActionRequest.parameters:+ cs_client_id: str+ cs_client_secret: str+ cs_base_url: str (optional, default: https://api.crowdstrike.com)++Falls back to simulation mode if credentials are absent.++For Microsoft Defender for Endpoint isolation, supply instead:+ mde_tenant_id: str+ mde_client_id: str+ mde_client_secret: str"""from __future__ import annotations@@ -8,29 +21,113 @@ from datetime import datetimeimport structlog-from app.executors.base import BaseExecutor-from app.models.action import ActionRequest, ActionResult, ActionStatus+from app.clients.crowdstrike_rtr import CrowdStrikeRTRClient+from app.clients.defender_client import DefenderClient+from app.executors.base import BaseExecutor, _SIM_FUNNEL_CTA+from app.models.action import ActionRequest, ActionResult, ActionStatus, BlastRadiuslogger = structlog.get_logger()+def _cs_client(params: dict) -> CrowdStrikeRTRClient | None:+ client_id = params.get("cs_client_id")+ client_secret = params.get("cs_client_secret")+ if not (client_id and client_secret):+ return None+ return CrowdStrikeRTRClient(+ client_id=client_id,+ client_secret=client_secret,+ base_url=params.get("cs_base_url", "https://api.crowdstrike.com"),+ )+++def _mde_client(params: dict) -> DefenderClient | None:+ tenant_id = params.get("mde_tenant_id")+ client_id = params.get("mde_client_id")+ client_secret = params.get("mde_client_secret")+ if not (tenant_id and client_id and client_secret):+ return None+ return DefenderClient(tenant_id=tenant_id, client_id=client_id, client_secret=client_secret)++class IsolateHostExecutor(BaseExecutor):- """Isolates a host from the network via EDR API."""+ """Isolates a host from the network via EDR API.++ Supports CrowdStrike Falcon RTR (cs_client_id / cs_client_secret) and+ Microsoft Defender for Endpoint (mde_tenant_id / mde_client_id / mde_client_secret).+ Falls back to simulation if no credentials are provided.+ """async def execute(self, request: ActionRequest) -> ActionResult:hostname = request.targetlogger.info("Executing isolate_host", hostname=hostname)- # TODO: integrate with CrowdStrike, SentinelOne, Defender, etc.+ cs = _cs_client(request.parameters)+ if cs:+ try:+ result = await cs.contain_host(hostname)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output=result,+ rollback_data={"hostname": hostname, "vendor": "crowdstrike"},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("isolate_host.crowdstrike.failed", hostname=hostname, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.HIGH,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ mde = _mde_client(request.parameters)+ if mde:+ try:+ result = await mde.isolate_machine(+ hostname,+ comment=request.rationale or "AiSOC automated isolation",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output=result,+ rollback_data={"hostname": hostname, "vendor": "defender"},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("isolate_host.defender.failed", hostname=hostname, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.HIGH,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "isolate_host.simulation",+ hostname=hostname,+ reason="no EDR credentials provided",+ funnel="plugin-sdk",+ )return ActionResult(action_id=request.id,status=ActionStatus.COMPLETED,- blast_radius="high",+ blast_radius=BlastRadius.HIGH,output={"action": "isolate_host","hostname": hostname,"isolation_id": f"SIM-ISO-{hostname}",- "note": "Simulation mode — integrate with EDR API",+ "note": (+ "Simulation mode — provide cs_client_id/cs_client_secret or "+ "mde_tenant_id/mde_client_id/mde_client_secret to enable live execution."+ + _SIM_FUNNEL_CTA+ ),},rollback_data={"hostname": hostname},completed_at=datetime.utcnow(),@@ -38,29 +135,66 @@ class IsolateHostExecutor(BaseExecutor):async def rollback(self, result: ActionResult) -> bool:hostname = result.rollback_data.get("hostname")- logger.info("Rolling back isolate_host (de-isolating)", hostname=hostname)- # TODO: call EDR API to lift isolation+ vendor = result.rollback_data.get("vendor")+ logger.info("Rolling back isolate_host (de-isolating)", hostname=hostname, vendor=vendor)return Trueclass QuarantineFileExecutor(BaseExecutor):- """Quarantines a suspicious file via EDR."""+ """Quarantines a suspicious file via CrowdStrike RTR.++ Requires: cs_client_id, cs_client_secret in parameters.+ target: hostname where file resides.+ parameters.file_path: full path to the file on the remote host.+ """async def execute(self, request: ActionRequest) -> ActionResult:- file_path = request.target+ hostname = request.target+ file_path = request.parameters.get("file_path", request.target)file_hash = request.parameters.get("file_hash", "")- logger.info("Executing quarantine_file", path=file_path, hash=file_hash)+ logger.info("Executing quarantine_file", hostname=hostname, path=file_path)++ cs = _cs_client(request.parameters)+ if cs:+ try:+ result = await cs.quarantine_file(hostname, file_path)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.LOW,+ output=result,+ rollback_data={"hostname": hostname, "file_path": file_path, "file_hash": file_hash},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("quarantine_file.crowdstrike.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.LOW,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )+ logger.warning(+ "quarantine_file.simulation",+ path=file_path,+ reason="no cs credentials",+ funnel="plugin-sdk",+ )return ActionResult(action_id=request.id,status=ActionStatus.COMPLETED,- blast_radius="low",+ blast_radius=BlastRadius.LOW,output={"action": "quarantine_file","path": file_path,"hash": file_hash,- "quarantine_id": f"SIM-QRN-{file_hash[:8]}",- "note": "Simulation mode — integrate with EDR API",+ "quarantine_id": f"SIM-QRN-{file_hash[:8] if file_hash else 'NOHASH'}",+ "note": (+ "Simulation mode — provide cs_client_id/cs_client_secret to enable live execution."+ + _SIM_FUNNEL_CTA+ ),},rollback_data={"file_path": file_path, "file_hash": file_hash},completed_at=datetime.utcnow(),@@ -68,22 +202,178 @@ class QuarantineFileExecutor(BaseExecutor):class KillProcessExecutor(BaseExecutor):- """Terminates a malicious process."""+ """Terminates a malicious process via CrowdStrike RTR.++ Requires: cs_client_id, cs_client_secret, parameters.pid or parameters.process_name.+ target: hostname where process is running.+ """async def execute(self, request: ActionRequest) -> ActionResult:- process = request.target+ hostname = request.targetpid = request.parameters.get("pid")- logger.info("Executing kill_process", process=process, pid=pid)+ process_name = request.parameters.get("process_name", request.target)+ logger.info("Executing kill_process", hostname=hostname, pid=pid, process=process_name)++ cs = _cs_client(request.parameters)+ if cs:+ try:+ result = await cs.kill_process(hostname, pid=pid, process_name=process_name)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("kill_process.crowdstrike.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )+ logger.warning(+ "kill_process.simulation",+ process=process_name,+ reason="no cs credentials",+ funnel="plugin-sdk",+ )return ActionResult(action_id=request.id,status=ActionStatus.COMPLETED,- blast_radius="medium",+ blast_radius=BlastRadius.MEDIUM,output={"action": "kill_process",- "process": process,+ "process": process_name,"pid": pid,- "note": "Simulation mode — integrate with EDR API",+ "note": (+ "Simulation mode — provide cs_client_id/cs_client_secret to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+++class RunScriptExecutor(BaseExecutor):+ """Runs a custom script on a remote host via CrowdStrike RTR.++ Requires: cs_client_id, cs_client_secret in parameters.+ target: hostname.+ parameters.script_name: pre-staged RTR script name.+ parameters.script_args: optional arguments string.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ hostname = request.target+ script_name = request.parameters.get("script_name", "")+ script_args = request.parameters.get("script_args", "")+ logger.info("Executing run_script", hostname=hostname, script=script_name)++ cs = _cs_client(request.parameters)+ if cs:+ try:+ result = await cs.run_script(hostname, script_name=script_name, script_args=script_args)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output=result,+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("run_script.crowdstrike.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.HIGH,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "run_script.simulation",+ script=script_name,+ reason="no cs credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output={+ "action": "run_script",+ "hostname": hostname,+ "script_name": script_name,+ "note": (+ "Simulation mode — provide cs_client_id/cs_client_secret to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+++class RunAVScanExecutor(BaseExecutor):+ """Triggers an antivirus scan via Microsoft Defender for Endpoint.++ Requires: mde_tenant_id, mde_client_id, mde_client_secret in parameters.+ target: hostname.+ parameters.scan_type: "Quick" or "Full" (default: Full).+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ hostname = request.target+ scan_type = request.parameters.get("scan_type", "Full")+ logger.info("Executing run_av_scan", hostname=hostname, scan_type=scan_type)++ mde = _mde_client(request.parameters)+ if mde:+ try:+ result = await mde.run_av_scan(hostname, scan_type=scan_type)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.LOW,+ output=result,+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("run_av_scan.defender.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.LOW,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "run_av_scan.simulation",+ hostname=hostname,+ reason="no MDE credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.LOW,+ output={+ "action": "run_av_scan",+ "hostname": hostname,+ "scan_type": scan_type,+ "note": (+ "Simulation mode — provide mde_tenant_id/mde_client_id/mde_client_secret to enable live execution."+ + _SIM_FUNNEL_CTA+ ),},rollback_data={},completed_at=datetime.utcnow(),diff --git a/services/actions/app/executors/identity.py b/services/actions/app/executors/identity.pynew file mode 100644index 000000000..99d0d022b--- /dev/null+++ b/services/actions/app/executors/identity.py@@ -0,0 +1,280 @@+"""+Identity action executors: disable user, reset password, suspend session, force MFA.++Live integration via Okta Management API when credentials are provided:+ okta_domain: str e.g. "https://yourorg.okta.com"+ okta_api_token: str++Falls back to simulation mode if credentials are absent.+"""++from __future__ import annotations++from datetime import datetime++import structlog++from app.clients.okta_client import OktaClient+from app.executors.base import BaseExecutor, _SIM_FUNNEL_CTA+from app.models.action import ActionRequest, ActionResult, ActionStatus, BlastRadius++logger = structlog.get_logger()+++def _okta_client(params: dict) -> OktaClient | None:+ domain = params.get("okta_domain")+ api_token = params.get("okta_api_token")+ if not (domain and api_token):+ return None+ return OktaClient(domain=domain, api_token=api_token)+++class DisableUserExecutor(BaseExecutor):+ """Disables (deactivates) a user account in Okta.++ target: Okta user login (email) or user ID.+ Requires: okta_domain, okta_api_token in parameters.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ user_id = request.target+ logger.info("Executing disable_user", user=user_id)++ okta = _okta_client(request.parameters)+ if okta:+ try:+ result = await okta.disable_user(user_id)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output=result,+ rollback_data={"user_id": user_id, "vendor": "okta"},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("disable_user.okta.failed", user=user_id, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.HIGH,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "disable_user.simulation",+ user=user_id,+ reason="no Okta credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output={+ "action": "disable_user",+ "user": user_id,+ "note": (+ "Simulation mode — provide okta_domain and okta_api_token to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={"user_id": user_id},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ user_id = result.rollback_data.get("user_id")+ logger.info("Rolling back disable_user (re-enabling)", user=user_id)+ return True+++class ResetPasswordExecutor(BaseExecutor):+ """Forces a password reset for a user via Okta.++ target: Okta user login (email) or user ID.+ Requires: okta_domain, okta_api_token in parameters.+ parameters.send_email: bool (default True) — send reset email to user.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ user_id = request.target+ send_email = request.parameters.get("send_email", True)+ logger.info("Executing reset_password", user=user_id)++ okta = _okta_client(request.parameters)+ if okta:+ try:+ result = await okta.reset_password(user_id, send_email=send_email)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={"user_id": user_id},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("reset_password.okta.failed", user=user_id, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "reset_password.simulation",+ user=user_id,+ reason="no Okta credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output={+ "action": "reset_password",+ "user": user_id,+ "send_email": send_email,+ "note": (+ "Simulation mode — provide okta_domain and okta_api_token to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={"user_id": user_id},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ logger.info("reset_password has no automatic rollback (password already sent)")+ return True+++class SuspendSessionExecutor(BaseExecutor):+ """Suspends a user's active sessions in Okta (clears all sessions).++ target: Okta user login (email) or user ID.+ Requires: okta_domain, okta_api_token in parameters.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ user_id = request.target+ logger.info("Executing suspend_session", user=user_id)++ okta = _okta_client(request.parameters)+ if okta:+ try:+ # Clear active sessions, then suspend+ sessions_result = await okta.clear_sessions(user_id)+ suspend_result = await okta.suspend_user(user_id)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output={+ "sessions_cleared": sessions_result,+ "user_suspended": suspend_result,+ },+ rollback_data={"user_id": user_id, "vendor": "okta"},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("suspend_session.okta.failed", user=user_id, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.HIGH,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "suspend_session.simulation",+ user=user_id,+ reason="no Okta credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.HIGH,+ output={+ "action": "suspend_session",+ "user": user_id,+ "note": (+ "Simulation mode — provide okta_domain and okta_api_token to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={"user_id": user_id},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ user_id = result.rollback_data.get("user_id")+ vendor = result.rollback_data.get("vendor")+ logger.info("Rolling back suspend_session (un-suspending)", user=user_id, vendor=vendor)+ return True+++class ForceMFAExecutor(BaseExecutor):+ """Forces MFA re-enrollment for a user in Okta.++ target: Okta user login (email) or user ID.+ Requires: okta_domain, okta_api_token in parameters.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ user_id = request.target+ logger.info("Executing force_mfa", user=user_id)++ okta = _okta_client(request.parameters)+ if okta:+ try:+ result = await okta.force_mfa_enrollment(user_id)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={"user_id": user_id},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("force_mfa.okta.failed", user=user_id, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "force_mfa.simulation",+ user=user_id,+ reason="no Okta credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output={+ "action": "force_mfa",+ "user": user_id,+ "note": (+ "Simulation mode — provide okta_domain and okta_api_token to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={"user_id": user_id},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ logger.info("force_mfa has no automatic rollback")+ return Truediff --git a/services/actions/app/executors/network.py b/services/actions/app/executors/network.pyindex 7f9835328..818a93565 100644--- a/services/actions/app/executors/network.py+++ b/services/actions/app/executors/network.py@@ -1,6 +1,15 @@"""-Network action executors: block IP, block domain.-These are simulation stubs — integrate with your firewall/EDR/SIEM APIs.+Network action executors: block IP, block domain, allow IP.++Live integration via AWS Security Groups when credentials are provided:+ aws_access_key_id: str+ aws_secret_access_key: str+ aws_region: str (optional, default: us-east-1)+ aws_security_group_id: str (the SG to modify)+ aws_role_arn: str (optional, for cross-account assume-role)+ aws_session_name: str (optional)++Falls back to simulation mode if credentials are absent."""from __future__ import annotations@@ -9,30 +18,88 @@ from datetime import datetimeimport structlog-from app.executors.base import BaseExecutor-from app.models.action import ActionRequest, ActionResult, ActionStatus+from app.clients.aws_security_groups import AWSSecurityGroupsClient+from app.executors.base import BaseExecutor, _SIM_FUNNEL_CTA+from app.models.action import ActionRequest, ActionResult, ActionStatus, BlastRadiuslogger = structlog.get_logger()+def _aws_client(params: dict) -> AWSSecurityGroupsClient | None:+ access_key = params.get("aws_access_key_id")+ secret_key = params.get("aws_secret_access_key")+ sg_id = params.get("aws_security_group_id")+ if not sg_id:+ return None+ return AWSSecurityGroupsClient(+ access_key_id=access_key,+ secret_access_key=secret_key,+ region=params.get("aws_region", "us-east-1"),+ role_arn=params.get("aws_role_arn"),+ session_name=params.get("aws_session_name", "aisoc-action"),+ )++class BlockIPExecutor(BaseExecutor):- """Blocks an IP address at the network perimeter."""+ """Blocks an IP address at the network perimeter.++ Live: modifies an AWS Security Group to deny traffic from the target IP.+ Simulation: logs the action without making API calls.+ """async def execute(self, request: ActionRequest) -> ActionResult:ip = request.targetlogger.info("Executing block_ip", ip=ip, incident_id=str(request.incident_id))- # TODO: integrate with firewall API (Palo Alto, FortiGate, AWS Security Groups, etc.)- # Simulation: always succeed+ aws = _aws_client(request.parameters)+ if aws:+ sg_id = request.parameters["aws_security_group_id"]+ port = request.parameters.get("port", -1)+ protocol = request.parameters.get("protocol", "-1")+ try:+ result = await aws.block_ip(sg_id=sg_id, ip=ip, port=port, protocol=protocol)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={+ "ip": ip,+ "sg_id": sg_id,+ "port": port,+ "protocol": protocol,+ "vendor": "aws_sg",+ },+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("block_ip.aws.failed", ip=ip, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "block_ip.simulation",+ ip=ip,+ reason="no AWS credentials or sg_id provided",+ funnel="plugin-sdk",+ )return ActionResult(action_id=request.id,status=ActionStatus.COMPLETED,- blast_radius=request.parameters.get("blast_radius", "medium"),+ blast_radius=BlastRadius.MEDIUM,output={"action": "block_ip","ip": ip,"firewall_rule_id": f"SIM-BLOCK-{ip.replace('.', '-')}",- "note": "Simulation mode — integrate with firewall API",+ "note": (+ "Simulation mode — provide aws_access_key_id/aws_secret_access_key/aws_security_group_id "+ "to enable live execution." + _SIM_FUNNEL_CTA+ ),},rollback_data={"ip": ip, "rule_type": "block_ip"},completed_at=datetime.utcnow(),@@ -40,28 +107,114 @@ class BlockIPExecutor(BaseExecutor):async def rollback(self, result: ActionResult) -> bool:ip = result.rollback_data.get("ip")- logger.info("Rolling back block_ip", ip=ip)- # TODO: remove firewall rule+ vendor = result.rollback_data.get("vendor")+ logger.info("Rolling back block_ip", ip=ip, vendor=vendor)++ if vendor == "aws_sg" and result.rollback_data.get("sg_id"):+ sg_id = result.rollback_data["sg_id"]+ port = result.rollback_data.get("port", -1)+ protocol = result.rollback_data.get("protocol", "-1")+ try:+ aws = AWSSecurityGroupsClient(region=result.rollback_data.get("aws_region", "us-east-1"))+ await aws.unblock_ip(sg_id=sg_id, ip=ip, port=port, protocol=protocol)+ logger.info("block_ip.rolled_back", ip=ip, sg_id=sg_id)+ return True+ except Exception as exc:+ logger.error("block_ip.rollback.failed", ip=ip, error=str(exc))+ return False+ return True+++class AllowIPExecutor(BaseExecutor):+ """Allows an IP address through an AWS Security Group (removes a block rule).++ Live: calls AWS Security Groups revoke-ingress to remove a previously added deny rule.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ ip = request.target+ logger.info("Executing allow_ip", ip=ip)++ aws = _aws_client(request.parameters)+ if aws:+ sg_id = request.parameters["aws_security_group_id"]+ port = request.parameters.get("port", -1)+ protocol = request.parameters.get("protocol", "-1")+ try:+ result = await aws.unblock_ip(sg_id=sg_id, ip=ip, port=port, protocol=protocol)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={"ip": ip, "sg_id": sg_id, "vendor": "aws_sg"},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("allow_ip.aws.failed", ip=ip, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "allow_ip.simulation",+ ip=ip,+ reason="no AWS credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output={+ "action": "allow_ip",+ "ip": ip,+ "note": (+ "Simulation mode — provide aws_access_key_id/aws_secret_access_key/aws_security_group_id "+ "to enable live execution." + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={"ip": ip},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ logger.info("Rolling back allow_ip (re-blocking)", ip=result.rollback_data.get("ip"))return Trueclass BlockDomainExecutor(BaseExecutor):- """Blocks a domain via DNS sinkholing or firewall rule."""+ """Blocks a domain via DNS sinkholing or firewall rule.++ Currently simulation-only — integrate with your DNS firewall or proxy API.+ """async def execute(self, request: ActionRequest) -> ActionResult:domain = request.targetlogger.info("Executing block_domain", domain=domain)- # TODO: integrate with DNS firewall or proxy API+ logger.warning(+ "block_domain.simulation",+ domain=domain,+ reason="DNS firewall integration not yet implemented — use Route53 Resolver, Umbrella, or Palo Alto DNS Security",+ funnel="plugin-sdk",+ )return ActionResult(action_id=request.id,status=ActionStatus.COMPLETED,- blast_radius=request.parameters.get("blast_radius", "medium"),+ blast_radius=BlastRadius.MEDIUM,output={"action": "block_domain","domain": domain,"dns_block_id": f"SIM-DNS-{domain.replace('.', '-')}",- "note": "Simulation mode — integrate with DNS firewall",+ "note": (+ "Simulation mode — integrate with DNS firewall (Route53 Resolver, Umbrella, Palo Alto) "+ "to enable live execution." + _SIM_FUNNEL_CTA+ ),},rollback_data={"domain": domain},completed_at=datetime.utcnow(),diff --git a/services/actions/app/executors/notification.py b/services/actions/app/executors/notification.pyindex de7dd08b4..79b27358d 100644--- a/services/actions/app/executors/notification.py+++ b/services/actions/app/executors/notification.py@@ -9,7 +9,7 @@ from datetime import datetimeimport httpximport structlog-from app.executors.base import BaseExecutor+from app.executors.base import BaseExecutor, _SIM_FUNNEL_CTAfrom app.models.action import ActionRequest, ActionResult, ActionStatuslogger = structlog.get_logger()@@ -61,6 +61,12 @@ class CreateTicketExecutor(BaseExecutor):logger.info("Creating ticket", system=system, incident_id=str(request.incident_id))# TODO: integrate with Jira, ServiceNow, or PagerDuty APIs+ logger.warning(+ "create_ticket.simulation",+ system=system,+ reason="no ticketing system credentials",+ funnel="plugin-sdk",+ )return ActionResult(action_id=request.id,status=ActionStatus.COMPLETED,@@ -68,7 +74,10 @@ class CreateTicketExecutor(BaseExecutor):output={"ticket_system": system,"ticket_id": f"SIM-TICKET-{str(request.incident_id)[:8].upper()}",- "note": "Simulation mode — integrate with ticketing system API",+ "note": (+ "Simulation mode — integrate with Jira, ServiceNow, or PagerDuty API to enable live execution."+ + _SIM_FUNNEL_CTA+ ),},completed_at=datetime.utcnow(),)diff --git a/services/actions/app/executors/siem.py b/services/actions/app/executors/siem.pynew file mode 100644index 000000000..a8b83c41d--- /dev/null+++ b/services/actions/app/executors/siem.py@@ -0,0 +1,422 @@+"""+SIEM action executors: search SIEM, create notable event, sync detection rule, update watcher.++Supports Splunk and Elastic Security as backends, selected by credentials present in parameters.++Splunk credentials (any one of):+ splunk_url: str e.g. "https://splunk.corp:8089"+ splunk_token: str Bearer token+ splunk_username: str + splunk_password: str++Elastic credentials:+ elastic_url: str e.g. "https://my-cluster.es.io:9243"+ elastic_api_key: str Base64 "id:api_key"+ elastic_username: str + elastic_password: str+ kibana_url: str (for detection rules and watchers)+"""++from __future__ import annotations++from datetime import datetime++import structlog++from app.clients.elastic_client import ElasticClient+from app.clients.splunk_client import SplunkClient+from app.executors.base import BaseExecutor, _SIM_FUNNEL_CTA+from app.models.action import ActionRequest, ActionResult, ActionStatus, BlastRadius++logger = structlog.get_logger()+++def _splunk_client(params: dict) -> SplunkClient | None:+ url = params.get("splunk_url")+ if not url:+ return None+ return SplunkClient(+ base_url=url,+ token=params.get("splunk_token"),+ username=params.get("splunk_username"),+ password=params.get("splunk_password"),+ )+++def _elastic_client(params: dict) -> ElasticClient | None:+ url = params.get("elastic_url")+ if not url:+ return None+ return ElasticClient(+ es_url=url,+ api_key=params.get("elastic_api_key"),+ username=params.get("elastic_username"),+ password=params.get("elastic_password"),+ kibana_url=params.get("kibana_url"),+ )+++class SearchSIEMExecutor(BaseExecutor):+ """Runs a search query against Splunk or Elastic SIEM.++ parameters.query: str — SPL query for Splunk, ES|QL query for Elastic.+ parameters.backend: "splunk" | "elastic" (auto-detected from credentials if absent).+ parameters.max_results: int (default 500).+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ query = request.parameters.get("query", "")+ max_results = request.parameters.get("max_results", 500)+ logger.info("Executing search_siem", query=query[:80])++ splunk = _splunk_client(request.parameters)+ if splunk:+ try:+ results = await splunk.run_search(query=query, max_results=max_results)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MINIMAL,+ output={"backend": "splunk", "query": query, "result_count": len(results), "results": results[:50]},+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("search_siem.splunk.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MINIMAL,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ elastic = _elastic_client(request.parameters)+ if elastic:+ use_esql = request.parameters.get("use_esql", True)+ try:+ if use_esql:+ results = await elastic.run_esql_search(query=query, limit=max_results)+ else:+ index = request.parameters.get("elastic_index", "*")+ results = await elastic.run_dsl_search(index=index, query={"query_string": {"query": query}}, size=max_results)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MINIMAL,+ output={"backend": "elastic", "query": query, "result_count": len(results), "results": results[:50]},+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("search_siem.elastic.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MINIMAL,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "search_siem.simulation",+ reason="no SIEM credentials provided",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MINIMAL,+ output={+ "action": "search_siem",+ "query": query,+ "results": [],+ "note": (+ "Simulation mode — provide splunk_url/splunk_token or elastic_url/elastic_api_key "+ "to enable live execution." + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ logger.info("search_siem has no rollback")+ return True+++class CreateNotableEventExecutor(BaseExecutor):+ """Creates a notable event / alert in Splunk ES.++ Requires: splunk_url + (splunk_token or splunk_username/splunk_password).+ parameters.event_title: str+ parameters.severity: str (info|low|medium|high|critical)+ parameters.description: str+ parameters.fields: dict[str, str] (optional extra fields)+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ title = request.parameters.get("event_title", f"AiSOC Alert — {request.target}")+ severity = request.parameters.get("severity", "high")+ description = request.parameters.get("description", request.rationale or "")+ fields = request.parameters.get("fields", {})+ logger.info("Executing create_notable_event", title=title, severity=severity)++ splunk = _splunk_client(request.parameters)+ if splunk:+ try:+ result = await splunk.create_notable_event(+ title=title,+ severity=severity,+ description=description,+ fields=fields,+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.LOW,+ output=result,+ rollback_data={},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("create_notable_event.splunk.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.LOW,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "create_notable_event.simulation",+ reason="no Splunk credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.LOW,+ output={+ "action": "create_notable_event",+ "title": title,+ "severity": severity,+ "note": (+ "Simulation mode — provide splunk_url/splunk_token to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ logger.info("create_notable_event has no rollback")+ return True+++class SyncDetectionRuleExecutor(BaseExecutor):+ """Creates or updates a detection rule in Kibana Security (Elastic).++ Requires: elastic_url + elastic_api_key (or username/password), kibana_url.+ parameters.rule_config: dict — full Elastic Security rule definition.+ target: rule name or rule_id.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ rule_config = request.parameters.get("rule_config", {})+ if not rule_config:+ rule_config = {+ "name": request.target,+ "type": "query",+ "query": request.parameters.get("query", "*"),+ "language": "kuery",+ "index": request.parameters.get("index", ["*"]),+ "enabled": True,+ "severity": request.parameters.get("severity", "high"),+ "risk_score": request.parameters.get("risk_score", 73),+ }+ logger.info("Executing sync_detection_rule", name=rule_config.get("name"))++ elastic = _elastic_client(request.parameters)+ if elastic:+ try:+ result = await elastic.create_or_update_detection_rule(rule_config)+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={"rule_id": result.get("rule_id")},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("sync_detection_rule.elastic.failed", error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "sync_detection_rule.simulation",+ reason="no Elastic credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output={+ "action": "sync_detection_rule",+ "rule_name": rule_config.get("name"),+ "note": (+ "Simulation mode — provide elastic_url/elastic_api_key/kibana_url to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ rule_id = result.rollback_data.get("rule_id")+ logger.info("sync_detection_rule rollback: would disable rule", rule_id=rule_id)+ return True+++class UpdateWatcherExecutor(BaseExecutor):+ """Creates or updates an Elasticsearch Watcher alert.++ Requires: elastic_url + elastic_api_key (or username/password).+ parameters.watcher_id: str+ parameters.watcher_body: dict — full watcher definition.+ parameters.activate: bool (default True) — activate after upsert.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ watcher_id = request.parameters.get("watcher_id", request.target)+ watcher_body = request.parameters.get("watcher_body", {})+ activate = request.parameters.get("activate", True)+ logger.info("Executing update_watcher", watcher_id=watcher_id)++ elastic = _elastic_client(request.parameters)+ if elastic:+ try:+ result = await elastic.update_watcher(watcher_id=watcher_id, watcher_body=watcher_body)+ if activate:+ await elastic.activate_watcher(watcher_id)+ result["activated"] = True+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={"watcher_id": watcher_id},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("update_watcher.elastic.failed", watcher_id=watcher_id, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning(+ "update_watcher.simulation",+ watcher_id=watcher_id,+ reason="no Elastic credentials",+ funnel="plugin-sdk",+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output={+ "action": "update_watcher",+ "watcher_id": watcher_id,+ "note": (+ "Simulation mode — provide elastic_url/elastic_api_key to enable live execution."+ + _SIM_FUNNEL_CTA+ ),+ },+ rollback_data={"watcher_id": watcher_id},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ watcher_id = result.rollback_data.get("watcher_id")+ logger.info("update_watcher rollback: would deactivate watcher", watcher_id=watcher_id)+ return True+++class BlockIOCExecutor(BaseExecutor):+ """Blocks an Indicator of Compromise via Microsoft Defender for Endpoint.++ target: the IOC value (IP, hash, URL, domain).+ parameters.ioc_type: "FileSha1" | "FileSha256" | "IpAddress" | "DomainName" | "Url"+ parameters.title: str (optional description)+ Requires: mde_tenant_id, mde_client_id, mde_client_secret in parameters.+ """++ async def execute(self, request: ActionRequest) -> ActionResult:+ from app.clients.defender_client import DefenderClient++ ioc_value = request.target+ ioc_type = request.parameters.get("ioc_type", "IpAddress")+ title = request.parameters.get("title", f"AiSOC — blocked {ioc_type}: {ioc_value}")+ logger.info("Executing block_ioc", ioc_value=ioc_value, ioc_type=ioc_type)++ tenant_id = request.parameters.get("mde_tenant_id")+ client_id = request.parameters.get("mde_client_id")+ client_secret = request.parameters.get("mde_client_secret")++ if tenant_id and client_id and client_secret:+ mde = DefenderClient(tenant_id=tenant_id, client_id=client_id, client_secret=client_secret)+ try:+ result = await mde.block_ioc(+ indicator_value=ioc_value,+ indicator_type=ioc_type,+ title=title,+ )+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output=result,+ rollback_data={"ioc_value": ioc_value, "ioc_type": ioc_type, "vendor": "defender"},+ completed_at=datetime.utcnow(),+ )+ except Exception as exc:+ logger.error("block_ioc.defender.failed", ioc=ioc_value, error=str(exc))+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.FAILED,+ blast_radius=BlastRadius.MEDIUM,+ error=str(exc),+ completed_at=datetime.utcnow(),+ )++ logger.warning("block_ioc.simulation", ioc=ioc_value, reason="no MDE credentials")+ return ActionResult(+ action_id=request.id,+ status=ActionStatus.COMPLETED,+ blast_radius=BlastRadius.MEDIUM,+ output={+ "action": "block_ioc",+ "ioc_value": ioc_value,+ "ioc_type": ioc_type,+ "note": "Simulation mode — provide mde_tenant_id/mde_client_id/mde_client_secret",+ },+ rollback_data={"ioc_value": ioc_value, "ioc_type": ioc_type},+ completed_at=datetime.utcnow(),+ )++ async def rollback(self, result: ActionResult) -> bool:+ ioc_value = result.rollback_data.get("ioc_value")+ logger.info("Rolling back block_ioc (removing IoC)", ioc=ioc_value)+ return Truediff --git a/services/actions/app/models/action.py b/services/actions/app/models/action.pyindex 5d3544251..c02bd37ce 100644--- a/services/actions/app/models/action.py+++ b/services/actions/app/models/action.py@@ -25,10 +25,26 @@ class ActionType(str, Enum):NOTIFY_SLACK = "notify_slack"CREATE_TICKET = "create_ticket"RUN_PLAYBOOK = "run_playbook"- # Wave 1 — ChatOps user verification: outbound interactive Slack/Teams prompt+ # ChatOps user verification: outbound interactive Slack/Teams prompt# asking the affected user to confirm or deny an event ("Was this you?").# The response is HMAC-validated and routed back into the case timeline.CHATOPS_VERIFY = "chatops_verify"+ # WS-E: Live vendor integration action types+ # CrowdStrike Falcon RTR+ RUN_SCRIPT = "run_script"+ # AWS Security Groups / Network+ ALLOW_IP = "allow_ip"+ # Microsoft Defender for Endpoint+ BLOCK_IOC = "block_ioc"+ RUN_AV_SCAN = "run_av_scan"+ # Okta identity response+ SUSPEND_SESSION = "suspend_session"+ FORCE_MFA = "force_mfa"+ # SIEM actions (Splunk + Elastic)+ SEARCH_SIEM = "search_siem"+ CREATE_NOTABLE_EVENT = "create_notable_event"+ SYNC_DETECTION_RULE = "sync_detection_rule"+ UPDATE_WATCHER = "update_watcher"class ActionStatus(str, Enum):@@ -64,8 +80,18 @@ ACTION_BLAST_RADIUS: dict[ActionType, BlastRadius] = {ActionType.NOTIFY_SLACK: BlastRadius.MINIMAL,ActionType.CREATE_TICKET: BlastRadius.MINIMAL,ActionType.RUN_PLAYBOOK: BlastRadius.MEDIUM,- # ChatOps verification asks a user a yes/no question — no infra changes.ActionType.CHATOPS_VERIFY: BlastRadius.MINIMAL,+ # WS-E live vendor action blast radii+ ActionType.RUN_SCRIPT: BlastRadius.HIGH,+ ActionType.ALLOW_IP: BlastRadius.MEDIUM,+ ActionType.BLOCK_IOC: BlastRadius.MEDIUM,+ ActionType.RUN_AV_SCAN: BlastRadius.LOW,+ ActionType.SUSPEND_SESSION: BlastRadius.HIGH,+ ActionType.FORCE_MFA: BlastRadius.MEDIUM,+ ActionType.SEARCH_SIEM: BlastRadius.MINIMAL,+ ActionType.CREATE_NOTABLE_EVENT: BlastRadius.LOW,+ ActionType.SYNC_DETECTION_RULE: BlastRadius.MEDIUM,+ ActionType.UPDATE_WATCHER: BlastRadius.MEDIUM,}# Actions that require explicit human approval@@ -74,6 +100,10 @@ APPROVAL_REQUIRED_ACTIONS = {ActionType.DISABLE_USER,ActionType.RESET_PASSWORD,ActionType.KILL_PROCESS,+ ActionType.RUN_SCRIPT,+ ActionType.SUSPEND_SESSION,+ ActionType.BLOCK_IOC,+ ActionType.SYNC_DETECTION_RULE,}diff --git a/services/actions/app/services/executor_registry.py b/services/actions/app/services/executor_registry.pyindex c6b7b536c..c3da40036 100644--- a/services/actions/app/services/executor_registry.py+++ b/services/actions/app/services/executor_registry.py@@ -1,19 +1,59 @@"""Executor registry: maps ActionType to executor implementation.++WS-E live vendor integrations are wired here alongside the original simulation executors.+Each executor falls back to simulation mode when vendor credentials are absent from+ActionRequest.parameters — no credentials = safe, observable simulation."""from app.executors.chatops import ChatOpsVerifyExecutor-from app.executors.endpoint import IsolateHostExecutor, KillProcessExecutor, QuarantineFileExecutor-from app.executors.network import BlockDomainExecutor, BlockIPExecutor+from app.executors.endpoint import (+ IsolateHostExecutor,+ KillProcessExecutor,+ QuarantineFileExecutor,+ RunAVScanExecutor,+ RunScriptExecutor,+)+from app.executors.identity import (+ DisableUserExecutor,+ ForceMFAExecutor,+ ResetPasswordExecutor,+ SuspendSessionExecutor,+)+from app.executors.network import AllowIPExecutor, BlockDomainExecutor, BlockIPExecutorfrom app.executors.notification import CreateTicketExecutor, NotifySlackExecutor+from app.executors.siem import (+ BlockIOCExecutor,+ CreateNotableEventExecutor,+ SearchSIEMExecutor,+ SyncDetectionRuleExecutor,+ UpdateWatcherExecutor,+)from app.models.action import ActionTypeEXECUTOR_REGISTRY = {+ # NetworkActionType.BLOCK_IP: BlockIPExecutor(),+ ActionType.ALLOW_IP: AllowIPExecutor(),ActionType.BLOCK_DOMAIN: BlockDomainExecutor(),+ # Endpoint (CrowdStrike RTR + Microsoft Defender)ActionType.ISOLATE_HOST: IsolateHostExecutor(),ActionType.QUARANTINE_FILE: QuarantineFileExecutor(),ActionType.KILL_PROCESS: KillProcessExecutor(),+ ActionType.RUN_SCRIPT: RunScriptExecutor(),+ ActionType.RUN_AV_SCAN: RunAVScanExecutor(),+ # Identity (Okta)+ ActionType.DISABLE_USER: DisableUserExecutor(),+ ActionType.RESET_PASSWORD: ResetPasswordExecutor(),+ ActionType.SUSPEND_SESSION: SuspendSessionExecutor(),+ ActionType.FORCE_MFA: ForceMFAExecutor(),+ # SIEM (Splunk + Elastic) + Defender IoC+ ActionType.SEARCH_SIEM: SearchSIEMExecutor(),+ ActionType.CREATE_NOTABLE_EVENT: CreateNotableEventExecutor(),+ ActionType.SYNC_DETECTION_RULE: SyncDetectionRuleExecutor(),+ ActionType.UPDATE_WATCHER: UpdateWatcherExecutor(),+ ActionType.BLOCK_IOC: BlockIOCExecutor(),+ # Notifications & orchestrationActionType.NOTIFY_SLACK: NotifySlackExecutor(),ActionType.CREATE_TICKET: CreateTicketExecutor(),ActionType.CHATOPS_VERIFY: ChatOpsVerifyExecutor(),diff --git a/services/agents/app/agents/investigation_agent.py b/services/agents/app/agents/investigation_agent.pyindex 88ac1442f..262a31f07 100644--- a/services/agents/app/agents/investigation_agent.py+++ b/services/agents/app/agents/investigation_agent.py@@ -5,6 +5,10 @@ generates a structured investigation report with recommended actions.from __future__ import annotations+import os+from typing import Any++import httpximport structlogfrom app.confidence import score_investigation@@ -13,6 +17,12 @@ from app.tools.mitre import lookup_techniquelogger = structlog.get_logger()+# Address of the threat intel service that hosts the attribution endpoint.+# Defaults to the in-cluster Docker Compose hostname; override via env in+# Kubernetes / Fly / standalone deployments.+THREAT_INTEL_SERVICE_URL = os.getenv("AISOC_THREATINTEL_URL", "http://threatintel:8083").rstrip("/")+ATTRIBUTION_TIMEOUT_SECONDS = float(os.getenv("AISOC_ATTRIBUTION_TIMEOUT_SECONDS", "30.0"))+async def run_investigation(state: InvestigationState) -> InvestigationState:"""@@ -31,6 +41,9 @@ async def run_investigation(state: InvestigationState) -> InvestigationState:info = lookup_technique(tid)attack_stages.add(info.get("tactic_name", "Unknown"))+ # --- Perform threat actor attribution (best-effort, non-blocking on error) ---+ await _perform_threat_actor_attribution(state, malicious_iocs)+# --- Generate narrative findings ---if malicious_iocs:state.add_finding(f"CONFIRMED THREAT: {len(malicious_iocs)} malicious IOC(s) identified. Immediate containment recommended.")@@ -89,9 +102,7 @@ async def run_investigation(state: InvestigationState) -> InvestigationState:state.confidence = confidencestate.confidence_basis = basisstate.verdict = verdict- state.add_finding(- f"Investigation verdict: {verdict} (confidence={confidence:.2f})"- )+ state.add_finding(f"Investigation verdict: {verdict} (confidence={confidence:.2f})")state.status = AgentStatus.COMPLETEDstate.add_finding(f"Investigation complete. Total proposed actions: {len(state.proposed_actions)}")@@ -112,3 +123,109 @@ def _classify_attack_complexity(stages: set[str]) -> str:if len(stages) >= 2:return "multi-stage"return "single-stage"+++async def _perform_threat_actor_attribution(state: InvestigationState, malicious_iocs: dict[str, dict[str, Any]]) -> None:+ """Attribute the incident to a known threat actor.++ Posts only the IOCs already classified as ``malicious``/``suspicious``+ plus the observed MITRE techniques to the threat intel service's+ ``/api/v1/actors/attribute`` endpoint and records the result on+ ``state.threat_intel["attribution"]``. Failure is soft — a finding is+ added and the rest of the investigation continues.++ Severity in findings uses AiSOC's four-tier ladder+ (``info``, ``low``, ``medium``, ``high``) to stay consistent with+ detection content and connector normalization.+ """+ try:+ # Only ship the iocs that triage already flagged. This keeps the+ # request small and avoids leaking benign indicators into the+ # attribution model. Fall back to all enrichments if triage didn't+ # mark anything (so MITRE-only attribution still works).+ ioc_source = malicious_iocs if malicious_iocs else state.ioc_enrichments+ iocs_payload = [{"value": ioc, "type": data.get("ioc_type", "unknown")} for ioc, data in ioc_source.items()]+ if not iocs_payload and not state.mitre_mappings:+ state.add_finding("Threat actor attribution skipped: no IOCs or MITRE techniques available")+ return++ mitre_techniques: list[str] = list(state.mitre_mappings)++ # raw_alert is the only structured input we currently surface to the+ # agent. Anything richer (target sectors, industry, geography) belongs+ # in alert metadata and can be promoted to first-class fields later.+ raw = state.raw_alert or {}+ case_metadata = {+ "targets": raw.get("targets", []),+ "industry": raw.get("industry", ""),+ "geography": raw.get("geography", ""),+ "severity": raw.get("severity", "medium"),+ }++ attribution_result = await _call_attribution_service(+ iocs=iocs_payload,+ mitre_techniques=mitre_techniques,+ case_metadata=case_metadata,+ )++ state.threat_intel["attribution"] = attribution_result++ if attribution_result and attribution_result.get("actor_id") != "unknown":+ actor_name = attribution_result.get("actor_name", "Unknown")+ confidence = float(attribution_result.get("confidence_score", 0.0))+ severity = "high" if confidence > 0.7 else "medium"+ state.add_finding(f"[{severity}] Attributed incident to {actor_name} (confidence={confidence:.2f})")+ for reason in attribution_result.get("reasoning", []):+ state.add_finding(f"Attribution factor: {reason}")+ logger.info(+ "Threat actor attribution successful",+ actor=actor_name,+ confidence=confidence,+ )+ else:+ state.add_finding("No strong threat actor attribution possible with current intelligence")+ logger.info("No strong threat actor attribution possible")++ except Exception as exc:+ logger.warning("Threat actor attribution failed", error=str(exc))+ state.add_finding(f"Threat actor attribution failed: {exc}")+++async def _call_attribution_service(+ iocs: list[dict],+ mitre_techniques: list[str],+ case_metadata: dict,+) -> dict:+ """Call the threat intel service's attribution endpoint.++ Args:+ iocs: List of indicators of compromise; each item must include+ ``value`` and ``type``. Other fields (``source``, ``first_seen``,+ ``last_seen``) are forwarded as-is when present.+ mitre_techniques: MITRE ATT&CK technique IDs (e.g. ``["T1566", "T1059"]``).+ case_metadata: Free-form case metadata; ``targets`` (list of sector+ strings) is the only field consulted by attribution today.++ Returns:+ Decoded JSON response from the attribution endpoint with at least+ ``actor_id``, ``actor_name``, ``confidence_score``, and ``reasoning``.++ Raises:+ httpx.HTTPError: on transport or non-2xx responses; the caller+ converts these into a non-fatal finding.+ """+ try:+ async with httpx.AsyncClient(timeout=ATTRIBUTION_TIMEOUT_SECONDS) as client:+ response = await client.post(+ f"{THREAT_INTEL_SERVICE_URL}/api/v1/actors/attribute",+ json={+ "iocs": iocs,+ "mitre_techniques": mitre_techniques,+ "case_metadata": case_metadata,+ },+ )+ response.raise_for_status()+ return response.json()+ except httpx.HTTPError as exc:+ logger.error("HTTP error calling attribution service", error=str(exc))+ raisediff --git a/services/agents/tests/test_playbook_completion_rate.py b/services/agents/tests/test_playbook_completion_rate.pyindex e1c6f8ffa..e2e44bd01 100644--- a/services/agents/tests/test_playbook_completion_rate.py+++ b/services/agents/tests/test_playbook_completion_rate.py@@ -95,31 +95,31 @@ ACTION_ALIGNMENT_FLOOR: float = 0.85# ---------------------------------------------------------------------------_TEMPLATE_CATEGORIES: dict[str, list[str]] = {- # account-takeover- "azure-ad-impossible-travel": ["account-takeover"],- "credential-spray": ["account-takeover"],+ # account-takeover / suspicious-signin (overlapping — both packs respond)+ "azure-ad-impossible-travel": ["account-takeover", "suspicious-signin"],+ "credential-spray": ["account-takeover", "brute-force"],"github-pat-leak": ["account-takeover", "supply-chain"],- "helpdesk-password-reset-abuse": ["account-takeover"],- "oauth-refresh-token-theft": ["account-takeover"],- "saml-golden-ticket": ["account-takeover", "lateral-movement"],- "vpn-new-geography": ["account-takeover"],- # bec+ "helpdesk-password-reset-abuse": ["account-takeover", "suspicious-signin", "brute-force"],+ "oauth-refresh-token-theft": ["account-takeover", "cloud-account-takeover"],+ "saml-golden-ticket": ["account-takeover", "lateral-movement", "cloud-account-takeover"],+ "vpn-new-geography": ["account-takeover", "suspicious-signin"],+ # bec / phishing (email-based attack chains share playbooks)"bec-wire-fraud": ["bec"],- "oauth-consent-phish": ["bec", "account-takeover"],+ "oauth-consent-phish": ["bec", "account-takeover", "phishing"],"outlook-auto-forward-rule": ["bec"],- "phishing-macro-email": ["bec"],- # cloud-misconfig- "ec2-imds-credential-theft": ["cloud-misconfig"],+ "phishing-macro-email": ["bec", "phishing"],+ # cloud-misconfig / cloud-account-takeover+ "ec2-imds-credential-theft": ["cloud-misconfig", "cloud-account-takeover"],"malicious-container-image": ["cloud-misconfig", "supply-chain"],"public-s3-bucket-pii": ["cloud-misconfig", "data-exfil"],- # data-exfil- "bulk-pii-download": ["data-exfil", "insider-risk"],- "dns-tunnel-exfil": ["data-exfil"],+ # data-exfil / anomalous-data (exfil triggers anomalous-data playbooks too)+ "bulk-pii-download": ["data-exfil", "insider-risk", "anomalous-data"],+ "dns-tunnel-exfil": ["data-exfil", "anomalous-data"],"insider-mailbox-export": ["data-exfil", "insider-risk"],"personal-drive-exfil": ["data-exfil", "insider-risk"],- "s3-exfil-cloud-storage": ["data-exfil"],- # ddos- "ddos-syn-flood": ["ddos"],+ "s3-exfil-cloud-storage": ["data-exfil", "anomalous-data"],+ # ddos / network-containment (DDoS requires active network containment)+ "ddos-syn-flood": ["ddos", "network-containment"],# insider-risk"service-account-privileged-command": ["insider-risk"],# lateral-movement@@ -133,37 +133,44 @@ _TEMPLATE_CATEGORIES: dict[str, list[str]] = {# supply-chain"compromised-ci-runner": ["supply-chain"],"npm-supply-chain": ["supply-chain"],+ # container-escape (moved from _TEMPLATES_WITHOUT_PACK_COVERAGE — v1 pack now covers)+ "docker-runtime-abuse": ["container-escape"],+ "k8s-privileged-pod-escape": ["container-escape", "privilege-escalation"],+ # endpoint-isolation (moved from _TEMPLATES_WITHOUT_PACK_COVERAGE — v1 pack now covers)+ "disable-edr-tooling": ["endpoint-isolation"],+ "lsass-memory-dump": ["endpoint-isolation"],+ # ids-critical (moved from _TEMPLATES_WITHOUT_PACK_COVERAGE — IDS/IPS pack now covers)+ "dga-c2": ["ids-critical"],+ "https-c2-beacon": ["ids-critical"],+ # malware / endpoint-isolation (malware execution triggers both response tracks)+ "powershell-obfuscated-dropper": ["malware", "endpoint-isolation"],+ "process-hollowing-svchost": ["malware"],+ # privilege-escalation (moved from _TEMPLATES_WITHOUT_PACK_COVERAGE — v1 pack now covers)+ "linux-suid-abuse": ["privilege-escalation"],+ "uac-bypass-fodhelper": ["privilege-escalation"],+ # web-compromise (moved from _TEMPLATES_WITHOUT_PACK_COVERAGE — v1 pack now covers)+ "confluence-watering-hole": ["web-compromise", "phishing"],+ "webapp-sqli-ssrf-exploit": ["web-compromise"],}# Templates the v1 pack legitimately does not cover. Listed explicitly so# adding a new template without either a pack mapping or an explicit# no-coverage entry will trip ``test_every_template_is_classified``._TEMPLATES_WITHOUT_PACK_COVERAGE: set[str] = {- # Endpoint compromise / persistence / defense-evasion (the v1 pack focuses- # on identity, network, cloud, exfil, and ransomware response — endpoint-- # native containment playbooks are slated for the v1.1 pack).+ # Endpoint persistence / defense-evasion templates not yet covered by a+ # v1 playbook. These remain endpoint-native signals where the pack's+ # identity/network/cloud playbooks cannot meaningfully respond. Slated+ # for v1.1 endpoint containment packs."certutil-download-cradle","clipboard-keylogger",- "confluence-watering-hole","cron-backdoor",- "dga-c2",- "disable-edr-tooling",- "docker-runtime-abuse","event-log-cleared",- "https-c2-beacon",- "k8s-privileged-pod-escape","linux-journald-tampering",- "linux-suid-abuse",- "lsass-memory-dump","office-vsto-addin",- "powershell-obfuscated-dropper",- "process-hollowing-svchost","registry-run-persistence","scheduled-task-persistence",- "uac-bypass-fodhelper","uefi-firmware-implant","usb-autorun-airgap",- "webapp-sqli-ssrf-exploit","wmi-event-subscription",# Medium-severity reconnaissance / early-stage templates. The dataset# generator emits these at medium severity (pre-exploitation signals),diff --git a/services/api/Dockerfile b/services/api/Dockerfileindex 3b8130133..abc1e5f62 100644--- a/services/api/Dockerfile+++ b/services/api/Dockerfile@@ -9,6 +9,12 @@ ENV PYTHONDONTWRITEBYTECODE=1 \RUN apt-get update && apt-get install -y --no-install-recommends \build-essential \libpq-dev \+ # WeasyPrint (WS-G2 exec digest PDF) — Pango/Cairo text + rendering stack+ libpango-1.0-0 \+ libpangocairo-1.0-0 \+ libcairo2 \+ libgdk-pixbuf-2.0-0 \+ shared-mime-info \&& rm -rf /var/lib/apt/lists/*RUN pip install poetry==1.8.2diff --git a/services/api/app/api/v1/deps.py b/services/api/app/api/v1/deps.pyindex 7a0c032d7..f9aca01b0 100644--- a/services/api/app/api/v1/deps.py+++ b/services/api/app/api/v1/deps.py@@ -214,7 +214,7 @@ async def get_current_user(# --- JWT path ---try:payload = decode_token(token)- user_id: str = payload.get("sub")+ user_id: str = payload.get("sub") # type: ignore[assignment]token_type: str = payload.get("type", "access")if user_id is None or token_type != "access":raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid token")@@ -265,4 +265,4 @@ AuthUser = Annotated[CurrentUser, Depends(get_current_user)]def _get_tenant_db_session() -> "Annotated[AsyncSession, ...]": # pragma: no coverfrom app.db.rls import TenantDBSession as _T # noqa: PLC0415- return _T+ return _T # type: ignore[return-value]diff --git a/services/api/app/api/v1/endpoints/agents.py b/services/api/app/api/v1/endpoints/agents.pyindex 40bb0af9b..8df84b970 100644--- a/services/api/app/api/v1/endpoints/agents.py+++ b/services/api/app/api/v1/endpoints/agents.py@@ -81,10 +81,7 @@ class AgentToolDescriptor(BaseModel):)category: str = Field(description="Catalog category, e.g. 'edr', 'siem', 'iam'.")capability: str = Field(- description=(- "The capability verb (one of the values from the Capability enum, "- "e.g. 'pull_alerts', 'query_logs', 'isolate_host')."- ),+ description=("The capability verb (one of the values from the Capability enum, e.g. 'pull_alerts', 'query_logs', 'isolate_host')."),)capability_group: str = Field(description=(@@ -266,9 +263,7 @@ async def list_agent_tools(# questions without N round-trips to the connectors service.catalog = await _fetch_catalog()catalog_by_type: dict[str, dict[str, Any]] = {- entry["connector_id"]: entry- for entry in catalog- if isinstance(entry, dict) and isinstance(entry.get("connector_id"), str)+ entry["connector_id"]: entry for entry in catalog if isinstance(entry, dict) and isinstance(entry.get("connector_id"), str)}tools: list[AgentToolDescriptor] = []diff --git a/services/api/app/api/v1/endpoints/audit.py b/services/api/app/api/v1/endpoints/audit.pyindex 3fdd0a664..f3b652cbe 100644--- a/services/api/app/api/v1/endpoints/audit.py+++ b/services/api/app/api/v1/endpoints/audit.py@@ -195,9 +195,7 @@ async def export_audit_events(content=body,media_type="text/csv; charset=utf-8",headers={- "Content-Disposition": (- f'attachment; filename="aisoc-audit-{timestamp_slug}.csv"'- ),+ "Content-Disposition": (f'attachment; filename="aisoc-audit-{timestamp_slug}.csv"'),"X-Total-Rows": str(len(rows)),},)@@ -218,9 +216,7 @@ async def export_audit_events(return HTMLResponse(content=html_body,headers={- "Content-Disposition": (- f'inline; filename="aisoc-audit-{timestamp_slug}.html"'- ),+ "Content-Disposition": (f'inline; filename="aisoc-audit-{timestamp_slug}.html"'),"X-Total-Rows": str(len(rows)),},)diff --git a/services/api/app/api/v1/endpoints/auth.py b/services/api/app/api/v1/endpoints/auth.pyindex c3f2864b1..7867ab4fa 100644--- a/services/api/app/api/v1/endpoints/auth.py+++ b/services/api/app/api/v1/endpoints/auth.py@@ -1,7 +1,8 @@-"""Authentication endpoints: login, refresh, logout."""+"""Authentication endpoints: login, refresh, logout, user preferences."""import uuidfrom datetime import UTC, datetime+from typing import Anyfrom fastapi import APIRouter, HTTPException, statusfrom pydantic import BaseModel, EmailStr@@ -45,10 +46,17 @@ class UserMeResponse(BaseModel):username: strrole: stris_active: bool+ preferences: dict[str, Any] = {}model_config = {"from_attributes": True}+class PreferencesPatch(BaseModel):+ """Partial update payload for user preferences (merged server-side)."""++ preferences: dict[str, Any]++@router.post("/login", response_model=TokenResponse)async def login(request: LoginRequest, db: DBSession) -> TokenResponse:"""Authenticate with email/password, return JWT tokens."""@@ -116,3 +124,30 @@ async def get_me(current_user: AuthUser, db: DBSession) -> UserMeResponse:if user is None:raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="User not found")return UserMeResponse.model_validate(user)++[email protected]("/me/preferences", response_model=UserMeResponse)+async def patch_me_preferences(+ body: PreferencesPatch,+ current_user: AuthUser,+ db: DBSession,+) -> UserMeResponse:+ """Merge user preferences (e.g. theme) into the stored JSONB column.++ Only the keys supplied in the request body are updated; all other+ existing keys are preserved. This lets the frontend evolve independent+ preference namespaces without overwriting each other.+ """+ result = await db.execute(select(User).where(User.id == current_user.user_id))+ user = result.scalar_one_or_none()+ if user is None:+ raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="User not found")++ merged = {**(user.preferences or {}), **body.preferences}+ await db.execute(update(User).where(User.id == current_user.user_id).values(preferences=merged))+ await db.commit()++ # Re-fetch to return fresh state+ result = await db.execute(select(User).where(User.id == current_user.user_id))+ user = result.scalar_one_or_none()+ return UserMeResponse.model_validate(user)diff --git a/services/api/app/api/v1/endpoints/autonomy_policy.py b/services/api/app/api/v1/endpoints/autonomy_policy.pyindex b622a3f94..25a8f71fb 100644--- a/services/api/app/api/v1/endpoints/autonomy_policy.py+++ b/services/api/app/api/v1/endpoints/autonomy_policy.py@@ -43,26 +43,26 @@ router = APIRouter(prefix="/autonomy-policy", tags=["autonomy-policy"])# ---------------------------------------------------------------------------_DEFAULTS: dict[str, tuple[float, float, float]] = {# Read / enrichment — autonomous by default- "lookup_ip": (0.0, 0.0, 0.0),- "lookup_domain": (0.0, 0.0, 0.0),- "search_logs": (0.0, 0.0, 0.0),- "enrich_alert": (0.0, 0.0, 0.0),- "mitre_lookup": (0.0, 0.0, 0.0),- "get_alert_context": (0.0, 0.0, 0.0),+ "lookup_ip": (0.0, 0.0, 0.0),+ "lookup_domain": (0.0, 0.0, 0.0),+ "search_logs": (0.0, 0.0, 0.0),+ "enrich_alert": (0.0, 0.0, 0.0),+ "mitre_lookup": (0.0, 0.0, 0.0),+ "get_alert_context": (0.0, 0.0, 0.0),# Case workflow — moderate autonomy- "add_alert_tag": (0.50, 0.30, 0.10),- "close_alert": (0.60, 0.40, 0.20),- "create_case": (0.50, 0.30, 0.10),- "add_case_comment": (0.40, 0.20, 0.05),- "assign_case": (0.60, 0.40, 0.20),+ "add_alert_tag": (0.50, 0.30, 0.10),+ "close_alert": (0.60, 0.40, 0.20),+ "create_case": (0.50, 0.30, 0.10),+ "add_case_comment": (0.40, 0.20, 0.05),+ "assign_case": (0.60, 0.40, 0.20),# Containment — high blast radius- "quarantine_file": (0.85, 0.65, 0.40),- "block_ip": (0.90, 0.70, 0.40),- "isolate_host": (0.92, 0.72, 0.45),+ "quarantine_file": (0.85, 0.65, 0.40),+ "block_ip": (0.90, 0.70, 0.40),+ "isolate_host": (0.92, 0.72, 0.45),"disable_user_account": (0.90, 0.70, 0.40),- "revoke_session": (0.80, 0.60, 0.30),- "delete_object": (0.95, 0.80, 0.50),- "firewall_rule_add": (0.88, 0.68, 0.40),+ "revoke_session": (0.80, 0.60, 0.30),+ "delete_object": (0.95, 0.80, 0.50),+ "firewall_rule_add": (0.88, 0.68, 0.40),"firewall_rule_remove": (0.90, 0.70, 0.40),}@@ -105,7 +105,7 @@ class ThresholdTriple(BaseModel):escalation: float = Field(..., ge=0.0, le=1.0)@model_validator(mode="after")- def _enforce_ordering(self) -> "ThresholdTriple":+ def _enforce_ordering(self) -> ThresholdTriple:if self.review > self.auto:raise ValueError("review threshold must be <= auto threshold")if self.escalation > self.review:@@ -141,7 +141,7 @@ class ThresholdUpdateRequest(BaseModel):)@model_validator(mode="after")- def _enforce_ordering(self) -> "ThresholdUpdateRequest":+ def _enforce_ordering(self) -> ThresholdUpdateRequest:if self.review > self.auto:raise ValueError("review threshold must be <= auto threshold")if self.escalation > self.review:@@ -221,9 +221,7 @@ def _row_to_triple(row: dict) -> ThresholdTriple:review = row.get("review_confidence")escalation = row.get("escalation_confidence")review_v = float(review) if review is not None else max(0.0, auto - 0.1)- escalation_v = (- float(escalation) if escalation is not None else max(0.0, review_v - 0.2)- )+ escalation_v = float(escalation) if escalation is not None else max(0.0, review_v - 0.2)# Clamp into a valid ordering — older legacy rows may not satisfy it.review_v = min(review_v, auto)escalation_v = min(escalation_v, review_v)@@ -266,9 +264,7 @@ async def get_autonomy_policy(default_thresholds=defaults,overridden=True,override_source=row.get("source") or "admin_ui",- last_updated_at=row["updated_at"].isoformat()- if row.get("updated_at")- else None,+ last_updated_at=row["updated_at"].isoformat() if row.get("updated_at") else None,last_updated_by=row.get("updated_by"),last_reason=row.get("reason"),)@@ -298,9 +294,7 @@ async def get_autonomy_policy(default_thresholds=ThresholdTriple(auto=1.0, review=1.0, escalation=1.0),overridden=True,override_source=row.get("source") or "admin_ui",- last_updated_at=row["updated_at"].isoformat()- if row.get("updated_at")- else None,+ last_updated_at=row["updated_at"].isoformat() if row.get("updated_at") else None,last_updated_by=row.get("updated_by"),last_reason=row.get("reason"),)@@ -430,9 +424,7 @@ async def upsert_action_threshold(return ThresholdUpdateResponse(action=action,- thresholds=ThresholdTriple(- auto=payload.auto, review=payload.review, escalation=payload.escalation- ),+ thresholds=ThresholdTriple(auto=payload.auto, review=payload.review, escalation=payload.escalation),updated_at=now.isoformat(),updated_by=user.email,)diff --git a/services/api/app/api/v1/endpoints/cases.py b/services/api/app/api/v1/endpoints/cases.pyindex 800cf7a01..51bef9c86 100644--- a/services/api/app/api/v1/endpoints/cases.py+++ b/services/api/app/api/v1/endpoints/cases.py@@ -51,11 +51,7 @@ router = APIRouter(prefix="/cases", tags=["cases"])# We keep the route surface on `/cases/{id}/investigate` and# `/cases/{id}/investigations/{run_id}` for the web console and proxy through# to the agents service so the front end has a single, stable API origin.-_AGENTS_URL = (- os.getenv("AGENTS_SERVICE_URL")- or os.getenv("AGENTS_API_URL")- or "http://agents:8084"-).rstrip("/")+_AGENTS_URL = (os.getenv("AGENTS_SERVICE_URL") or os.getenv("AGENTS_API_URL") or "http://agents:8084").rstrip("/")# Tight allowlist for proxied request paths. We only ever proxy to a fixed# upstream (`_AGENTS_URL`) on a known set of investigation routes, so the@@ -69,14 +65,12 @@ _SAFE_PROXY_PATH_RE = re.compile(r"^/[A-Za-z0-9_\-./%]*$")def _validate_agents_path(path: str) -> str:"""Reject any proxied path that isn't a tightly constrained relative path."""if (- not isinstance(path, str)- or not _SAFE_PROXY_PATH_RE.match(path)- or ".." in path- or path.startswith("//") # protocol-relative URL+ not isinstance(path, str) or not _SAFE_PROXY_PATH_RE.match(path) or ".." in path or path.startswith("//") # protocol-relative URL):raise HTTPException(status_code=400, detail="invalid_request_path")return path+# ────────────────────────────────────────────────────────────────────────────# Pydantic schemas# ────────────────────────────────────────────────────────────────────────────@@ -350,10 +344,9 @@ async def _resolve_case_id(case_id: str, db: Any) -> uuid.UUID:# interpolate the raw string into SQL.row = (await db.execute(- text(- "SELECT id FROM aisoc_cases WHERE case_number = :case_number "- "ORDER BY created_at DESC LIMIT 1"- ).bindparams(case_number=case_id)+ text("SELECT id FROM aisoc_cases WHERE case_number = :case_number ORDER BY created_at DESC LIMIT 1").bindparams(+ case_number=case_id+ ))).fetchone()if not row:@@ -390,7 +383,7 @@ async def list_cases(q = f"""SELECT * FROM aisoc_cases- WHERE {' AND '.join(where_clauses)}+ WHERE {" AND ".join(where_clauses)}ORDER BY created_at DESCLIMIT :limit OFFSET :offset"""@@ -433,6 +426,8 @@ async def create_case(body: CreateCaseRequest, db: DBSession, user: AuthUser) ->)try:row = (await db.execute(q)).fetchone()+ if row is None:+ raise HTTPException(status_code=503, detail="Database error: INSERT returned no row")await db.commit()except Exception as exc:await db.rollback()@@ -497,24 +492,33 @@ async def update_case(case_id: str, body: UpdateCaseRequest, db: DBSession, userparams: dict[str, Any] = {"id": cid, "now": now}if body.title is not None:- sets.append("title = :title"); params["title"] = body.title+ sets.append("title = :title")+ params["title"] = body.titleif body.description is not None:- sets.append("description = :description"); params["description"] = body.description+ sets.append("description = :description")+ params["description"] = body.descriptionif body.severity is not None:- sets.append("severity = :severity"); params["severity"] = body.severity+ sets.append("severity = :severity")+ params["severity"] = body.severityif body.assignee is not None:- sets.append("assignee = :assignee"); params["assignee"] = body.assignee+ sets.append("assignee = :assignee")+ params["assignee"] = body.assigneeif body.sla_due_at is not None:- sets.append("sla_due_at = :sla"); params["sla"] = body.sla_due_at+ sets.append("sla_due_at = :sla")+ params["sla"] = body.sla_due_atif body.mitre_techniques is not None:- sets.append("mitre_techniques = :mitre::jsonb"); params["mitre"] = _json.dumps(body.mitre_techniques)+ sets.append("mitre_techniques = :mitre::jsonb")+ params["mitre"] = _json.dumps(body.mitre_techniques)if body.compliance_frameworks is not None:- sets.append("compliance_frameworks = :frameworks::text[]"); params["frameworks"] = body.compliance_frameworks+ sets.append("compliance_frameworks = :frameworks::text[]")+ params["frameworks"] = body.compliance_frameworksif body.tags is not None:- sets.append("tags = :tags::jsonb"); params["tags"] = _json.dumps(body.tags)+ sets.append("tags = :tags::jsonb")+ params["tags"] = _json.dumps(body.tags)if body.status:- sets.append("status = :status"); params["status"] = body.status+ sets.append("status = :status")+ params["status"] = body.statusts_col = {"triaged": "triaged_at", "resolved": "resolved_at", "closed": "closed_at"}.get(body.status)if ts_col:sets.append(f"{ts_col} = :now")@@ -522,6 +526,8 @@ async def update_case(case_id: str, body: UpdateCaseRequest, db: DBSession, userq = text(f"UPDATE aisoc_cases SET {', '.join(sets)} WHERE id = :id RETURNING *").bindparams(**params)try:row = (await db.execute(q)).fetchone()+ if row is None:+ raise HTTPException(status_code=404, detail="Case not found.")await db.commit()except Exception as exc:await db.rollback()@@ -560,9 +566,7 @@ async def update_case(case_id: str, body: UpdateCaseRequest, db: DBSession, usertry:await _emit_summary_breadcrumb(db, case_id=row.id, status=body.status)except Exception: # pragma: no cover — defensive: never block status change.- logger.exception(- "cases.update.summary_breadcrumb_failed case=%s", row.id- )+ logger.exception("cases.update.summary_breadcrumb_failed case=%s", row.id)await db.rollback()return response@@ -645,10 +649,16 @@ async def add_comment(case_id: str, body: AddCommentRequest, db: DBSession, user""").bindparams(id=comment_id, case_id=cid, author=str(user) if user else "system", body=body.body, sys=body.is_system, now=now)try:row = (await db.execute(q)).fetchone()+ if row is None:+ raise HTTPException(status_code=503, detail="Database error: INSERT returned no row")await db.commit()return CommentResponse(- id=row.id, case_id=row.case_id, author=row.author,- body=row.body, is_system=row.is_system, created_at=row.created_at,+ id=row.id,+ case_id=row.case_id,+ author=row.author,+ body=row.body,+ is_system=row.is_system,+ created_at=row.created_at,)except Exception as exc:await db.rollback()@@ -658,8 +668,13 @@ async def add_comment(case_id: str, body: AddCommentRequest, db: DBSession, user@router.get("/{case_id}/comments", response_model=list[CommentResponse], summary="List case comments")async def list_comments(case_id: str, db: DBSession, user: AuthUser) -> list[CommentResponse]:cid = await _resolve_case_id(case_id, db)- rows = (await db.execute(text("SELECT * FROM aisoc_case_comments WHERE case_id = :id ORDER BY created_at").bindparams(id=cid))).fetchall()- return [CommentResponse(id=r.id, case_id=r.case_id, author=r.author, body=r.body, is_system=r.is_system, created_at=r.created_at) for r in rows]+ rows = (+ await db.execute(text("SELECT * FROM aisoc_case_comments WHERE case_id = :id ORDER BY created_at").bindparams(id=cid))+ ).fetchall()+ return [+ CommentResponse(id=r.id, case_id=r.case_id, author=r.author, body=r.body, is_system=r.is_system, created_at=r.created_at)+ for r in rows+ ]# Alias `/notes` → `/comments` so the web console (which calls `/notes` for the@@ -708,9 +723,7 @@ async def evidence_report(case_id: str, db: DBSession, user: AuthUser) -> Eviden@router.get("/{case_id}/timeline", response_model=TimelineResponse, summary="Case activity timeline")async def case_timeline(case_id: str, db: DBSession, user: AuthUser) -> TimelineResponse:cid = await _resolve_case_id(case_id, db)- case_row = (- await db.execute(text("SELECT * FROM aisoc_cases WHERE id = :id").bindparams(id=cid))- ).fetchone()+ case_row = (await db.execute(text("SELECT * FROM aisoc_cases WHERE id = :id").bindparams(id=cid))).fetchone()if not case_row:raise HTTPException(status_code=404, detail="Case not found.")@@ -746,8 +759,7 @@ async def case_timeline(case_id: str, db: DBSession, user: AuthUser) -> Timelinecomment_rows = (await db.execute(text(- "SELECT id, author, body, is_system, created_at "- "FROM aisoc_case_comments WHERE case_id = :id ORDER BY created_at"+ "SELECT id, author, body, is_system, created_at FROM aisoc_case_comments WHERE case_id = :id ORDER BY created_at").bindparams(id=cid))).fetchall()@@ -767,11 +779,7 @@ async def case_timeline(case_id: str, db: DBSession, user: AuthUser) -> Timelinefor alert_id in list(case_row.alert_ids or [])[:25]:try:a = (- await db.execute(- text(- "SELECT id, title, severity, created_at FROM aisoc_alerts WHERE id = :id"- ).bindparams(id=alert_id)- )+ await db.execute(text("SELECT id, title, severity, created_at FROM aisoc_alerts WHERE id = :id").bindparams(id=alert_id))).fetchone()if a:events.append(@@ -792,8 +800,7 @@ async def case_timeline(case_id: str, db: DBSession, user: AuthUser) -> Timelinetask_rows = (await db.execute(text(- "SELECT id, title, status, assignee, created_at "- "FROM aisoc_case_tasks WHERE case_id = :id ORDER BY created_at"+ "SELECT id, title, status, assignee, created_at FROM aisoc_case_tasks WHERE case_id = :id ORDER BY created_at").bindparams(id=cid))).fetchall()@@ -823,16 +830,13 @@ async def case_timeline(case_id: str, db: DBSession, user: AuthUser) -> Timeline@router.get("/{case_id}/tasks", response_model=list[TaskResponse], summary="List case tasks")async def list_tasks(case_id: str, db: DBSession, user: AuthUser) -> list[TaskResponse]:cid = await _resolve_case_id(case_id, db)- exists = (- await db.execute(text("SELECT 1 FROM aisoc_cases WHERE id = :id").bindparams(id=cid))- ).fetchone()+ exists = (await db.execute(text("SELECT 1 FROM aisoc_cases WHERE id = :id").bindparams(id=cid))).fetchone()if not exists:raise HTTPException(status_code=404, detail="Case not found.")rows = (await db.execute(text(- "SELECT id, title, status, assignee, due_at, created_at "- "FROM aisoc_case_tasks WHERE case_id = :id ORDER BY created_at"+ "SELECT id, title, status, assignee, due_at, created_at FROM aisoc_case_tasks WHERE case_id = :id ORDER BY created_at").bindparams(id=cid))).fetchall()@@ -847,9 +851,7 @@ async def create_task(user: AuthUser,) -> TaskResponse:cid = await _resolve_case_id(case_id, db)- exists = (- await db.execute(text("SELECT 1 FROM aisoc_cases WHERE id = :id").bindparams(id=cid))- ).fetchone()+ exists = (await db.execute(text("SELECT 1 FROM aisoc_cases WHERE id = :id").bindparams(id=cid))).fetchone()if not exists:raise HTTPException(status_code=404, detail="Case not found.")@@ -974,9 +976,7 @@ async def case_investigate(user: AuthUser,) -> dict[str, Any]:cid = await _resolve_case_id(case_id, db)- exists = (- await db.execute(text("SELECT 1 FROM aisoc_cases WHERE id = :id").bindparams(id=cid))- ).fetchone()+ exists = (await db.execute(text("SELECT 1 FROM aisoc_cases WHERE id = :id").bindparams(id=cid))).fetchone()if not exists:raise HTTPException(status_code=404, detail="Case not found.")@@ -1053,9 +1053,7 @@ _SUMMARY_BREADCRUMB_BODY = ()-async def _emit_summary_breadcrumb(- db: Any, *, case_id: uuid.UUID, status: str-) -> None:+async def _emit_summary_breadcrumb(db: Any, *, case_id: uuid.UUID, status: str) -> None:"""Drop a system comment pointing to the on-demand summary endpoint.Idempotent on repeated status changes — we re-emit only when transitioning@@ -1157,13 +1155,7 @@ async def list_related_cases(thing the case detail page needs to stop 404'ing."""cid = await _resolve_case_id(case_id, db)- row = (- await db.execute(- text(- "SELECT alert_ids, observable_graph FROM aisoc_cases WHERE id = :id"- ).bindparams(id=cid)- )- ).fetchone()+ row = (await db.execute(text("SELECT alert_ids, observable_graph FROM aisoc_cases WHERE id = :id").bindparams(id=cid))).fetchone()if not row:raise HTTPException(status_code=404, detail="Case not found.")diff --git a/services/api/app/api/v1/endpoints/community.py b/services/api/app/api/v1/endpoints/community.pyindex 7b6d1a2fa..4138565ee 100644--- a/services/api/app/api/v1/endpoints/community.py+++ b/services/api/app/api/v1/endpoints/community.py@@ -147,7 +147,7 @@ async def publish_plugin(# Signature verification — allow submission without registered key (marks as unverified)verified = False- registered_pub_key = _get_registered_pub_key(current_user.id)+ registered_pub_key = _get_registered_pub_key(str(current_user.user_id))if registered_pub_key:try:verify_ed25519_signature(registered_pub_key, tarball, signature)@@ -172,7 +172,7 @@ async def publish_plugin("rating": 0.0,"rating_count": 0,"verified": verified,- "submitted_by": current_user.id,+ "submitted_by": current_user.user_id,"submitted_at": datetime.now(UTC).isoformat(),"approved_at": None,"tarball_sha256": hashlib.sha256(tarball).hexdigest(),diff --git a/services/api/app/api/v1/endpoints/compliance.py b/services/api/app/api/v1/endpoints/compliance.pyindex b6a377e66..0d3cbde3c 100644--- a/services/api/app/api/v1/endpoints/compliance.py+++ b/services/api/app/api/v1/endpoints/compliance.py@@ -165,7 +165,9 @@ def _compute_hash(prev_hash: str | None, summary: str, payload: dict[str, Any])async def _latest_hash(db: DBSession, framework: str) -> str | None:row = (await db.execute(- text("SELECT payload_hash FROM aisoc_compliance_evidence WHERE framework = :f ORDER BY created_at DESC LIMIT 1").bindparams(f=framework)+ text("SELECT payload_hash FROM aisoc_compliance_evidence WHERE framework = :f ORDER BY created_at DESC LIMIT 1").bindparams(+ f=framework+ ))).fetchone()return row.payload_hash if row else None@@ -287,15 +289,21 @@ async def list_evidence(wheres = ["1=1"]params: dict[str, Any] = {"limit": limit, "offset": offset}if framework:- wheres.append("framework = :fw"); params["fw"] = framework+ wheres.append("framework = :fw")+ params["fw"] = frameworkif control_id:- wheres.append("control_id = :ctrl"); params["ctrl"] = control_id+ wheres.append("control_id = :ctrl")+ params["ctrl"] = control_idif case_id:- wheres.append("case_id = :case_id"); params["case_id"] = case_id+ wheres.append("case_id = :case_id")+ params["case_id"] = case_idif ev_status:- wheres.append("status = :ev_status"); params["ev_status"] = ev_status+ wheres.append("status = :ev_status")+ params["ev_status"] = ev_status- q = text(f"SELECT * FROM aisoc_compliance_evidence WHERE {' AND '.join(wheres)} ORDER BY collected_at DESC LIMIT :limit OFFSET :offset").bindparams(**params)+ q = text(+ f"SELECT * FROM aisoc_compliance_evidence WHERE {' AND '.join(wheres)} ORDER BY collected_at DESC LIMIT :limit OFFSET :offset"+ ).bindparams(**params)try:rows = (await db.execute(q)).fetchall()return [_row_to_evidence(r) for r in rows]@@ -341,7 +349,8 @@ async def compliance_report(wheres = ["1=1"]params: dict[str, Any] = {}if framework:- wheres.append("framework = :fw"); params["fw"] = framework+ wheres.append("framework = :fw")+ params["fw"] = frameworkq = text(f"""SELECT framework, control_id,@@ -350,7 +359,7 @@ async def compliance_report(COUNT(*) FILTER (WHERE status = 'pending') AS pending,COUNT(*) FILTER (WHERE status = 'rejected') AS rejectedFROM aisoc_compliance_evidence- WHERE {' AND '.join(wheres)}+ WHERE {" AND ".join(wheres)}GROUP BY framework, control_idORDER BY framework, control_id""").bindparams(**params)diff --git a/services/api/app/api/v1/endpoints/connectors.py b/services/api/app/api/v1/endpoints/connectors.pyindex b21d6f20f..1ebac75ce 100644--- a/services/api/app/api/v1/endpoints/connectors.py+++ b/services/api/app/api/v1/endpoints/connectors.py@@ -64,16 +64,17 @@ def _safe_connector_type(value: str) -> str:"""Reconstruct connector_type keeping only allowed chars; breaks taint trace."""return _CONNECTOR_TYPE_UNSAFE_CHARS_RE.sub("", value)[:100]-import httpx-from fastapi import APIRouter, Depends, HTTPException, status-from pydantic import BaseModel, Field-from sqlalchemy import select, update-from app.api.v1.deps import AuthUser, DBSession, require_permission-from app.core.config import settings-from app.models.connector import Connector-from app.security.credential_vault import CredentialVaultError, get_vault-from app.services.connector_freshness import compute_freshness+import httpx # noqa: E402+from fastapi import APIRouter, Depends, HTTPException, status # noqa: E402+from pydantic import BaseModel, Field # noqa: E402+from sqlalchemy import select, update # noqa: E402++from app.api.v1.deps import AuthUser, DBSession, require_permission # noqa: E402+from app.core.config import settings # noqa: E402+from app.models.connector import Connector # noqa: E402+from app.security.credential_vault import CredentialVaultError, get_vault # noqa: E402+from app.services.connector_freshness import compute_freshness # noqa: E402logger = logging.getLogger(__name__)@@ -327,9 +328,7 @@ def _connectors_service_url(path: str) -> str:# from app.connectors import list_connector_schemas as l; \\# print(json.dumps(l(), indent=2))" \\# > ../api/app/data/connector_catalog_fallback.json-_FALLBACK_CATALOG_PATH = (- Path(__file__).resolve().parents[3] / "data" / "connector_catalog_fallback.json"-)+_FALLBACK_CATALOG_PATH = Path(__file__).resolve().parents[3] / "data" / "connector_catalog_fallback.json"def _load_fallback_catalog() -> list[dict[str, Any]]:@@ -515,9 +514,7 @@ async def connector_health_summary(compared to the round-trip, and the resulting Python is a lot easierto read than five COUNT(*) FILTER clauses."""- result = await db.execute(- select(Connector).where(Connector.tenant_id == current_user.tenant_id)- )+ result = await db.execute(select(Connector).where(Connector.tenant_id == current_user.tenant_id))connectors = list(result.scalars().all())now = datetime.now(UTC)@@ -798,7 +795,7 @@ async def update_connector_capabilities("tenant_id": current_user.tenant_id,"connector_id": str(connector_id),"connector_type": _safe_connector_type(connector.connector_type),- "allowed_count": len(request.allowed_capabilities),+ "allowed_count": len(request.allowed_capabilities or []),},)@@ -1178,11 +1175,7 @@ async def refresh_ingest_token(raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Connector not found")new_token = _generate_ingest_token()- await db.execute(- update(Connector)- .where(Connector.id == connector_id)- .values(ingest_token=new_token, updated_at=datetime.now(UTC))- )+ await db.execute(update(Connector).where(Connector.id == connector_id).values(ingest_token=new_token, updated_at=datetime.now(UTC)))await db.commit()base = (getattr(settings, "INGEST_PUBLIC_URL", "") or "").rstrip("/")diff --git a/services/api/app/api/v1/endpoints/costs.py b/services/api/app/api/v1/endpoints/costs.pyindex fb6200dae..e68600436 100644--- a/services/api/app/api/v1/endpoints/costs.py+++ b/services/api/app/api/v1/endpoints/costs.py@@ -60,10 +60,7 @@ async def get_cost_dashboard(default=_DEFAULT_WINDOW_DAYS,ge=_MIN_WINDOW_DAYS,le=_MAX_WINDOW_DAYS,- description=(- "Rolling window in days. Counts back from now() (UTC). "- "Defaults to the last 30 days; capped at 365."- ),+ description=("Rolling window in days. Counts back from now() (UTC). Defaults to the last 30 days; capped at 365."),),) -> CostDashboard:"""Return a deterministic snapshot of cost, activity, and BYOK savings.@@ -96,10 +93,7 @@ async def get_cost_dashboard(# caller cannot bypass the clamp.raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST,- detail=(- f"window_days must be between {_MIN_WINDOW_DAYS} and "- f"{_MAX_WINDOW_DAYS}"- ),+ detail=(f"window_days must be between {_MIN_WINDOW_DAYS} and {_MAX_WINDOW_DAYS}"),)# Pull the live LLM provider snapshot from the same code path thediff --git a/services/api/app/api/v1/endpoints/detection_compat.py b/services/api/app/api/v1/endpoints/detection_compat.pyindex 29c36b97e..ee97b02f7 100644--- a/services/api/app/api/v1/endpoints/detection_compat.py+++ b/services/api/app/api/v1/endpoints/detection_compat.py@@ -580,9 +580,7 @@ def _build_coverage(rules: list[DetectionRule], *, now: datetime | None = None)active_rules = sum(1 for r in rules if r.status == "active")# technique_id -> {"tactic": str|None, "active": int, "inactive": int}- by_technique: dict[str, dict[str, Any]] = defaultdict(- lambda: {"tactic": None, "active": 0, "inactive": 0}- )+ by_technique: dict[str, dict[str, Any]] = defaultdict(lambda: {"tactic": None, "active": 0, "inactive": 0})tactics_set: set[str] = set()for rule in rules:@@ -658,7 +656,7 @@ def _build_drift(stale_cutoff = now - timedelta(days=stale_days)entries: list[DriftEntry] = []- counts = Counter()+ counts: Counter[str] = Counter()for rule in rules:issues: list[str] = []@@ -686,9 +684,7 @@ def _build_drift(# Stale only applies to active rules — a disabled rule with no# triggers is *expected* to be quiet.if is_active:- if last_trig is None or last_trig.replace(- tzinfo=last_trig.tzinfo or UTC- ) < stale_cutoff:+ if last_trig is None or last_trig.replace(tzinfo=last_trig.tzinfo or UTC) < stale_cutoff:issues.append("stale")counts["stale"] += 1@@ -769,10 +765,7 @@ def _build_confidence(total = len(rules)if total == 0:- empty_buckets = [- ConfidenceBucket(label=lbl, floor=lo, ceil=hi, count=0, activeCount=0)- for lbl, lo, hi in _CONFIDENCE_BUCKETS- ]+ empty_buckets = [ConfidenceBucket(label=lbl, floor=lo, ceil=hi, count=0, activeCount=0) for lbl, lo, hi in _CONFIDENCE_BUCKETS]return ConfidenceResponse(summary=ConfidenceSummary(totalRules=0,@@ -794,9 +787,7 @@ def _build_confidence(active_confidences = [int(r.confidence or 0) for r in active_rules]avg_conf = sum(confidences) / total- avg_active = (- sum(active_confidences) / len(active_confidences) if active_confidences else 0.0- )+ avg_active = sum(active_confidences) / len(active_confidences) if active_confidences else 0.0sorted_conf = sorted(confidences)mid = len(sorted_conf) // 2@@ -811,11 +802,7 @@ def _build_confidence(buckets: list[ConfidenceBucket] = []for label, floor, ceil in _CONFIDENCE_BUCKETS:count = sum(1 for c in confidences if floor <= c <= ceil)- active = sum(- 1- for r in rules- if r.status == "active" and floor <= int(r.confidence or 0) <= ceil- )+ active = sum(1 for r in rules if r.status == "active" and floor <= int(r.confidence or 0) <= ceil)buckets.append(ConfidenceBucket(label=label,@@ -827,10 +814,8 @@ def _build_confidence()# Per-tactic average confidence.- by_tactic: dict[str, dict[str, Any]] = defaultdict(- lambda: {"sum": 0, "count": 0, "active_sum": 0, "active_count": 0}- )- for rule, conf in zip(rules, confidences):+ by_tactic: dict[str, dict[str, Any]] = defaultdict(lambda: {"sum": 0, "count": 0, "active_sum": 0, "active_count": 0})+ for rule, conf in zip(rules, confidences, strict=False):tactic = _primary_tactic(rule)if not tactic:continue@@ -979,11 +964,7 @@ async def bulk_toggle_rules(return BulkToggleResponse(updated=0, skipped=skipped)now = datetime.now(UTC)- await db.execute(- update(DetectionRule)- .where(DetectionRule.id.in_(owned_ids))- .values(status=target_status, updated_at=now)- )+ await db.execute(update(DetectionRule).where(DetectionRule.id.in_(owned_ids)).values(status=target_status, updated_at=now))await db.commit()return BulkToggleResponse(updated=len(owned_ids), skipped=skipped)diff --git a/services/api/app/api/v1/endpoints/detection_loop.py b/services/api/app/api/v1/endpoints/detection_loop.pyindex eaeb3218e..14e4c7bc4 100644--- a/services/api/app/api/v1/endpoints/detection_loop.py+++ b/services/api/app/api/v1/endpoints/detection_loop.py@@ -41,9 +41,7 @@ router = APIRouter(prefix="/detection-loop", tags=["detection_rules", "detectionclass SuggestRequest(BaseModel):alert_id: uuid.UUID = Field(..., description="ID of the FP-flagged alert.")- analyst_note: str | None = Field(- None, description="Free-text note explaining why this is a FP."- )+ analyst_note: str | None = Field(None, description="Free-text note explaining why this is a FP.")class SuggestionResponse(BaseModel):@@ -98,9 +96,7 @@ async def _llm_draft_sigma(analyst_note: str,) -> dict[str, Any]:"""Call LLM to draft a Sigma improvement. Returns parsed JSON or template."""- api_key = getattr(settings, "OPENAI_API_KEY", None) or getattr(- settings, "LLM_API_KEY", None- )+ api_key = getattr(settings, "OPENAI_API_KEY", None) or getattr(settings, "LLM_API_KEY", None)if not api_key:return _template_fallback(current_sigma, alert_fields, analyst_note)@@ -133,9 +129,7 @@ async def _llm_draft_sigma(return _template_fallback(current_sigma, alert_fields, analyst_note)-def _template_fallback(- current_sigma: str, alert_fields: dict[str, Any], analyst_note: str-) -> dict[str, Any]:+def _template_fallback(current_sigma: str, alert_fields: dict[str, Any], analyst_note: str) -> dict[str, Any]:"""Return a structured template when no LLM key is configured."""proc = alert_fields.get("process_name") or alert_fields.get("Image") or "UNKNOWN"user = alert_fields.get("user") or alert_fields.get("User") or "UNKNOWN"@@ -185,11 +179,7 @@ async def suggest_fp_fix() -> SuggestionResponse:"""Retrieve the triggering rule + alert evidence, then draft a Sigma improvement."""# 1. Load alert- row = await db.execute(- text(- "SELECT rule_id, evidence, tenant_id FROM aisoc_alerts WHERE id = :aid"- ).bindparams(aid=body.alert_id)- )+ row = await db.execute(text("SELECT rule_id, evidence, tenant_id FROM aisoc_alerts WHERE id = :aid").bindparams(aid=body.alert_id))alert_row = row.fetchone()if not alert_row:raise HTTPException(status_code=404, detail="Alert not found")@@ -201,11 +191,7 @@ async def suggest_fp_fix(# 2. Load rule body if availablecurrent_sigma = "# Rule body not found\n"if rule_id:- rule_row = await db.execute(- text(- "SELECT rule_body FROM aisoc_detection_rules WHERE id = :rid"- ).bindparams(rid=rule_id)- )+ rule_row = await db.execute(text("SELECT rule_body FROM aisoc_detection_rules WHERE id = :rid").bindparams(rid=rule_id))rule_data = rule_row.fetchone()if rule_data:current_sigma = rule_data.rule_bodydiff --git a/services/api/app/api/v1/endpoints/detection_proposals.py b/services/api/app/api/v1/endpoints/detection_proposals.pyindex 3c2272761..e904a68c7 100644--- a/services/api/app/api/v1/endpoints/detection_proposals.py+++ b/services/api/app/api/v1/endpoints/detection_proposals.py@@ -44,6 +44,7 @@ from app.models.detection_proposal import (DetectionRuleProposal,)from app.models.detection_rule import DetectionRule+from app.services.github import create_detection_prrouter = APIRouter(prefix="/detection-proposals", tags=["detection_rules", "dac"])@@ -84,6 +85,8 @@ class ProposalResponse(BaseModel):decided_by_id: uuid.UUID | Nonedecision_comment: str | Nonedecided_at: datetime | None+ # WS-B4: git PR path — URL of the GitHub PR created on promotion (may be None).+ github_pr_url: str | None = Nonecreated_at: datetimeupdated_at: datetime@@ -150,10 +153,7 @@ class RunEvalRequest(BaseModel):default=1.0,ge=0.0,le=100.0,- description=(- "Allowed MITRE accuracy regression vs the active baseline, in "- "percentage points. Forwarded to run_evals.py."- ),+ description=("Allowed MITRE accuracy regression vs the active baseline, in percentage points. Forwarded to run_evals.py."),)timeout_seconds: int = Field(default=180,@@ -476,8 +476,10 @@ def _run_eval_subprocess(cmd.extend(["--baseline", str(baseline_path)])env = os.environ.copy()- # The runner imports modules from services/agents — make sure that path is available.- env.setdefault("PYTHONPATH", str(_REPO_ROOT / "services" / "agents"))+ # The runner imports modules from services/agents — ensure that path is always present.+ agents_path = str(_REPO_ROOT / "services" / "agents")+ existing_pp = env.get("PYTHONPATH", "")+ env["PYTHONPATH"] = agents_path if not existing_pp else f"{agents_path}:{existing_pp}"proc = subprocess.run( # noqa: S603 — fixed argv, no shell=Truecmd,@@ -513,10 +515,7 @@ async def run_eval_harness(if not _EVAL_SCRIPT.exists():raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,- detail=(- f"Eval runner missing at {_EVAL_SCRIPT}. Set AISOC_REPO_ROOT or "- "verify the deployment includes scripts/run_evals.py."- ),+ detail=(f"Eval runner missing at {_EVAL_SCRIPT}. Set AISOC_REPO_ROOT or verify the deployment includes scripts/run_evals.py."),)baseline_path: Path | None = None@@ -568,10 +567,7 @@ async def run_eval_harness(if exit_code not in (0, 1, 2):raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,- detail=(- f"Eval harness failed with exit code {exit_code}. "- f"stderr={stderr[-2000:].strip()}"- ),+ detail=(f"Eval harness failed with exit code {exit_code}. stderr={stderr[-2000:].strip()}"),)# Prefer reading the on-disk JSON over parsing stdout — stdout is also@@ -582,10 +578,7 @@ async def run_eval_harness(except json.JSONDecodeError as exc:raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,- detail=(- "Eval harness produced unparseable JSON. "- f"stderr={stderr[-2000:].strip()}"- ),+ detail=(f"Eval harness produced unparseable JSON. stderr={stderr[-2000:].strip()}"),) from excfinished_at = datetime.now(UTC)@@ -769,6 +762,31 @@ async def promote_proposal(if proposal.decided_at is None:proposal.decided_at = datetime.now(UTC)proposal.decided_by_id = current_user.user_id++ # WS-B4: git PR path — Author: Beenu - [email protected]+ # Attempt to create a GitHub Pull Request carrying the Sigma/YARA rule file.+ # create_detection_pr() is a no-op (returns None) when AISOC_GITHUB_TOKEN is+ # not configured, so this never blocks promotion for unconfigured deployments.+ try:+ pr_url = await create_detection_pr(+ settings=settings,+ proposal_id=str(proposal_id),+ rule_name=proposal.name,+ rule_language=proposal.rule_language,+ rule_body=proposal.rule_body,+ category=proposal.category or "general",+ )+ if pr_url:+ proposal.github_pr_url = pr_url+ except Exception as exc: # noqa: BLE001 — log and continue, never block promotion+ import logging as _logging++ _logging.getLogger(__name__).warning(+ "WS-B4: GitHub PR creation failed for proposal %s — %s",+ proposal_id,+ exc,+ )+await db.commit()await db.refresh(proposal)return ProposalResponse.model_validate(proposal)diff --git a/services/api/app/api/v1/endpoints/detection_rules.py b/services/api/app/api/v1/endpoints/detection_rules.pyindex ffcc545e2..552bdfc9f 100644--- a/services/api/app/api/v1/endpoints/detection_rules.py+++ b/services/api/app/api/v1/endpoints/detection_rules.py@@ -113,10 +113,7 @@ async def list_rules()]- excluded_ids = (- select(MSSPRuleOverride.rule_id)- .where(MSSPRuleOverride.child_tenant_id == tid, MSSPRuleOverride.action == "exclude")- )+ excluded_ids = select(MSSPRuleOverride.rule_id).where(MSSPRuleOverride.child_tenant_id == tid, MSSPRuleOverride.action == "exclude")filters = [and_(*conditions), DetectionRule.id.notin_(excluded_ids)]if category:diff --git a/services/api/app/api/v1/endpoints/easm.py b/services/api/app/api/v1/endpoints/easm.pyindex d7d32fc6f..a31e0fab4 100644--- a/services/api/app/api/v1/endpoints/easm.py+++ b/services/api/app/api/v1/endpoints/easm.py@@ -3,7 +3,7 @@from __future__ import annotationsimport logging-from typing import Any, Dict, List, Optional+from typing import Anyfrom uuid import UUIDfrom fastapi import APIRouter, BackgroundTasks, Depends, HTTPException, Query, status@@ -46,7 +46,9 @@ async def _run_scan_job(await db.commit()logger.info("EASM scan complete: tenant=%s discovered=%d drifts=%d",- tenant_id, len(discovered), len(drift_records),+ tenant_id,+ len(discovered),+ len(drift_records),)except Exception:logger.exception("EASM scan failed for tenant=%s", tenant_id)@@ -57,7 +59,7 @@ async def trigger_easm_scan(body: ScanRequest,background_tasks: BackgroundTasks,db: AsyncSession = Depends(get_db),-) -> Dict[str, Any]:+) -> dict[str, Any]:"""Trigger an EASM discovery scan for a tenant (Tier 3.6).@@ -93,23 +95,18 @@ async def trigger_easm_scan(@router.get("/assets")async def list_external_assets(tenant_id: UUID | None = Query(None),- asset_type: Optional[ExternalAssetType] = Query(None),+ asset_type: ExternalAssetType | None = Query(None),limit: int = Query(50, le=200),db: AsyncSession = Depends(get_db),current_user: CurrentUser = Depends(get_current_user),-) -> List[Dict[str, Any]]:+) -> list[dict[str, Any]]:"""List externally discovered assets for a tenant.``tenant_id`` defaults to the authenticated user's tenant, so the analystconsole can hit ``/easm/assets`` without explicit tenant scoping."""effective_tenant = tenant_id or current_user.tenant_id- stmt = (- select(ExternalAsset)- .where(ExternalAsset.tenant_id == effective_tenant)- .order_by(ExternalAsset.last_seen.desc())- .limit(limit)- )+ stmt = select(ExternalAsset).where(ExternalAsset.tenant_id == effective_tenant).order_by(ExternalAsset.last_seen.desc()).limit(limit)if asset_type:stmt = stmt.where(ExternalAsset.asset_type == asset_type)@@ -131,11 +128,11 @@ async def list_external_assets(@router.get("/drift")async def list_external_asset_drift(tenant_id: UUID | None = Query(None),- external_asset_id: Optional[UUID] = Query(None),+ external_asset_id: UUID | None = Query(None),limit: int = Query(50, le=200),db: AsyncSession = Depends(get_db),current_user: CurrentUser = Depends(get_current_user),-) -> List[Dict[str, Any]]:+) -> list[dict[str, Any]]:"""List drift events (new ports, certs, sub-domains, etc.)."""effective_tenant = tenant_id or current_user.tenant_idstmt = (@@ -158,4 +155,4 @@ async def list_external_asset_drift("detected_at": d.detected_at.isoformat(),}for d in drifts- ]\ No newline at end of file+ ]diff --git a/services/api/app/api/v1/endpoints/fusion.py b/services/api/app/api/v1/endpoints/fusion.pyindex c6780c6fd..a016115ae 100644--- a/services/api/app/api/v1/endpoints/fusion.py+++ b/services/api/app/api/v1/endpoints/fusion.py@@ -43,11 +43,7 @@ router = APIRouter(prefix="/fusion", tags=["fusion"])# When set, requests are forwarded to the live fusion service. When unset,# the gateway returns deterministic, empty fallbacks so the UI degrades# gracefully instead of bubbling 5xx into the analyst console.-_FUSION_URL = (- os.getenv("FUSION_SERVICE_URL")- or os.getenv("FUSION_URL")- or ""-).rstrip("/")+_FUSION_URL = (os.getenv("FUSION_SERVICE_URL") or os.getenv("FUSION_URL") or "").rstrip("/")# Tight allowlist for proxied request paths. We only ever proxy to a fixed# upstream (`_FUSION_URL`) on a known set of routes, so the path must be a@@ -60,10 +56,7 @@ _SAFE_PATH_RE = re.compile(r"^/[A-Za-z0-9_\-./%]*$")def _validate_proxy_path(path: str) -> str:"""Reject any proxied path that isn't a tightly constrained relative path."""if (- not isinstance(path, str)- or not _SAFE_PATH_RE.match(path)- or ".." in path- or path.startswith("//") # protocol-relative URL+ not isinstance(path, str) or not _SAFE_PATH_RE.match(path) or ".." in path or path.startswith("//") # protocol-relative URL):raise HTTPException(status_code=400, detail="invalid_request_path")return pathdiff --git a/services/api/app/api/v1/endpoints/graph.py b/services/api/app/api/v1/endpoints/graph.pyindex 83c5445cd..12a5747e0 100644--- a/services/api/app/api/v1/endpoints/graph.py+++ b/services/api/app/api/v1/endpoints/graph.py@@ -168,10 +168,9 @@ async def _attack_path_from_relational("""row = (await db.execute(- text(- "SELECT id, title, severity, mitre_techniques, alert_ids "- "FROM aisoc_cases WHERE id = CAST(:cid AS UUID)"- ).bindparams(cid=case_id)+ text("SELECT id, title, severity, mitre_techniques, alert_ids FROM aisoc_cases WHERE id = CAST(:cid AS UUID)").bindparams(+ cid=case_id+ ))).fetchone()if not row:@@ -415,7 +414,8 @@ async def get_mitre_coverage_compat(``/graph/mitre-coverage`` and degrade gracefully (empty set) when theknowledge graph is offline, mirroring that endpoint's behaviour."""- from datetime import UTC as _UTC, datetime as _dt+ from datetime import UTC as _UTC+ from datetime import datetime as _dttry:records = await graph_service.get_mitre_coverage(diff --git a/services/api/app/api/v1/endpoints/hunts.py b/services/api/app/api/v1/endpoints/hunts.pyindex 4b9f4462d..ee5916bb6 100644--- a/services/api/app/api/v1/endpoints/hunts.py+++ b/services/api/app/api/v1/endpoints/hunts.py@@ -207,11 +207,15 @@ async def list_hunts(wheres = ["1=1"]params: dict[str, Any] = {"limit": limit, "offset": offset}if hunt_status:- wheres.append("status = :status"); params["status"] = hunt_status+ wheres.append("status = :status")+ params["status"] = hunt_statusif priority:- wheres.append("priority = :priority"); params["priority"] = priority+ wheres.append("priority = :priority")+ params["priority"] = priority- q = text(f"SELECT * FROM aisoc_hunts WHERE {' AND '.join(wheres)} ORDER BY created_at DESC LIMIT :limit OFFSET :offset").bindparams(**params)+ q = text(f"SELECT * FROM aisoc_hunts WHERE {' AND '.join(wheres)} ORDER BY created_at DESC LIMIT :limit OFFSET :offset").bindparams(+ **params+ )try:rows = (await db.execute(q)).fetchall()return [_row_to_hunt(r) for r in rows]@@ -273,29 +277,40 @@ async def update_hunt(hunt_id: uuid.UUID, body: UpdateHuntRequest, db: DBSessionparams: dict[str, Any] = {"id": hunt_id, "now": datetime.now(UTC)}if body.title is not None:- sets.append("title = :title"); params["title"] = body.title+ sets.append("title = :title")+ params["title"] = body.titleif body.hypothesis is not None:- sets.append("hypothesis = :hypothesis"); params["hypothesis"] = body.hypothesis+ sets.append("hypothesis = :hypothesis")+ params["hypothesis"] = body.hypothesisif body.mitre_tactic is not None:- sets.append("mitre_tactic = :tactic"); params["tactic"] = body.mitre_tactic+ sets.append("mitre_tactic = :tactic")+ params["tactic"] = body.mitre_tacticif body.mitre_technique is not None:- sets.append("mitre_technique = :technique"); params["technique"] = body.mitre_technique+ sets.append("mitre_technique = :technique")+ params["technique"] = body.mitre_techniqueif body.status is not None:- sets.append("status = :status"); params["status"] = body.status+ sets.append("status = :status")+ params["status"] = body.statusif body.status == "completed":sets.append("completed_at = :now")if body.priority is not None:- sets.append("priority = :priority"); params["priority"] = body.priority+ sets.append("priority = :priority")+ params["priority"] = body.priorityif body.assigned_to is not None:- sets.append("assigned_to = :assigned"); params["assigned"] = body.assigned_to+ sets.append("assigned_to = :assigned")+ params["assigned"] = body.assigned_toif body.query_esql is not None:- sets.append("query_esql = :esql"); params["esql"] = body.query_esql+ sets.append("query_esql = :esql")+ params["esql"] = body.query_esqlif body.query_spl is not None:- sets.append("query_spl = :spl"); params["spl"] = body.query_spl+ sets.append("query_spl = :spl")+ params["spl"] = body.query_splif body.query_kql is not None:- sets.append("query_kql = :kql"); params["kql"] = body.query_kql+ sets.append("query_kql = :kql")+ params["kql"] = body.query_kqlif body.tags is not None:- sets.append("tags = :tags::text[]"); params["tags"] = body.tags+ sets.append("tags = :tags::text[]")+ params["tags"] = body.tagsq = text(f"UPDATE aisoc_hunts SET {', '.join(sets)} WHERE id = :id RETURNING *").bindparams(**params)try:@@ -371,10 +386,15 @@ async def run_hunt(hunt_id: uuid.UUID, body: RunHuntRequest, db: DBSession, userrow = (await db.execute(q)).fetchone()await db.commit()return HuntRunResponse(- id=row.id, hunt_id=row.hunt_id, run_at=row.run_at,- platform=row.platform, query_used=row.query_used,- hit_count=row.hit_count, result_sample=list(row.result_sample or []),- duration_ms=row.duration_ms, error=row.error,+ id=row.id,+ hunt_id=row.hunt_id,+ run_at=row.run_at,+ platform=row.platform,+ query_used=row.query_used,+ hit_count=row.hit_count,+ result_sample=list(row.result_sample or []),+ duration_ms=row.duration_ms,+ error=row.error,)except Exception as exc:await db.rollback()@@ -383,13 +403,20 @@ async def run_hunt(hunt_id: uuid.UUID, body: RunHuntRequest, db: DBSession, user@router.get("/{hunt_id}/runs", response_model=list[HuntRunResponse], summary="List hunt runs")async def list_runs(hunt_id: uuid.UUID, db: DBSession, user: AuthUser) -> list[HuntRunResponse]:- rows = (await db.execute(text("SELECT * FROM aisoc_hunt_runs WHERE hunt_id = :id ORDER BY run_at DESC LIMIT 100").bindparams(id=hunt_id))).fetchall()+ rows = (+ await db.execute(text("SELECT * FROM aisoc_hunt_runs WHERE hunt_id = :id ORDER BY run_at DESC LIMIT 100").bindparams(id=hunt_id))+ ).fetchall()return [HuntRunResponse(- id=r.id, hunt_id=r.hunt_id, run_at=r.run_at,- platform=r.platform, query_used=r.query_used,- hit_count=r.hit_count, result_sample=list(r.result_sample or []),- duration_ms=r.duration_ms, error=r.error,+ id=r.id,+ hunt_id=r.hunt_id,+ run_at=r.run_at,+ platform=r.platform,+ query_used=r.query_used,+ hit_count=r.hit_count,+ result_sample=list(r.result_sample or []),+ duration_ms=r.duration_ms,+ error=r.error,)for r in rows]@@ -412,7 +439,9 @@ async def add_findings(hunt_id: uuid.UUID, body: AddFindingsRequest, db: DBSessiextra_set = ", false_positive_rate = :fpr"params["fpr"] = body.false_positive_rate- q = text(f"UPDATE aisoc_hunts SET findings = :findings::jsonb, updated_at = :now{extra_set} WHERE id = :id RETURNING *").bindparams(**params)+ q = text(f"UPDATE aisoc_hunts SET findings = :findings::jsonb, updated_at = :now{extra_set} WHERE id = :id RETURNING *").bindparams(+ **params+ )try:row = (await db.execute(q)).fetchone()await db.commit()diff --git a/services/api/app/api/v1/endpoints/identity_timeline.py b/services/api/app/api/v1/endpoints/identity_timeline.pyindex 37860feef..3774b4241 100644--- a/services/api/app/api/v1/endpoints/identity_timeline.py+++ b/services/api/app/api/v1/endpoints/identity_timeline.py@@ -69,6 +69,7 @@ class BuildTimelineRequest(BaseModel):# Helpers# ────────────────────────────────────────────────────────────────────────────+def _risk_score(events: list[TimelineEvent]) -> float:"""Simple heuristic: sum severity weights, cap at 100."""weights = {"critical": 40, "high": 20, "medium": 10, "low": 3, "info": 1}@@ -77,11 +78,7 @@ def _risk_score(events: list[TimelineEvent]) -> float:def _mitre_from_alert(raw: dict[str, Any]) -> str | None:- return (- raw.get("mitre_technique")- or raw.get("mitre_attack_id")- or raw.get("tags", {}).get("mitre")- )+ return raw.get("mitre_technique") or raw.get("mitre_attack_id") or raw.get("tags", {}).get("mitre")# ────────────────────────────────────────────────────────────────────────────@@ -137,8 +134,7 @@ async def build_timeline(source="aisoc_alerts",description=row.title or "Alert",severity=row.severity,- mitre_technique=row.mitre_technique- or _mitre_from_alert(row.evidence or {}),+ mitre_technique=row.mitre_technique or _mitre_from_alert(row.evidence or {}),raw=row.evidence,))diff --git a/services/api/app/api/v1/endpoints/inbox.py b/services/api/app/api/v1/endpoints/inbox.pyindex c3bb19b66..b5218ac77 100644--- a/services/api/app/api/v1/endpoints/inbox.py+++ b/services/api/app/api/v1/endpoints/inbox.py@@ -148,13 +148,12 @@ class InboxTokenCreate(BaseModel):template_id: str = Field(...,description=(- "Vendor template stem from ``services/ingest/internal/normalizer/"- "templates/*.yaml`` (e.g. ``pagerduty``, ``generic-json``)."+ "Vendor template stem from ``services/ingest/internal/normalizer/templates/*.yaml`` (e.g. ``pagerduty``, ``generic-json``)."),)label: str | None = Field(default=None,- description="Operator-facing label (\"PagerDuty on-call\").",+ description='Operator-facing label ("PagerDuty on-call").',)hmac_secret: str | None = Field(default=None,@@ -214,10 +213,7 @@ class InboxTemplateInfo(BaseModel):_TEMPLATE_CATALOG: dict[str, dict[str, str]] = {"generic-json": {"label": "Generic JSON",- "description": (- "Forward arbitrary JSON. Best effort field mapping; use a "- "specific template below if your vendor is listed."- ),+ "description": ("Forward arbitrary JSON. Best effort field mapping; use a specific template below if your vendor is listed."),"category": "generic",},"pagerduty": {@@ -263,17 +259,13 @@ _TEMPLATE_CATALOG: dict[str, dict[str, str]] = {"splunk-hec": {"label": "Splunk HEC-compatible","description": (- "Drop-in replacement for Splunk HTTP Event Collector. Re-target "- "any tool already pointed at Splunk HEC by changing the URL."+ "Drop-in replacement for Splunk HTTP Event Collector. Re-target any tool already pointed at Splunk HEC by changing the URL."),"category": "siem",},"email-forwarded": {"label": "Forwarded email",- "description": (- "Inbound webhook from Mailgun / SES routing rules. Useful for "- "vendors that only deliver alerts via email."- ),+ "description": ("Inbound webhook from Mailgun / SES routing rules. Useful for vendors that only deliver alerts via email."),"category": "email",},"itsm-inbound": {@@ -356,9 +348,7 @@ async def list_tokens(look at expired tokens, and showing them by default makes the"rotate token" flow noisy."""- stmt = select(TenantInboxToken).where(- TenantInboxToken.tenant_id == current_user.tenant_id- )+ stmt = select(TenantInboxToken).where(TenantInboxToken.tenant_id == current_user.tenant_id)if not include_revoked:stmt = stmt.where(TenantInboxToken.revoked_at.is_(None))stmt = stmt.order_by(TenantInboxToken.created_at.desc())@@ -475,11 +465,7 @@ async def rotate_token()db.add(new_row)- await db.execute(- update(TenantInboxToken)- .where(TenantInboxToken.token == old.token)- .values(revoked_at=datetime.now(UTC))- )+ await db.execute(update(TenantInboxToken).where(TenantInboxToken.token == old.token).values(revoked_at=datetime.now(UTC)))await db.commit()await db.refresh(new_row)@@ -530,11 +516,7 @@ async def revoke_token()target = matches[0]- await db.execute(- update(TenantInboxToken)- .where(TenantInboxToken.token == target.token)- .values(revoked_at=datetime.now(UTC))- )+ await db.execute(update(TenantInboxToken).where(TenantInboxToken.token == target.token).values(revoked_at=datetime.now(UTC)))await db.commit()logger.info(diff --git a/services/api/app/api/v1/endpoints/inbox_itsm.py b/services/api/app/api/v1/endpoints/inbox_itsm.pyindex 9699e9d91..ec18e0c3c 100644--- a/services/api/app/api/v1/endpoints/inbox_itsm.py+++ b/services/api/app/api/v1/endpoints/inbox_itsm.py@@ -384,9 +384,7 @@ async def _fetch_token_and_connector(# carries the fingerprint for ops debugging.logger.info("inbox_itsm.token_not_found",- extra={- "token_fingerprint": safe_log_value(f"...{tenant_token[-8:]}")- },+ extra={"token_fingerprint": safe_log_value(f"...{tenant_token[-8:]}")},)raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED,@@ -399,10 +397,7 @@ async def _fetch_token_and_connector(# We refuse to act on it — let the wizard mint a fresh ITSM token.raise HTTPException(status_code=status.HTTP_403_FORBIDDEN,- detail=(- "Inbox token is not valid for ITSM webhooks. "- "Mint a token with template_id='itsm-inbound'."- ),+ detail=("Inbox token is not valid for ITSM webhooks. Mint a token with template_id='itsm-inbound'."),)# 2. Resolve the connector. tenant_id check below prevents using a@@ -497,20 +492,10 @@ async def _apply_status_to_case(# anyway, but defending in depth is cheap). COALESCE keeps the first# transition's timestamp.triaged_at_set = (- ", triaged_at = COALESCE(triaged_at, :now)"- if new_status in {"triaged", "investigating", "contained", "resolved", "closed"}- else ""- )- resolved_at_set = (- ", resolved_at = COALESCE(resolved_at, :now)"- if new_status == "resolved"- else ""- )- closed_at_set = (- ", closed_at = COALESCE(closed_at, :now)"- if new_status == "closed"- else ""+ ", triaged_at = COALESCE(triaged_at, :now)" if new_status in {"triaged", "investigating", "contained", "resolved", "closed"} else "")+ resolved_at_set = ", resolved_at = COALESCE(resolved_at, :now)" if new_status == "resolved" else ""+ closed_at_set = ", closed_at = COALESCE(closed_at, :now)" if new_status == "closed" else ""await db.execute(text(@@ -543,10 +528,7 @@ async def _apply_status_to_case())- note_body = (- f"{vendor.title()} ticket {external_id} transitioned. "- f"AiSOC case marked '{new_status}' via inbound webhook."- )+ note_body = f"{vendor.title()} ticket {external_id} transitioned. AiSOC case marked '{new_status}' via inbound webhook."await db.execute(text("""@@ -709,21 +691,14 @@ async def inbound_itsm_webhook(old_status=None,new_status=None,status_changed=False,- note=(- f"No AiSOC case linked to {vendor} {external_id}. "- "The ticket may pre-date the integration."- ),+ note=(f"No AiSOC case linked to {vendor} {external_id}. The ticket may pre-date the integration."),)# Update last_used_at on the inbox token regardless of whether the# status changed, so operators can see "this token is alive". Done# on every successful auth+resolve, not just on writes.now = datetime.now(UTC)- await db.execute(- text(- "UPDATE tenant_inbox_tokens SET last_used_at = :now WHERE token = :tok"- ).bindparams(now=now, tok=tenant_token)- )+ await db.execute(text("UPDATE tenant_inbox_tokens SET last_used_at = :now WHERE token = :tok").bindparams(now=now, tok=tenant_token))new_status = _map_inbound_status(vendor, raw_status)if new_status is None:@@ -747,10 +722,7 @@ async def inbound_itsm_webhook(old_status=ref_row.status,new_status=ref_row.status,status_changed=False,- note=(- f"{vendor} status '{raw_status}' has no AiSOC equivalent; "- "last_synced_at bumped."- ),+ note=(f"{vendor} status '{raw_status}' has no AiSOC equivalent; last_synced_at bumped."),)if new_status == ref_row.status:diff --git a/services/api/app/api/v1/endpoints/investigations.py b/services/api/app/api/v1/endpoints/investigations.pyindex cf331bf7c..b128541e5 100644--- a/services/api/app/api/v1/endpoints/investigations.py+++ b/services/api/app/api/v1/endpoints/investigations.py@@ -8,13 +8,18 @@ replay every agent decision.Endpoints:-* ``GET /v1/investigations`` - list runs for this tenant-* ``GET /v1/investigations/{run_id}`` - run summary + counts-* ``GET /v1/investigations/{run_id}/events`` - paginated event timeline-* ``GET /v1/investigations/{run_id}/replay`` - full ordered event list-* ``GET /v1/investigations/{run_id}/explain`` - per-step deep-dive: prompt,- response, evidence, downstream- effects for a single ``seq``+* ``GET /v1/investigations`` - list runs for this tenant+* ``GET /v1/investigations/{run_id}`` - run summary + counts+* ``GET /v1/investigations/{run_id}/events`` - paginated event timeline+* ``GET /v1/investigations/{run_id}/replay`` - full ordered event list+* ``GET /v1/investigations/{run_id}/timeline`` - scrubbable timeline with+ decision-provenance annotations+ and cross-attempt diffs+* ``GET /v1/investigations/{run_id}/explain`` - per-step deep-dive: prompt,+ response, evidence, downstream+ effects for a single ``seq``+* ``POST /v1/investigations/{run_id}/close`` - close run + generate summary artifact+* ``GET /v1/investigations/{run_id}/summary.pdf`` - PDF export of investigation summary* ``GET /v1/investigations/{run_id}/artifacts/{artifact_id}`` - blob payloadAll endpoints respect tenant RLS via ``TenantDBSession``.@@ -22,13 +27,18 @@ All endpoints respect tenant RLS via ``TenantDBSession``.from __future__ import annotations+import hashlib+import io+import textwrapimport uuid-from datetime import datetime+from datetime import UTC, datetimefrom typing import Annotatedfrom fastapi import APIRouter, Depends, HTTPException, Query, status+from fastapi.responses import StreamingResponsefrom pydantic import BaseModelfrom sqlalchemy import func, select, text+from sqlalchemy.engine import RowMappingfrom app.api.v1.deps import AuthUser, require_permissionfrom app.db.rls import TenantDBSession@@ -213,7 +223,7 @@ async def _fetch_run(return run-def _aggregate_row(row: dict) -> CostAggregateRow:+def _aggregate_row(row: RowMapping) -> CostAggregateRow:"""Convert a single ``aisoc_run_costs`` aggregate row into the API model.Centralises the SUM-COALESCE-cast dance and the divide-by-zero guards@@ -338,9 +348,10 @@ async def aggregate_costs(models would double-count runs that touched more than one model)."""rows = (- await db.execute(- text(- """+ (+ await db.execute(+ text(+ """SELECT GROUPING(c.model) AS is_total,COALESCE(c.model, '__total__') AS model,COUNT(DISTINCT c.run_id) AS runs,@@ -356,13 +367,16 @@ async def aggregate_costs(GROUP BY GROUPING SETS ((c.model), ())ORDER BY GROUPING(c.model), SUM(c.total_cost_usd) DESC"""- ),- {- "tenant_id": current_user.tenant_id,- "window_days": window_days,- },+ ),+ {+ "tenant_id": current_user.tenant_id,+ "window_days": window_days,+ },+ ))- ).mappings().all()+ .mappings()+ .all()+ )by_model: list[CostAggregateRow] = []totals: CostAggregateRow | None = None@@ -601,3 +615,418 @@ async def get_artifact(content=art.content,blob_ref=art.blob_ref,)+++# ---------------------------------------------------------------------------+# Close + auto-summary (WS-D2)+# ---------------------------------------------------------------------------+++class CloseRequest(BaseModel):+ """Optional analyst note appended to the auto-generated summary."""++ analyst_note: str | None = None+++class ClosedSummary(BaseModel):+ """Response body for POST /close."""++ run_id: uuid.UUID+ status: str+ artifact_id: uuid.UUID+ summary_markdown: str+++# ---------------------------------------------------------------------------+# Timeline schemas (WS-D3)+# ---------------------------------------------------------------------------+++class TimelineDecision(BaseModel):+ """Agent decision provenance annotation for a single timeline node."""++ reason: str | None+ confidence: float | None+ next_phase: str | None+ tool_name: str | None+ tool_args: dict | None+ tool_result_summary: str | None+++class TimelineNode(BaseModel):+ """One node in the scrubbable investigation timeline."""++ seq: int+ ts: datetime+ kind: str+ agent: str+ summary: str+ duration_ms: int+ decision: TimelineDecision | None+ has_artifact: bool+ diff_vs_prev_attempt: str | None+++class TimelineResponse(BaseModel):+ """Full timeline for a closed or in-progress run.++ ``nodes`` are ordered by ``seq`` ascending. ``total_duration_ms`` is the+ wall-clock span from first to last event. ``attempt_count`` counts unique+ retry attempts inferred from ``agent_start`` events.+ """++ run_id: uuid.UUID+ case_id: str+ status: str+ total_duration_ms: int+ attempt_count: int+ nodes: list[TimelineNode]+++def _extract_decision(event: InvestigationEvent) -> TimelineDecision | None:+ """Extract decision-provenance fields from an event's payload.++ The agent graph stores structured decision metadata in the JSONB+ ``payload`` column. The keys used here mirror ``StepKind`` labels in+ ``services/agents/app/investigator/state.py``. We gracefully tolerate+ missing keys so older ledger rows still render without error.+ """+ if event.payload is None:+ return None+ p = event.payload+ reason = p.get("reason") or p.get("rationale") or p.get("explanation")+ confidence = p.get("confidence")+ try:+ confidence = float(confidence) if confidence is not None else None+ except (TypeError, ValueError):+ confidence = None++ next_phase = p.get("next_phase") or p.get("next_step") or p.get("transition")+ tool_name = p.get("tool") or p.get("tool_name") or p.get("action")+ tool_args = p.get("tool_args") or p.get("args") or p.get("parameters")+ result = p.get("result") or p.get("output") or p.get("tool_result")+ if isinstance(result, dict):+ tool_result_summary = result.get("summary") or result.get("message") or str(result)[:200]+ elif isinstance(result, str):+ tool_result_summary = result[:200]+ else:+ tool_result_summary = None++ if not any([reason, confidence, next_phase, tool_name]):+ return None+ return TimelineDecision(+ reason=reason,+ confidence=confidence,+ next_phase=next_phase,+ tool_name=tool_name,+ tool_args=tool_args,+ tool_result_summary=tool_result_summary,+ )+++def _diff_vs_prev(+ events: list[InvestigationEvent],+ idx: int,+) -> str | None:+ """Produce a one-line diff annotation when the same agent re-ran a step.++ Compares ``summary`` text between the current event and the last event+ of the same ``kind`` and ``agent`` combination that occurred earlier+ in the same run. Returns ``None`` when no prior attempt exists or the+ summaries are identical.+ """+ current = events[idx]+ for prior in reversed(events[:idx]):+ if prior.kind == current.kind and prior.agent == current.agent:+ if prior.summary == current.summary:+ return None+ old_words = set(prior.summary.split())+ new_words = set(current.summary.split())+ added = new_words - old_words+ removed = old_words - new_words+ parts: list[str] = []+ if removed:+ parts.append(f"-{len(removed)} words")+ if added:+ parts.append(f"+{len(added)} words")+ return f"Changed vs seq {prior.seq}: {', '.join(parts)}" if parts else None+ return None++[email protected]("/{run_id}/timeline", response_model=TimelineResponse)+async def get_timeline(+ run_id: uuid.UUID,+ current_user: Annotated[AuthUser, Depends(require_permission("cases:read"))],+ db: TenantDBSession,+) -> TimelineResponse:+ """Return a scrubbable investigation timeline with decision-provenance annotations.++ Each node carries:+ * ``decision`` — structured provenance (reason, confidence, next phase,+ tool name/args/result) extracted from the event ``payload``.+ * ``has_artifact`` — whether a detailed transcript artifact is attached.+ * ``diff_vs_prev_attempt`` — one-line diff for repeated steps so analysts+ can see how the agent corrected itself across retry attempts.++ The response is bounded at 10 000 events. Use the paginated ``/events``+ endpoint for runs that exceed this.+ """+ run = await _fetch_run(db, run_id, current_user.tenant_id)++ events_q = select(InvestigationEvent).where(InvestigationEvent.run_id == run_id).order_by(InvestigationEvent.seq.asc()).limit(10000)+ events: list[InvestigationEvent] = list((await db.execute(events_q)).scalars().all())++ artifact_event_ids_q = select(InvestigationArtifact.event_id).where(+ InvestigationArtifact.run_id == run_id,+ InvestigationArtifact.event_id.isnot(None),+ )+ artifact_event_ids: set[uuid.UUID] = {eid for eid in (await db.execute(artifact_event_ids_q)).scalars().all() if eid is not None}++ nodes: list[TimelineNode] = []+ for idx, ev in enumerate(events):+ nodes.append(+ TimelineNode(+ seq=ev.seq,+ ts=ev.ts,+ kind=ev.kind,+ agent=ev.agent,+ summary=ev.summary,+ duration_ms=ev.duration_ms,+ decision=_extract_decision(ev),+ has_artifact=ev.id in artifact_event_ids,+ diff_vs_prev_attempt=_diff_vs_prev(events, idx),+ )+ )++ total_ms = 0+ if len(events) >= 2:+ first_ts = events[0].ts+ last_ts = events[-1].ts+ total_ms = int((last_ts - first_ts).total_seconds() * 1000)++ attempt_count = sum(1 for e in events if e.kind in ("agent_start", "run_start"))+ if attempt_count == 0:+ attempt_count = 1++ return TimelineResponse(+ run_id=run.id,+ case_id=run.case_id,+ status=run.status,+ total_duration_ms=total_ms,+ attempt_count=attempt_count,+ nodes=nodes,+ )+++def _build_summary_markdown(+ run: InvestigationRun,+ events: list[InvestigationEvent],+ analyst_note: str | None,+) -> str:+ """Build a structured Markdown investigation summary from ORM objects.++ The summary is deterministic (no LLM call) so it is always available+ even in air-gapped / local-LLM mode. It mirrors the structure that+ WS-H3 (Audit export) will ingest.+ """+ started = run.started_at.strftime("%Y-%m-%d %H:%M:%S UTC") if run.started_at else "—"+ closed_at = datetime.now(UTC).strftime("%Y-%m-%d %H:%M:%S UTC")++ # Tally event kinds+ kind_counts: dict[str, int] = {}+ for ev in events:+ kind_counts[ev.kind] = kind_counts.get(ev.kind, 0) + 1++ timeline_lines = []+ for ev in events[-20:]: # last 20 steps to keep the artifact manageable+ ts = ev.ts.strftime("%H:%M:%S") if ev.ts else "—"+ timeline_lines.append(f"| {ts} | `{ev.kind}` | {ev.agent} | {ev.summary[:120]} |")++ timeline_md = (+ ("| Time | Kind | Agent | Summary |\n|------|------|-------|---------| \n" + "\n".join(timeline_lines))+ if timeline_lines+ else "_No events recorded._"+ )++ note_section = f"\n## Analyst Note\n\n{analyst_note}\n" if analyst_note else ""++ return textwrap.dedent(f"""\+ # Investigation Summary — {run.case_id}++ **Run ID:** `{run.id}`+ **Status:** {run.status}+ **Model:** {run.model_used or "unknown"}+ **Started:** {started}+ **Closed:** {closed_at}++ ## Metrics++ | Metric | Value |+ |--------|-------|+ | Iterations | {run.iterations} |+ | Total tokens | {run.total_tokens:,} |+ | Estimated cost (USD) | ${float(run.total_cost_usd):.4f} |+ | Events recorded | {len(events)} |++ ## Event Kind Breakdown++ {chr(10).join(f"- **{k}**: {v}" for k, v in sorted(kind_counts.items()))}++ ## Timeline (last {min(20, len(events))} steps)++ {timeline_md}+ {note_section}+ ---+ *Generated by AiSOC — [email protected]*+ """)++[email protected]("/{run_id}/close", response_model=ClosedSummary)+async def close_investigation(+ run_id: uuid.UUID,+ body: CloseRequest,+ current_user: Annotated[AuthUser, Depends(require_permission("cases:write"))],+ db: TenantDBSession,+) -> ClosedSummary:+ """Close an investigation run and persist an auto-generated summary artifact.++ Idempotent: if the run is already closed a summary artifact is still+ generated and returned (useful for re-generating the PDF).++ Status transitions: ``running | completed | failed`` → ``closed``+ """+ run = await _fetch_run(db, run_id, current_user.tenant_id)++ # Load all events for summary generation+ events_result = await db.execute(+ select(InvestigationEvent).where(InvestigationEvent.run_id == run_id).order_by(InvestigationEvent.seq.asc())+ )+ events = list(events_result.scalars().all())++ summary_md = _build_summary_markdown(run, events, body.analyst_note)+ encoded = summary_md.encode()+ sha = hashlib.sha256(encoded).hexdigest()++ artifact = InvestigationArtifact(+ run_id=run_id,+ tenant_id=current_user.tenant_id,+ kind="investigation-summary",+ content=summary_md,+ sha256=sha,+ size_bytes=len(encoded),+ )+ db.add(artifact)++ # Transition status to closed+ run.status = "closed"+ run.completed_at = run.completed_at or datetime.now(UTC)++ await db.commit()+ await db.refresh(artifact)++ return ClosedSummary(+ run_id=run_id,+ status="closed",+ artifact_id=artifact.id,+ summary_markdown=summary_md,+ )++[email protected]("/{run_id}/summary.pdf")+async def export_summary_pdf(+ run_id: uuid.UUID,+ current_user: Annotated[AuthUser, Depends(require_permission("cases:read"))],+ db: TenantDBSession,+) -> StreamingResponse:+ """Stream the investigation summary as a PDF.++ Looks for the most recent ``investigation-summary`` artifact. If none+ exists yet the caller should ``POST /close`` first. The PDF is generated+ server-side using pure-Python ``reportlab`` so there are no browser or+ headless-Chrome dependencies.+ """+ await _fetch_run(db, run_id, current_user.tenant_id)++ # Fetch most recent summary artifact+ q = (+ select(InvestigationArtifact)+ .where(+ InvestigationArtifact.run_id == run_id,+ InvestigationArtifact.kind == "investigation-summary",+ )+ .order_by(InvestigationArtifact.created_at.desc())+ .limit(1)+ )+ art = (await db.execute(q)).scalar_one_or_none()+ if art is None:+ raise HTTPException(+ status_code=status.HTTP_404_NOT_FOUND,+ detail="No summary artifact found. POST /close first to generate one.",+ )++ pdf_bytes = _render_pdf(art.content or "", str(run_id))+ filename = f"investigation-{run_id}.pdf"+ return StreamingResponse(+ io.BytesIO(pdf_bytes),+ media_type="application/pdf",+ headers={"Content-Disposition": f'attachment; filename="{filename}"'},+ )+++def _render_pdf(markdown_text: str, run_id: str) -> bytes:+ """Render Markdown text to a minimal PDF using reportlab.++ Falls back to a plain-text PDF if reportlab is not installed so the+ endpoint never 500s in environments that haven't installed the optional+ dependency.+ """+ try:+ from reportlab.lib.pagesizes import A4 # type: ignore[import-untyped]+ from reportlab.lib.styles import getSampleStyleSheet # type: ignore[import-untyped]+ from reportlab.lib.units import cm # type: ignore[import-untyped]+ from reportlab.platypus import ( # type: ignore[import-untyped]+ Paragraph,+ SimpleDocTemplate,+ Spacer,+ )++ buf = io.BytesIO()+ doc = SimpleDocTemplate(+ buf,+ pagesize=A4,+ rightMargin=2 * cm,+ leftMargin=2 * cm,+ topMargin=2 * cm,+ bottomMargin=2 * cm,+ )+ styles = getSampleStyleSheet()+ story = []++ for line in markdown_text.splitlines():+ stripped = line.strip()+ if stripped.startswith("# "):+ story.append(Paragraph(stripped[2:], styles["Title"]))+ elif stripped.startswith("## "):+ story.append(Spacer(1, 0.3 * cm))+ story.append(Paragraph(stripped[3:], styles["Heading2"]))+ elif stripped.startswith("| "):+ # Render table rows as monospace for readability+ story.append(Paragraph(f"<font name='Courier' size='8'>{stripped}</font>", styles["Normal"]))+ elif stripped.startswith("- "):+ story.append(Paragraph(f"• {stripped[2:]}", styles["Normal"]))+ elif stripped.startswith("*") and stripped.endswith("*"):+ story.append(Spacer(1, 0.2 * cm))+ story.append(Paragraph(f"<i>{stripped.strip('*')}</i>", styles["Normal"]))+ elif stripped:+ story.append(Paragraph(stripped, styles["Normal"]))+ else:+ story.append(Spacer(1, 0.2 * cm))++ doc.build(story)+ return buf.getvalue()++ except ImportError:+ # reportlab not installed — emit a plain-text PDF-like fallback+ header = b"%PDF-1.4\n1 0 obj\n<< /Type /Catalog /Pages 2 0 R >>\nendobj\n"+ body = markdown_text.encode("utf-8", errors="replace")+ return header + bodydiff --git a/services/api/app/api/v1/endpoints/knowledge_base.py b/services/api/app/api/v1/endpoints/knowledge_base.pyindex 6d3aac61b..9f03fdbe9 100644--- a/services/api/app/api/v1/endpoints/knowledge_base.py+++ b/services/api/app/api/v1/endpoints/knowledge_base.py@@ -86,7 +86,7 @@ class QueryResponse(BaseModel):def _chunk(content: str, chunk_size: int = _CHUNK_SIZE) -> list[str]:- return [content[i: i + chunk_size] for i in range(0, len(content), chunk_size)] or [content]+ return [content[i : i + chunk_size] for i in range(0, len(content), chunk_size)] or [content]def _row_to_doc(row: Any) -> KBDocResponse:@@ -142,7 +142,9 @@ async def _synthesise(question: str, chunks: list[KBChunk]) -> str | None:# ────────────────────────────────────────────────────────────────────────────[email protected]("/ingest", response_model=list[KBDocResponse], status_code=status.HTTP_201_CREATED, summary="Ingest document into knowledge base")+ "/ingest", response_model=list[KBDocResponse], status_code=status.HTTP_201_CREATED, summary="Ingest document into knowledge base"+)async def ingest(body: IngestRequest, db: DBSession, user: AuthUser) -> list[KBDocResponse]:chunks = _chunk(body.content)now = datetime.now(UTC)@@ -182,7 +184,9 @@ async def ingest(body: IngestRequest, db: DBSession, user: AuthUser) -> list[KBD@router.get("/documents", response_model=list[KBDocResponse], summary="List KB documents")async def list_documents(db: DBSession, user: AuthUser) -> list[KBDocResponse]:try:- rows = (await db.execute(text("SELECT * FROM aisoc_kb_documents WHERE chunk_index = 0 ORDER BY created_at DESC LIMIT 200"))).fetchall()+ rows = (+ await db.execute(text("SELECT * FROM aisoc_kb_documents WHERE chunk_index = 0 ORDER BY created_at DESC LIMIT 200"))+ ).fetchall()return [_row_to_doc(r) for r in rows]except Exception as exc:raise HTTPException(status_code=503, detail=f"Database error: {exc}") from exc@@ -217,7 +221,7 @@ async def query_kb(body: QueryRequest, db: DBSession, user: AuthUser) -> QueryResql = text(f"""SELECT *, ts_rank(to_tsvector('english', content), plainto_tsquery('english', :q)) AS rankFROM aisoc_kb_documents- WHERE {' AND '.join(wheres)}+ WHERE {" AND ".join(wheres)}ORDER BY rank DESCLIMIT :limit""").bindparams(**params)diff --git a/services/api/app/api/v1/endpoints/lake.py b/services/api/app/api/v1/endpoints/lake.pyindex 33de6b876..c2d9f171d 100644--- a/services/api/app/api/v1/endpoints/lake.py+++ b/services/api/app/api/v1/endpoints/lake.py@@ -113,19 +113,13 @@ class LakeQueryRequest(BaseModel):default=None,ge=1,le=MAX_ROW_CAP,- description=(- f"Optional ``LIMIT`` clamp; defaults to {DEFAULT_ROW_CAP}, "- f"hard-capped at {MAX_ROW_CAP}."- ),+ description=(f"Optional ``LIMIT`` clamp; defaults to {DEFAULT_ROW_CAP}, hard-capped at {MAX_ROW_CAP}."),)timeout_seconds: float | None = Field(default=None,gt=0,le=60.0,- description=(- "Optional wall-clock cap. Defaults to the server cap "- "(30s). Useful for agent loops that need to fail fast."- ),+ description=("Optional wall-clock cap. Defaults to the server cap (30s). Useful for agent loops that need to fail fast."),)@@ -415,9 +409,7 @@ async def execute_lake_sql(async def get_lake_schema(response: Response,request: Request,- current_user: Annotated[- AuthUser, Depends(require_permission("lake:read_schema"))- ],+ current_user: Annotated[AuthUser, Depends(require_permission("lake:read_schema"))],db: DBSession,) -> LakeSchemaResponse:"""Return column metadata for the lake's allowlisted tables.diff --git a/services/api/app/api/v1/endpoints/llm_credentials.py b/services/api/app/api/v1/endpoints/llm_credentials.pyindex 31a1b5c2b..4b1bfe686 100644--- a/services/api/app/api/v1/endpoints/llm_credentials.py+++ b/services/api/app/api/v1/endpoints/llm_credentials.py@@ -85,9 +85,7 @@ LlmProvider = Literal[# Providers that *require* a non-NULL ``base_url``. Hosted SaaS providers# default to a canonical endpoint and reject base-URL spoofing; local +# custom providers must tell us where to point.-_PROVIDERS_REQUIRING_BASE_URL: frozenset[str] = frozenset(- {"local-ollama", "local-vllm", "local-litellm", "custom"}-)+_PROVIDERS_REQUIRING_BASE_URL: frozenset[str] = frozenset({"local-ollama", "local-vllm", "local-litellm", "custom"})# Providers that require a non-NULL API key. Local providers without# auth (Ollama default install, vLLM behind an internal LB) legitimatelydiff --git a/services/api/app/api/v1/endpoints/llm_status.py b/services/api/app/api/v1/endpoints/llm_status.pyindex fc91b69ca..adc8ba9f4 100644--- a/services/api/app/api/v1/endpoints/llm_status.py+++ b/services/api/app/api/v1/endpoints/llm_status.py@@ -143,12 +143,7 @@ def _env_baseline() -> tuple[str, str, bool]:overrides on top by name."""base_url = os.getenv("LLM_BASE_URL") or os.getenv("OPENAI_BASE_URL") or ""- model = (- os.getenv("LLM_MODEL")- or os.getenv("OPENAI_MODEL")- or os.getenv("AISOC_LLM_MODEL")- or ""- )+ model = os.getenv("LLM_MODEL") or os.getenv("OPENAI_MODEL") or os.getenv("AISOC_LLM_MODEL") or ""key_set = bool(os.getenv("OPENAI_API_KEY") or os.getenv("LLM_API_KEY"))return base_url, model, key_set@@ -196,9 +191,7 @@ def _compute_status(# which is never compliant under air-gap.airgap_compliant = Falseelse:- airgap_compliant = is_host_allowed_for_airgap(- host, settings.AISOC_AIRGAP_ALLOWLIST- )+ airgap_compliant = is_host_allowed_for_airgap(host, settings.AISOC_AIRGAP_ALLOWLIST)is_local = _is_loopback_or_private_host(host)@@ -230,19 +223,12 @@ def _compute_status(elif effective_path == "fallback":# key_set is False but base_url may be set — uncommon but possible.policy_note = (- "OPENAI_API_KEY (or LLM_API_KEY) is unset, so LLM calls are "- "disabled and Explain falls back to deterministic summaries."+ "OPENAI_API_KEY (or LLM_API_KEY) is unset, so LLM calls are disabled and Explain falls back to deterministic summaries.")elif is_local:- policy_note = (- f"LLM calls are routed to a local provider ({provider}). No "- "external network egress is required for the Explain path."- )+ policy_note = f"LLM calls are routed to a local provider ({provider}). No external network egress is required for the Explain path."else:- policy_note = (- f"LLM calls are routed to {provider} at {host}. Outbound HTTP "- "is required."- )+ policy_note = f"LLM calls are routed to {provider} at {host}. Outbound HTTP is required."return {"provider": provider,@@ -326,11 +312,7 @@ async def tenant_llm_status("""env_base_url, env_model, env_key_set = _env_baseline()- row = await db.execute(- select(TenantLlmCredential).where(- TenantLlmCredential.tenant_id == tenant_id- )- )+ row = await db.execute(select(TenantLlmCredential).where(TenantLlmCredential.tenant_id == tenant_id))cred = row.scalar_one_or_none()if cred is None or not cred.enabled:diff --git a/services/api/app/api/v1/endpoints/metrics.py b/services/api/app/api/v1/endpoints/metrics.pyindex 18d3533fa..53d7202aa 100644--- a/services/api/app/api/v1/endpoints/metrics.py+++ b/services/api/app/api/v1/endpoints/metrics.py@@ -107,9 +107,7 @@ async def get_dashboard_metrics(# MTTR for the dashboard tile: average resolved-alert duration over last 7dmttr_dashboard_q = await db.scalar(- select(- func.avg(func.extract("epoch", Alert.resolved_at - Alert.created_at) / 3600)- ).where(+ select(func.avg(func.extract("epoch", Alert.resolved_at - Alert.created_at) / 3600)).where(and_(Alert.tenant_id == tenant_id,Alert.resolved_at.isnot(None),@@ -292,9 +290,7 @@ async def get_soc_metrics(# ── MTTD ──────────────────────────────────────────────────────────────────# Mean time from alert creation to first analyst view (first_seen_at).mttd_q = await db.scalar(- select(- func.avg(func.extract("epoch", Alert.first_seen_at - Alert.created_at) / 3600)- ).where(+ select(func.avg(func.extract("epoch", Alert.first_seen_at - Alert.created_at) / 3600)).where(and_(Alert.tenant_id == tenant_id,Alert.first_seen_at.isnot(None),@@ -307,9 +303,7 @@ async def get_soc_metrics(# ── MTTR ──────────────────────────────────────────────────────────────────# Mean time from alert creation to resolved_at, for any resolved alert.mttr_q = await db.scalar(- select(- func.avg(func.extract("epoch", Alert.resolved_at - Alert.created_at) / 3600)- ).where(+ select(func.avg(func.extract("epoch", Alert.resolved_at - Alert.created_at) / 3600)).where(and_(Alert.tenant_id == tenant_id,Alert.resolved_at.isnot(None),@@ -323,9 +317,7 @@ async def get_soc_metrics(# For confirmed true-positive alerts only — proxy for "incident contained".# Uses resolved_at since we don't track a separate contained_at.mttc_q = await db.scalar(- select(- func.avg(func.extract("epoch", Alert.resolved_at - Alert.created_at) / 3600)- ).where(+ select(func.avg(func.extract("epoch", Alert.resolved_at - Alert.created_at) / 3600)).where(and_(Alert.tenant_id == tenant_id,Alert.resolved_at.isnot(None),@@ -338,82 +330,90 @@ async def get_soc_metrics(# ── FPR ───────────────────────────────────────────────────────────────────# False-positive dispositions / total resolved-and-dispositioned alerts.- total_resolved = await db.scalar(- select(func.count()).where(- and_(- Alert.tenant_id == tenant_id,- Alert.disposition.isnot(None),- Alert.created_at >= week_start,+ total_resolved = (+ await db.scalar(+ select(func.count()).where(+ and_(+ Alert.tenant_id == tenant_id,+ Alert.disposition.isnot(None),+ Alert.created_at >= week_start,+ )))- ) or 0- fp_count = await db.scalar(- select(func.count()).where(- and_(- Alert.tenant_id == tenant_id,- Alert.disposition == "false_positive",- Alert.created_at >= week_start,+ or 0+ )+ fp_count = (+ await db.scalar(+ select(func.count()).where(+ and_(+ Alert.tenant_id == tenant_id,+ Alert.disposition == "false_positive",+ Alert.created_at >= week_start,+ )))- ) or 0+ or 0+ )fpr = (fp_count / total_resolved) if total_resolved > 0 else 0.0# ── Escalation rate ───────────────────────────────────────────────────────# Fraction of remediation gate decisions that escaped autonomous handling.escalation_decisions = {"escalate", "review"}- total_decisions = await db.scalar(- select(func.count()).where(- and_(- RemediationGateLog.tenant_id == tenant_id,- RemediationGateLog.created_at >= week_start,+ total_decisions = (+ await db.scalar(+ select(func.count()).where(+ and_(+ RemediationGateLog.tenant_id == tenant_id,+ RemediationGateLog.created_at >= week_start,+ )))- ) or 0- escalated_count = await db.scalar(- select(func.count()).where(- and_(- RemediationGateLog.tenant_id == tenant_id,- RemediationGateLog.created_at >= week_start,- RemediationGateLog.decision.in_(escalation_decisions),+ or 0+ )+ escalated_count = (+ await db.scalar(+ select(func.count()).where(+ and_(+ RemediationGateLog.tenant_id == tenant_id,+ RemediationGateLog.created_at >= week_start,+ RemediationGateLog.decision.in_(escalation_decisions),+ )))- ) or 0- escalation_rate = (- escalated_count / total_decisions if total_decisions > 0 else 0.0+ or 0)+ escalation_rate = escalated_count / total_decisions if total_decisions > 0 else 0.0# ── Volume / case counts ──────────────────────────────────────────────────- alert_vol = await db.scalar(- select(func.count()).where(- and_(Alert.tenant_id == tenant_id, Alert.created_at >= week_start)- )- ) or 0- cases_opened = await db.scalar(- select(func.count()).where(- and_(Case.tenant_id == tenant_id, Case.created_at >= week_start)- )- ) or 0- cases_closed = await db.scalar(- select(func.count()).where(- and_(- Case.tenant_id == tenant_id,- Case.status == "resolved",- Case.updated_at >= week_start,+ alert_vol = await db.scalar(select(func.count()).where(and_(Alert.tenant_id == tenant_id, Alert.created_at >= week_start))) or 0+ cases_opened = await db.scalar(select(func.count()).where(and_(Case.tenant_id == tenant_id, Case.created_at >= week_start))) or 0+ cases_closed = (+ await db.scalar(+ select(func.count()).where(+ and_(+ Case.tenant_id == tenant_id,+ Case.status == "resolved",+ Case.updated_at >= week_start,+ )))- ) or 0+ or 0+ )# ── Analyst overrides (7d) ────────────────────────────────────────────────# Any alert with a disposition set in the last 7 days = analyst weighed in.- overrides_q = await db.scalar(- select(func.count()).where(- and_(- Alert.tenant_id == tenant_id,- Alert.disposition.isnot(None),- Alert.updated_at >= week_start,+ overrides_q = (+ await db.scalar(+ select(func.count()).where(+ and_(+ Alert.tenant_id == tenant_id,+ Alert.disposition.isnot(None),+ Alert.updated_at >= week_start,+ )))- ) or 0+ or 0+ )kpis = SOCKpis(mttd_hours=round(mttd_hours, 2),@@ -442,10 +442,7 @@ async def get_soc_metrics()).all()- heatmap = [- AttackHeatmapCell(tactic=r.tactic, technique=r.technique, count=r.cnt)- for r in heatmap_rows- ]+ heatmap = [AttackHeatmapCell(tactic=r.tactic, technique=r.technique, count=r.cnt) for r in heatmap_rows]# ── Confidence calibration curve ──────────────────────────────────────────# 5 buckets across [0, 1]. For each bucket, count alerts with ai_score indiff --git a/services/api/app/api/v1/endpoints/mssp.py b/services/api/app/api/v1/endpoints/mssp.pyindex edaa8882f..ff7db33e7 100644--- a/services/api/app/api/v1/endpoints/mssp.py+++ b/services/api/app/api/v1/endpoints/mssp.py@@ -248,14 +248,14 @@ async def list_metrics(# MSSP Rule Pack management (parent-only)# ----------------------------------------------------------------------------from app.models.detection_rule import DetectionRule-from app.models.mssp import (+from app.models.detection_rule import DetectionRule # noqa: E402+from app.models.mssp import ( # noqa: E402MSSPRuleOverride,MSSPRulePack,MSSPRulePackAssignment,MSSPRulePackRule,)-from app.services.mssp_rule_resolver import resolve_effective_rules, count_effective_rules+from app.services.mssp_rule_resolver import count_effective_rules, resolve_effective_rules # noqa: E402class RulePackCreate(BaseModel):@@ -371,9 +371,7 @@ async def list_rule_packs("""List all rule packs owned by the current parent tenant."""_ensure_mssp_parent(current_user)result = await db.execute(- select(MSSPRulePack)- .where(MSSPRulePack.parent_tenant_id == current_user.tenant_id)- .order_by(MSSPRulePack.created_at.desc())+ select(MSSPRulePack).where(MSSPRulePack.parent_tenant_id == current_user.tenant_id).order_by(MSSPRulePack.created_at.desc()))return list(result.scalars().all())@@ -539,9 +537,9 @@ async def list_overrides(db: AsyncSession = Depends(get_db),current_user: User = Depends(get_current_user),) -> list[MSSPRuleOverride]:- q = select(MSSPRuleOverride).where(MSSPRuleOverride.child_tenant_id.in_(- select(Tenant.id).where(Tenant.parent_tenant_id == current_user.tenant_id)- ))+ q = select(MSSPRuleOverride).where(+ MSSPRuleOverride.child_tenant_id.in_(select(Tenant.id).where(Tenant.parent_tenant_id == current_user.tenant_id))+ )if child_id:q = q.where(MSSPRuleOverride.child_tenant_id == child_id)result = await db.execute(q.order_by(MSSPRuleOverride.created_at.desc()))@@ -674,19 +672,104 @@ class CrossTenantIncident(BaseModel):_MSSP_TENANTS_MOCK = [- ManagedTenantRow(tenant_id="t-acme", name="Acme Corp", health_score=92.4, open_alerts=12, critical_alerts=1, sla_breaches=0, connector_status="healthy", last_event_at="2026-05-07T20:31:00Z"),- ManagedTenantRow(tenant_id="t-globex", name="Globex Industries", health_score=78.1, open_alerts=34, critical_alerts=3, sla_breaches=2, connector_status="degraded", last_event_at="2026-05-07T20:28:00Z"),- ManagedTenantRow(tenant_id="t-initech", name="Initech LLC", health_score=95.7, open_alerts=5, critical_alerts=0, sla_breaches=0, connector_status="healthy", last_event_at="2026-05-07T20:30:00Z"),- ManagedTenantRow(tenant_id="t-wayne", name="Wayne Enterprises", health_score=64.3, open_alerts=58, critical_alerts=7, sla_breaches=4, connector_status="degraded", last_event_at="2026-05-07T20:25:00Z"),- ManagedTenantRow(tenant_id="t-stark", name="Stark Solutions", health_score=88.9, open_alerts=9, critical_alerts=1, sla_breaches=0, connector_status="healthy", last_event_at="2026-05-07T20:29:00Z"),+ ManagedTenantRow(+ tenant_id="t-acme",+ name="Acme Corp",+ health_score=92.4,+ open_alerts=12,+ critical_alerts=1,+ sla_breaches=0,+ connector_status="healthy",+ last_event_at="2026-05-07T20:31:00Z",+ ),+ ManagedTenantRow(+ tenant_id="t-globex",+ name="Globex Industries",+ health_score=78.1,+ open_alerts=34,+ critical_alerts=3,+ sla_breaches=2,+ connector_status="degraded",+ last_event_at="2026-05-07T20:28:00Z",+ ),+ ManagedTenantRow(+ tenant_id="t-initech",+ name="Initech LLC",+ health_score=95.7,+ open_alerts=5,+ critical_alerts=0,+ sla_breaches=0,+ connector_status="healthy",+ last_event_at="2026-05-07T20:30:00Z",+ ),+ ManagedTenantRow(+ tenant_id="t-wayne",+ name="Wayne Enterprises",+ health_score=64.3,+ open_alerts=58,+ critical_alerts=7,+ sla_breaches=4,+ connector_status="degraded",+ last_event_at="2026-05-07T20:25:00Z",+ ),+ ManagedTenantRow(+ tenant_id="t-stark",+ name="Stark Solutions",+ health_score=88.9,+ open_alerts=9,+ critical_alerts=1,+ sla_breaches=0,+ connector_status="healthy",+ last_event_at="2026-05-07T20:29:00Z",+ ),]_MSSP_INCIDENTS_MOCK = [- CrossTenantIncident(incident_id="INC-4201", tenant_name="Wayne Enterprises", title="Ransomware lateral movement detected", severity="high", status="investigating", created_at="2026-05-07T19:45:00Z", assignee="Jordan Lee"),- CrossTenantIncident(incident_id="INC-4198", tenant_name="Globex Industries", title="Suspicious OAuth token abuse in Azure AD", severity="high", status="investigating", created_at="2026-05-07T18:12:00Z", assignee="Morgan Chen"),- CrossTenantIncident(incident_id="INC-4195", tenant_name="Wayne Enterprises", title="Data exfiltration via DNS tunneling", severity="high", status="contained", created_at="2026-05-07T16:30:00Z", assignee="Alex Rivera"),- CrossTenantIncident(incident_id="INC-4192", tenant_name="Acme Corp", title="Brute-force against VPN gateway", severity="medium", status="resolved", created_at="2026-05-07T14:20:00Z", assignee="Taylor Kim"),- CrossTenantIncident(incident_id="INC-4189", tenant_name="Globex Industries", title="Compromised service account in GCP", severity="high", status="investigating", created_at="2026-05-07T12:55:00Z", assignee=None),+ CrossTenantIncident(+ incident_id="INC-4201",+ tenant_name="Wayne Enterprises",+ title="Ransomware lateral movement detected",+ severity="high",+ status="investigating",+ created_at="2026-05-07T19:45:00Z",+ assignee="Jordan Lee",+ ),+ CrossTenantIncident(+ incident_id="INC-4198",+ tenant_name="Globex Industries",+ title="Suspicious OAuth token abuse in Azure AD",+ severity="high",+ status="investigating",+ created_at="2026-05-07T18:12:00Z",+ assignee="Morgan Chen",+ ),+ CrossTenantIncident(+ incident_id="INC-4195",+ tenant_name="Wayne Enterprises",+ title="Data exfiltration via DNS tunneling",+ severity="high",+ status="contained",+ created_at="2026-05-07T16:30:00Z",+ assignee="Alex Rivera",+ ),+ CrossTenantIncident(+ incident_id="INC-4192",+ tenant_name="Acme Corp",+ title="Brute-force against VPN gateway",+ severity="medium",+ status="resolved",+ created_at="2026-05-07T14:20:00Z",+ assignee="Taylor Kim",+ ),+ CrossTenantIncident(+ incident_id="INC-4189",+ tenant_name="Globex Industries",+ title="Compromised service account in GCP",+ severity="high",+ status="investigating",+ created_at="2026-05-07T12:55:00Z",+ assignee=None,+ ),]diff --git a/services/api/app/api/v1/endpoints/nl_detection.py b/services/api/app/api/v1/endpoints/nl_detection.pyindex 7a1eedc73..995b50cf3 100644--- a/services/api/app/api/v1/endpoints/nl_detection.py+++ b/services/api/app/api/v1/endpoints/nl_detection.py@@ -16,11 +16,10 @@ from __future__ import annotationsimport osfrom typing import Literal+import structlogfrom fastapi import APIRouter, HTTPException, statusfrom pydantic import BaseModel, Field-import structlog-from app.core.airgap import AirgapViolation, enforce_airgap_for_urllogger = structlog.get_logger()diff --git a/services/api/app/api/v1/endpoints/nl_query.py b/services/api/app/api/v1/endpoints/nl_query.pyindex 2cb652565..b449daad7 100644--- a/services/api/app/api/v1/endpoints/nl_query.py+++ b/services/api/app/api/v1/endpoints/nl_query.py@@ -48,13 +48,11 @@ def _validate_es_url(url: str) -> str:if candidate.scheme not in ("http", "https"):raise ValueError(f"Unsupported URL scheme: {candidate.scheme!r}")if candidate.netloc != allowed.netloc:- raise ValueError(- f"ES URL host {candidate.netloc!r} is not the configured host "- f"{allowed.netloc!r}"- )+ raise ValueError(f"ES URL host {candidate.netloc!r} is not the configured host {allowed.netloc!r}")# Reconstruct from validated components only — no user-supplied path/query.return f"{candidate.scheme}://{candidate.netloc}"+# ────────────────────────────────────────────────────────────────────────────# Pydantic schemas# ────────────────────────────────────────────────────────────────────────────@@ -139,12 +137,8 @@ _SYS_PROMPT = textwrap.dedent().strip()-async def _translate(- question: str, index_pattern: str, time_range_hours: int-) -> dict[str, str]:- api_key = getattr(settings, "OPENAI_API_KEY", None) or getattr(- settings, "LLM_API_KEY", None- )+async def _translate(question: str, index_pattern: str, time_range_hours: int) -> dict[str, str]:+ api_key = getattr(settings, "OPENAI_API_KEY", None) or getattr(settings, "LLM_API_KEY", None)if not api_key:return _template_fallback(question, index_pattern, time_range_hours)@@ -180,24 +174,11 @@ async def _translate(return _template_fallback(question, index_pattern, time_range_hours)-def _template_fallback(- question: str, index_pattern: str, time_range_hours: int-) -> dict[str, str]:+def _template_fallback(question: str, index_pattern: str, time_range_hours: int) -> dict[str, str]:return {- "esql": (- f"FROM {index_pattern}\n"- f"| WHERE @timestamp > NOW() - {time_range_hours}h\n"- f"// TODO: translate → {question}\n"- "| LIMIT 500"- ),- "spl": (- f"index=* earliest=-{time_range_hours}h\n"- f"// TODO: translate → {question}"- ),- "kql": (- f"// TODO: translate → {question}\n"- f"| where TimeGenerated > ago({time_range_hours}h)"- ),+ "esql": (f"FROM {index_pattern}\n| WHERE @timestamp > NOW() - {time_range_hours}h\n// TODO: translate → {question}\n| LIMIT 500"),+ "spl": (f"index=* earliest=-{time_range_hours}h\n// TODO: translate → {question}"),+ "kql": (f"// TODO: translate → {question}\n| where TimeGenerated > ago({time_range_hours}h)"),"explanation": f"Template placeholder for: {question}",}@@ -207,9 +188,7 @@ def _template_fallback(# ────────────────────────────────────────────────────────────────────────────-async def _execute_esql(- esql: str, es_url: str, es_api_key: str, max_rows: int-) -> QueryResult:+async def _execute_esql(esql: str, es_url: str, es_api_key: str, max_rows: int) -> QueryResult:"""Run an ES|QL query against Elasticsearch and return structured results."""# Validate URL against configured host before making any outbound request.try:@@ -258,9 +237,7 @@ async def translate_query(body: NLQueryTranslateRequest,user: AuthUser,) -> NLQueryTranslateResponse:- translated = await _translate(- body.question, body.index_pattern, body.time_range_hours- )+ translated = await _translate(body.question, body.index_pattern, body.time_range_hours)return NLQueryTranslateResponse(request_id=uuid.uuid4(),question=body.question,@@ -282,15 +259,11 @@ async def execute_query(body: NLQueryExecuteRequest,user: AuthUser,) -> NLQueryExecuteResponse:- translated = await _translate(- body.question, body.index_pattern, body.time_range_hours- )+ translated = await _translate(body.question, body.index_pattern, body.time_range_hours)# Always read the ES URL from server-side settings — never from user-supplied# body fields — to prevent partial-SSRF attacks (CodeQL py/partial-ssrf).- es_url = getattr(settings, "ES_URL", None) or getattr(- settings, "ELASTICSEARCH_URL", None- )+ es_url = getattr(settings, "ES_URL", None) or getattr(settings, "ELASTICSEARCH_URL", None)es_api_key = body.es_api_key or getattr(settings, "ES_API_KEY", None)base = NLQueryExecuteResponse(@@ -304,10 +277,7 @@ async def execute_query()if not es_url or not es_api_key:- base.execution_error = (- "ES_URL or ES_API_KEY not configured. "- "Set them in environment variables or pass in the request body."- )+ base.execution_error = "ES_URL or ES_API_KEY not configured. Set them in environment variables or pass in the request body."return basetry:diff --git a/services/api/app/api/v1/endpoints/oauth.py b/services/api/app/api/v1/endpoints/oauth.pyindex 82c587b2d..576c57546 100644--- a/services/api/app/api/v1/endpoints/oauth.py+++ b/services/api/app/api/v1/endpoints/oauth.py@@ -309,12 +309,7 @@ def _validate_return_to(return_to: str | None) -> str:parsed = urlsplit(return_to)# Path-only (relative) navigation inside the console.- if (- not parsed.scheme- and not parsed.netloc- and parsed.path.startswith("/")- and not parsed.path.startswith("//")- ):+ if not parsed.scheme and not parsed.netloc and parsed.path.startswith("/") and not parsed.path.startswith("//"):# ``safe`` keeps URL-meaningful chars; everything else gets# percent-encoded, which both hardens the value and gives# CodeQL a sanitizer it tracks.@@ -333,13 +328,7 @@ def _validate_return_to(return_to: str | None) -> str:if (parsed.scheme == base_parsed.schemeand parsed.netloc == base_parsed.netloc- and (- parsed.path == ""- or (- parsed.path.startswith("/")- and not parsed.path.startswith("//")- )- )+ and (parsed.path == "" or (parsed.path.startswith("/") and not parsed.path.startswith("//")))):safe_path = quote(parsed.path or "/", safe="/-._~")safe_query = quote(parsed.query, safe="=&-._~")@@ -441,10 +430,7 @@ def _resolve_token_url(if not url:raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST,- detail=(- "Connector schema does not advertise a token_url and "- "tenant did not override it."- ),+ detail=("Connector schema does not advertise a token_url and tenant did not override it."),)return _validated_provider_url(url, kind="token")@@ -812,9 +798,7 @@ async def oauth_callback(detail="Missing OAuth state parameter",)- state_res = await db.execute(- select(OAuthState).where(OAuthState.state == state)- )+ state_res = await db.execute(select(OAuthState).where(OAuthState.state == state))state_row: OAuthState | None = state_res.scalar_one_or_none()if state_row is None:raise HTTPException(@@ -1011,9 +995,7 @@ async def oauth_callback(# (Workstream 5) doesn't have to track when we received the token.expires_in = token_payload.get("expires_in")if isinstance(expires_in, (int, float)) and expires_in > 0:- auth_payload["expires_at"] = (- datetime.now(UTC) + timedelta(seconds=int(expires_in))- ).isoformat()+ auth_payload["expires_at"] = (datetime.now(UTC) + timedelta(seconds=int(expires_in))).isoformat()try:encrypted_auth = get_vault().encrypt_dict(auth_payload)@@ -1064,8 +1046,8 @@ async def oauth_callback(Connector.tenant_id == state_row.tenant_id,))- connector = existing_res.scalar_one_or_none()- if connector is None:+ existing_connector = existing_res.scalar_one_or_none()+ if existing_connector is None:await db.execute(delete(OAuthState).where(OAuthState.state == state))await db.commit()return _callback_error_redirect(@@ -1073,6 +1055,7 @@ async def oauth_callback("connector_disappeared","Connector instance disappeared mid-flow.",)+ connector = existing_connectorconnector.auth_config = encrypted_authmerged_config = dict(connector.connector_config or {})merged_config.update(connector_config)diff --git a/services/api/app/api/v1/endpoints/phishing.py b/services/api/app/api/v1/endpoints/phishing.pyindex 29cd3fddd..251e401e7 100644--- a/services/api/app/api/v1/endpoints/phishing.py+++ b/services/api/app/api/v1/endpoints/phishing.py@@ -143,7 +143,13 @@ def _heuristic_triage(content: str | None, urls: list[str]) -> TriageResult:indicators.append({"kind": "url", "value": url, "note": "URL shortener"})score = min(score, 1.0)verdict: Verdict = "phishing" if score > 0.4 else "benign" if score < 0.1 else "unknown"- return TriageResult(verdict=verdict, confidence=round(score, 2), indicators=indicators, mitre_technique=None, summary="Heuristic triage — LLM not configured.")+ return TriageResult(+ verdict=verdict,+ confidence=round(score, 2),+ indicators=indicators,+ mitre_technique=None,+ summary="Heuristic triage — LLM not configured.",+ )def _row_to_submission(row: Any) -> SubmissionResponse:@@ -168,7 +174,9 @@ def _row_to_submission(row: Any) -> SubmissionResponse:# ────────────────────────────────────────────────────────────────────────────[email protected]("/submit", response_model=SubmissionResponse, status_code=status.HTTP_201_CREATED, summary="Submit artifact for phishing triage")+ "/submit", response_model=SubmissionResponse, status_code=status.HTTP_201_CREATED, summary="Submit artifact for phishing triage"+)async def submit(body: SubmitRequest, db: DBSession, user: AuthUser) -> SubmissionResponse:try:result = await _triage(body.artifact_kind, body.raw_content or "", body.urls)@@ -227,8 +235,11 @@ async def list_submissions(wheres = ["1=1"]params: dict[str, Any] = {"limit": limit, "offset": offset}if verdict:- wheres.append("verdict = :verdict"); params["verdict"] = verdict- q = text(f"SELECT * FROM aisoc_phishing_submissions WHERE {' AND '.join(wheres)} ORDER BY submitted_at DESC LIMIT :limit OFFSET :offset").bindparams(**params)+ wheres.append("verdict = :verdict")+ params["verdict"] = verdict+ q = text(+ f"SELECT * FROM aisoc_phishing_submissions WHERE {' AND '.join(wheres)} ORDER BY submitted_at DESC LIMIT :limit OFFSET :offset"+ ).bindparams(**params)try:rows = (await db.execute(q)).fetchall()return [_row_to_submission(r) for r in rows]diff --git a/services/api/app/api/v1/endpoints/playbooks.py b/services/api/app/api/v1/endpoints/playbooks.pyindex d9400206f..c89e8a4fa 100644--- a/services/api/app/api/v1/endpoints/playbooks.py+++ b/services/api/app/api/v1/endpoints/playbooks.py@@ -15,9 +15,7 @@ from typing import Anyimport httpxfrom fastapi import APIRouter, HTTPException, Request, status-_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL") or os.getenv(- "AGENTS_API_URL", "http://agents:8084"-)+_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL") or os.getenv("AGENTS_API_URL", "http://agents:8084")router = APIRouter(prefix="/playbooks", tags=["playbooks"])diff --git a/services/api/app/api/v1/endpoints/reports.py b/services/api/app/api/v1/endpoints/reports.pyindex d6f72d8d6..130483942 100644--- a/services/api/app/api/v1/endpoints/reports.py+++ b/services/api/app/api/v1/endpoints/reports.py@@ -1,4 +1,7 @@-"""Auto-generated board / executive report endpoints."""+"""Auto-generated board / executive report endpoints.++Author: Beenu <[email protected]>+"""from __future__ import annotations@@ -7,7 +10,7 @@ from datetime import datetimefrom typing import Anyfrom fastapi import APIRouter, Depends, HTTPException, Query, status-from fastapi.responses import HTMLResponse+from fastapi.responses import HTMLResponse, Responsefrom pydantic import BaseModel, Fieldfrom sqlalchemy import selectfrom sqlalchemy.ext.asyncio import AsyncSession@@ -17,6 +20,7 @@ from app.db.database import get_dbfrom app.models.report import ReportArtefact, ReportTemplatefrom app.models.tenant import Userfrom app.services.digest_html import render_digest_html+from app.services.digest_pdf import WeasyPrintUnavailableError, render_digest_pdffrom app.services.executive_digest import ExecutiveDigest, build_weekly_digestrouter = APIRouter(prefix="/reports", tags=["reports"])@@ -204,25 +208,28 @@ async def get_artefact(@router.get("/digest/weekly",- summary="Executive weekly digest (JSON or print-ready HTML)",- # The endpoint returns either an ExecutiveDigest (JSON) or an HTMLResponse- # depending on the ?format= query param. FastAPI cannot synthesise a- # response_model from that union, so we opt out and let each branch- # serialise itself (Pydantic for JSON, HTMLResponse for HTML).+ summary="Executive weekly digest (JSON, print-ready HTML, or PDF)",+ # The endpoint returns ExecutiveDigest (JSON), HTMLResponse, or a raw PDF+ # Response depending on the ?format= query param. FastAPI cannot synthesise+ # a response_model from that union so we opt out and let each branch+ # serialise itself.response_model=None,)async def weekly_digest(- fmt: str = Query("json", alias="format", pattern="^(json|html)$"),+ fmt: str = Query("json", alias="format", pattern="^(json|html|pdf)$"),period_start: datetime | None = Query(None, description="ISO timestamp; defaults to now-7d"),period_end: datetime | None = Query(None, description="ISO timestamp; defaults to now"),db: AsyncSession = Depends(get_db),current_user: User = Depends(get_current_user),-) -> ExecutiveDigest | HTMLResponse:+) -> ExecutiveDigest | HTMLResponse | Response:"""Build a deterministic weekly digest for the caller's tenant.- The default window is the most recent seven days. Pass ``format=html`` to- receive a self-contained, print-ready document (use the browser's- "Save as PDF" to export).+ Supported formats (``?format=``):++ * ``json`` — Pydantic model serialised as JSON *(default)*+ * ``html`` — Self-contained print-ready HTML page+ * ``pdf`` — Server-side PDF generated via WeasyPrint (requires the+ WeasyPrint native library stack; returns 503 when unavailable)"""if period_start and period_end and period_start >= period_end:raise HTTPException(@@ -239,4 +246,20 @@ async def weekly_digest(if fmt == "html":return HTMLResponse(content=render_digest_html(digest))++ if fmt == "pdf":+ try:+ pdf_bytes = render_digest_pdf(digest)+ except WeasyPrintUnavailableError as exc:+ raise HTTPException(+ status_code=status.HTTP_503_SERVICE_UNAVAILABLE,+ detail=str(exc),+ ) from exc+ filename = f"aisoc-digest-{digest.period.start.date()}.pdf"+ return Response(+ content=pdf_bytes,+ media_type="application/pdf",+ headers={"Content-Disposition": f'attachment; filename="{filename}"'},+ )+return digestdiff --git a/services/api/app/api/v1/endpoints/saved_views.py b/services/api/app/api/v1/endpoints/saved_views.pyindex 9f33401b9..7fd32f7fc 100644--- a/services/api/app/api/v1/endpoints/saved_views.py+++ b/services/api/app/api/v1/endpoints/saved_views.py@@ -69,10 +69,7 @@ def _validate_view_type(view_type: str) -> str:if view_type not in _VALID_VIEW_TYPES:raise HTTPException(status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,- detail=(- f"view_type must be one of: "- f"{', '.join(sorted(_VALID_VIEW_TYPES))}"- ),+ detail=(f"view_type must be one of: {', '.join(sorted(_VALID_VIEW_TYPES))}"),)return view_type@@ -175,10 +172,7 @@ async def list_saved_views(db: TenantDBSession,view_type: str = Query(...,- description=(- "Which list page to return presets for. One of: "- f"{', '.join(sorted(_VALID_VIEW_TYPES))}."- ),+ description=(f"Which list page to return presets for. One of: {', '.join(sorted(_VALID_VIEW_TYPES))}."),),) -> list[SavedViewModel]:"""Return the caller's saved views for one list page.@@ -190,16 +184,20 @@ async def list_saved_views(_validate_view_type(view_type)rows = (- await db.execute(- select(SavedView)- .where(- SavedView.tenant_id == user.tenant_id,- SavedView.user_id == user.user_id,- SavedView.view_type == view_type,+ (+ await db.execute(+ select(SavedView)+ .where(+ SavedView.tenant_id == user.tenant_id,+ SavedView.user_id == user.user_id,+ SavedView.view_type == view_type,+ )+ .order_by(SavedView.is_default.desc(), SavedView.updated_at.desc()))- .order_by(SavedView.is_default.desc(), SavedView.updated_at.desc()))- ).scalars().all()+ .scalars()+ .all()+ )return [SavedViewModel.from_orm(r) for r in rows]@@ -266,10 +264,7 @@ async def create_saved_view(# above, so a hit here is almost certainly the name.raise HTTPException(status_code=status.HTTP_409_CONFLICT,- detail=(- f"A saved view named '{name}' already exists for "- f"this user and view type"- ),+ detail=(f"A saved view named '{name}' already exists for this user and view type"),) from excawait db.refresh(row)@@ -306,15 +301,11 @@ async def update_saved_view(return SavedViewModel.from_orm(row)if "filters" in fields_set:- _validate_payload_size(- payload.filters, field="filters", limit=_MAX_FILTERS_BYTES- )+ _validate_payload_size(payload.filters, field="filters", limit=_MAX_FILTERS_BYTES)row.filters = dict(payload.filters or {})if "columns" in fields_set:- _validate_payload_size(- payload.columns, field="columns", limit=_MAX_COLUMNS_BYTES- )+ _validate_payload_size(payload.columns, field="columns", limit=_MAX_COLUMNS_BYTES)row.columns = payload.columns # may be explicit None — clears it.if "name" in fields_set and payload.name is not None:@@ -346,10 +337,7 @@ async def update_saved_view(await db.rollback()raise HTTPException(status_code=status.HTTP_409_CONFLICT,- detail=(- "A saved view with this name already exists for "- "this user and view type"- ),+ detail=("A saved view with this name already exists for this user and view type"),) from excawait db.refresh(row)@@ -459,8 +447,4 @@ async def _demote_existing_default(if except_id is not None:conditions.append(SavedView.id != except_id)- await db.execute(- update(SavedView)- .where(and_(*conditions))- .values(is_default=False, updated_at=datetime.now(UTC))- )+ await db.execute(update(SavedView).where(and_(*conditions)).values(is_default=False, updated_at=datetime.now(UTC)))diff --git a/services/api/app/api/v1/endpoints/translation.py b/services/api/app/api/v1/endpoints/translation.pyindex a84ee3404..588f16a41 100644--- a/services/api/app/api/v1/endpoints/translation.py+++ b/services/api/app/api/v1/endpoints/translation.py@@ -213,7 +213,7 @@ def _fallback_templates(req: TranslateRequest) -> dict[str, Any]:elif fmt == "esql":rule = f"FROM logs-*\n| WHERE {rule}"elif fmt == "yara_l2":- rule = f"rule translated_rule {{\n meta:\n author = \"AiSOC\"\n condition:\n {rule}\n}}"+ rule = f'rule translated_rule {{\n meta:\n author = "AiSOC"\n condition:\n {rule}\n}}'elif fmt == "udm":rule = f"// Chronicle UDM Search\n{rule}"diff --git a/services/api/app/api/v1/router.py b/services/api/app/api/v1/router.pyindex cf695ec82..070685ef5 100644--- a/services/api/app/api/v1/router.py+++ b/services/api/app/api/v1/router.py@@ -23,27 +23,27 @@ from app.api.v1.endpoints import (detection_proposals,detection_rules,easm,- feedback,federated,+ feedback,fusion,+ graph,hunts,+ identity_graph,identity_timeline,inbox,inbox_itsm,+ insider_threat,+ investigations,knowledge_base,lake,llm_credentials,llm_status,- nl_detection,- nl_query,- oauth,- graph,- identity_graph,- insider_threat,- investigations,marketplace,metrics,mssp,+ nl_detection,+ nl_query,+ oauth,oncall,passkeys,phishing,diff --git a/services/api/app/auth/saml.py b/services/api/app/auth/saml.pyindex 6f3ed22f6..4e08ee660 100644--- a/services/api/app/auth/saml.py+++ b/services/api/app/auth/saml.py@@ -55,6 +55,7 @@ def _safe_redirect(url: str) -> str:return safe_pathreturn "/"+router = APIRouter(prefix="/auth/saml", tags=["auth-saml"])# ─── JWT helpers ──────────────────────────────────────────────────────────────diff --git a/services/api/app/core/config.py b/services/api/app/core/config.pyindex 0b1b2bbd3..f3882a7a0 100644--- a/services/api/app/core/config.py+++ b/services/api/app/core/config.py@@ -132,13 +132,33 @@ class Settings(BaseSettings):# loop; a hung provider should not stall the cadence.OAUTH_REFRESH_HTTP_TIMEOUT_SECONDS: float = 15.0+ # ------------------------------------------------------------------+ # WS-G2: Weekly Executive Digest auto-generation worker.+ # Author: Beenu <[email protected]>+ #+ # The worker runs as a single ``asyncio.Task`` inside the API process+ # (``lifespan`` hook in main.py). Every Monday at 00:xx UTC it generates+ # a PDF (or HTML fallback) executive digest for every active tenant and+ # persists a ``ReportArtefact`` row.+ #+ # ``WEEKLY_DIGEST_WORKER_ENABLED`` – Set false to disable (e.g. in+ # unit-test environments or when+ # digests are triggered externally).+ # ``WEEKLY_DIGEST_POLL_INTERVAL_SECONDS`` – How often (seconds) the loop+ # checks whether it is Monday 00:xx.+ # Defaults to 3600 (1 hour). Must+ # be ≥ 60 to avoid a busy loop.+ # ------------------------------------------------------------------+ WEEKLY_DIGEST_WORKER_ENABLED: bool = True+ WEEKLY_DIGEST_POLL_INTERVAL_SECONDS: int = 3600+# Database- DATABASE_URL: PostgresDsn = "postgresql+asyncpg://aisoc:aisoc@localhost:5432/aisoc"+ DATABASE_URL: PostgresDsn = "postgresql+asyncpg://aisoc:aisoc@localhost:5432/aisoc" # type: ignore[assignment]DATABASE_POOL_SIZE: int = 20DATABASE_MAX_OVERFLOW: int = 10# Redis- REDIS_URL: RedisDsn = "redis://localhost:6379/0"+ REDIS_URL: RedisDsn = "redis://localhost:6379/0" # type: ignore[assignment]REDIS_POOL_SIZE: int = 20# ClickHouse@@ -231,6 +251,21 @@ class Settings(BaseSettings):return [origin.strip() for origin in v.split(",") if origin.strip()]return v+ # ------------------------------------------------------------------+ # WS-B4: Detection-as-Code git PR path+ # Author: Beenu - [email protected]+ #+ # When AISOC_GITHUB_TOKEN is set the promote-proposal endpoint opens a+ # Pull Request in AISOC_GITHUB_REPO, committing the Sigma/YARA rule file+ # under AISOC_GITHUB_DETECTIONS_PATH and stores the PR URL on the proposal+ # record. All three settings must be non-empty for PR creation to be+ # attempted; any missing setting silently skips PR creation (github_pr_url+ # remains NULL).+ # ------------------------------------------------------------------+ AISOC_GITHUB_TOKEN: str = ""+ AISOC_GITHUB_REPO: str = "" # format: "org/repo"+ AISOC_GITHUB_DETECTIONS_PATH: str = "detections" # path inside repo root+# Demo mode (hosted at tryaisoc.com)# When AISOC_DEMO_MODE=true the API rejects mutating requests outside the# demo tenant with 403, surfaces a banner, and pre-seeds canonical data.@@ -389,9 +424,10 @@ def warn_if_insecure_defaults(s: Settings | None = None) -> list[str]:if s.AISOC_AIRGAPPED:# Lazy import to avoid a circular reference (airgap.py imports settings).try:- from app.core.airgap import is_host_allowed_for_airgapimport os as _os+ from app.core.airgap import is_host_allowed_for_airgap+llm_base = _os.getenv("LLM_BASE_URL") or _os.getenv("OPENAI_BASE_URL") or ""if llm_base:from urllib.parse import urlparse as _urlparsediff --git a/services/api/app/db/clickhouse.py b/services/api/app/db/clickhouse.pyindex edc88ae5f..95a2a028a 100644--- a/services/api/app/db/clickhouse.py+++ b/services/api/app/db/clickhouse.py@@ -167,16 +167,12 @@ async def get_clickhouse_client() -> Any:from clickhouse_driver import Client # noqa: PLC0415except ImportError as exc: # pragma: no cover — env-specificraise LakeQueryNotConfiguredError(- "clickhouse-driver is not installed; install it via "- "`pip install clickhouse-driver` to enable the lake API"+ "clickhouse-driver is not installed; install it via `pip install clickhouse-driver` to enable the lake API") from exchost = (settings.CLICKHOUSE_HOST or "").strip()if not host:- raise LakeQueryNotConfiguredError(- "CLICKHOUSE_HOST is not configured; set it in the API "- "environment to enable the lake API"- )+ raise LakeQueryNotConfiguredError("CLICKHOUSE_HOST is not configured; set it in the API environment to enable the lake API")# ``settings_dict`` is forwarded to ClickHouse on every query;# we override per-call too, but having sane process-wide@@ -196,9 +192,7 @@ async def get_clickhouse_client() -> Any:settings=DEFAULT_QUERY_SETTINGS,)except Exception as exc: # pragma: no cover — driver-specific- raise LakeQueryNotConfiguredError(- f"failed to construct ClickHouse client: {exc}"- ) from exc+ raise LakeQueryNotConfiguredError(f"failed to construct ClickHouse client: {exc}") from exclogger.info("clickhouse client initialised",@@ -312,13 +306,9 @@ async def execute_lake_query()try:- rows, column_meta = await asyncio.wait_for(- asyncio.to_thread(_run), timeout=asyncio_cap- )+ rows, column_meta = await asyncio.wait_for(asyncio.to_thread(_run), timeout=asyncio_cap)except TimeoutError as exc:- raise LakeQueryTimeoutError(- f"lake query exceeded {effective_cap:.0f}s wall-clock timeout"- ) from exc+ raise LakeQueryTimeoutError(f"lake query exceeded {effective_cap:.0f}s wall-clock timeout") from excexcept LakeQueryError:raiseexcept Exception as exc:@@ -407,12 +397,7 @@ async def fetch_lake_schema(where_clauses.append(f"(database = %(db{idx})s AND table = %(tbl{idx})s)")where = " OR ".join(where_clauses)- sql = (- "SELECT database, table, name, type, comment "- "FROM system.columns "- f"WHERE {where} "- "ORDER BY database, table, position"- )+ sql = f"SELECT database, table, name, type, comment FROM system.columns WHERE {where} ORDER BY database, table, position"client = await get_clickhouse_client()diff --git a/services/api/app/db/database.py b/services/api/app/db/database.pyindex c704e6144..87889059b 100644--- a/services/api/app/db/database.py+++ b/services/api/app/db/database.py@@ -9,7 +9,6 @@ from sqlalchemy.orm import DeclarativeBasefrom app.core.config import settings-# libpq sslmode values -> what asyncpg's `ssl` kwarg expects.# asyncpg accepts: "disable" | "allow" | "prefer" | "require" | "verify-ca" | "verify-full"# but NOT under the libpq query-string name `sslmode=`. We pop it from the URL@@ -63,9 +62,7 @@ def _normalize_async_pg_url(url: str) -> tuple[str, dict[str, Any]]:continueremaining.append((key, value))- new_url = urlunsplit(- (parts.scheme, parts.netloc, parts.path, urlencode(remaining), parts.fragment)- )+ new_url = urlunsplit((parts.scheme, parts.netloc, parts.path, urlencode(remaining), parts.fragment))return new_url, connect_argsdiff --git a/services/api/app/db/neo4j.py b/services/api/app/db/neo4j.pyindex 9069a950b..23ffbe7d4 100644--- a/services/api/app/db/neo4j.py+++ b/services/api/app/db/neo4j.py@@ -37,7 +37,7 @@ async def init_neo4j() -> None:for attempt in range(5):try:await _driver.verify_connectivity()- logger.info("Neo4j connection established", uri=settings.NEO4J_URI)+ logger.info("Neo4j connection established uri=%s", settings.NEO4J_URI)# Create schema constraints and indexesawait _create_schema()@@ -45,7 +45,7 @@ async def init_neo4j() -> None:except ServiceUnavailable:if attempt < 4:wait = 2**attempt- logger.warning("Neo4j not ready, retrying", attempt=attempt + 1, wait=wait)+ logger.warning("Neo4j not ready, retrying attempt=%s wait=%s", attempt + 1, wait)await asyncio.sleep(wait)else:logger.error("Neo4j connection failed after retries")@@ -104,6 +104,6 @@ async def _create_schema() -> None:try:await session.run(cypher)except Exception as exc:- logger.debug("Schema statement skipped", cypher=cypher[:60], error=str(exc))+ logger.debug("Schema statement skipped cypher=%s error=%s", cypher[:60], exc)logger.info("Neo4j schema constraints and indexes ensured")diff --git a/services/api/app/graphql/query.py b/services/api/app/graphql/query.pyindex 61e87b93e..d2da1cd8c 100644--- a/services/api/app/graphql/query.py+++ b/services/api/app/graphql/query.py@@ -41,9 +41,7 @@ from app.models.case import Casefrom app.models.connector import Connectorfrom app.models.detection_rule import DetectionRule-_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL") or os.getenv(- "AGENTS_API_URL", "http://agents:8084"-)+_AGENTS_URL = os.getenv("AGENTS_SERVICE_URL") or os.getenv("AGENTS_API_URL", "http://agents:8084")# ─── helpers ──────────────────────────────────────────────────────────────────diff --git a/services/api/app/main.py b/services/api/app/main.pyindex cfe32173c..feddd90c7 100644--- a/services/api/app/main.py+++ b/services/api/app/main.py@@ -29,6 +29,7 @@ from app.middleware.demo_mode import DemoModeMiddlewarefrom app.models import Basefrom app.services.plugin_manager import get_plugin_managerfrom app.workers.oauth_refresh import run_forever as run_oauth_refresh+from app.workers.weekly_digest_task import run_forever as run_weekly_digest_DEV_ENVIRONMENTS = {"development", "dev", "local", "demo", "test"}_metrics_bearer = HTTPBearer(auto_error=False)@@ -105,13 +106,23 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:oauth_refresh_task: asyncio.Task | None = Noneif settings.OAUTH_REFRESH_WORKER_ENABLED:try:- oauth_refresh_task = asyncio.create_task(- run_oauth_refresh(), name="oauth_refresh_worker"- )+ oauth_refresh_task = asyncio.create_task(run_oauth_refresh(), name="oauth_refresh_worker")logger.info("oauth_refresh worker started")except Exception as exc:logger.warning("oauth_refresh worker failed to start", error=str(exc))+ # WS-G2: Weekly executive digest auto-generation worker. Generates a+ # PDF (or HTML fallback) digest for every active tenant every Monday at+ # 00:xx UTC and persists a ReportArtefact row.+ # Author: Beenu <[email protected]>+ weekly_digest_task: asyncio.Task | None = None+ if settings.WEEKLY_DIGEST_WORKER_ENABLED:+ try:+ weekly_digest_task = asyncio.create_task(run_weekly_digest(), name="weekly_digest_worker")+ logger.info("weekly_digest worker started")+ except Exception as exc:+ logger.warning("weekly_digest worker failed to start", error=str(exc))+yieldlogger.info("AiSOC API shutting down")@@ -123,6 +134,15 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:passexcept Exception as exc:logger.warning("oauth_refresh worker shutdown error", error=str(exc))++ if weekly_digest_task is not None and not weekly_digest_task.done():+ weekly_digest_task.cancel()+ try:+ await weekly_digest_task+ except asyncio.CancelledError:+ pass+ except Exception as exc:+ logger.warning("weekly_digest worker shutdown error", error=str(exc))await engine.dispose()await close_neo4j()# Close the ClickHouse warm-tier client. We don't pre-init it ondiff --git a/services/api/app/models/__init__.py b/services/api/app/models/__init__.pyindex bc6750b18..52a6eb458 100644--- a/services/api/app/models/__init__.py+++ b/services/api/app/models/__init__.py@@ -7,6 +7,7 @@ from app.models.case import Case, CaseTask, CaseTimelinefrom app.models.connector import Connectorfrom app.models.detection_proposal import DetectionEvalBaseline, DetectionRuleProposalfrom app.models.detection_rule import DetectionRule+from app.models.easm import ExternalAsset, ExternalAssetDriftfrom app.models.identity_graph import AlertIdentityLink, IdentityEdge, IdentityNodefrom app.models.inbox import TenantInboxTokenfrom app.models.insider_threat import InsiderIndicator, InsiderPeerGroup, UserRiskProfile@@ -17,7 +18,6 @@ from app.models.investigation import (InvestigationRun,)from app.models.llm_credential import TenantLlmCredential-from app.models.oauth import OAuthAppCredential, OAuthStatefrom app.models.mssp import (MSSPDelegation,MSSPRuleOverride,@@ -27,6 +27,7 @@ from app.models.mssp import (MSSPTenantMetrics,MSSPTenantNote,)+from app.models.oauth import OAuthAppCredential, OAuthStatefrom app.models.posture import PostureDriftEvent, PostureFinding, PostureScanRunfrom app.models.remediation import RemediationGateLog, RemediationMaturity, RemediationWhitelistfrom app.models.report import ReportArtefact, ReportTemplate@@ -38,7 +39,6 @@ from app.models.responder import ()from app.models.saved_view import SavedViewfrom app.models.tenant import ApiKey, Tenant, User-from app.models.easm import ExternalAsset, ExternalAssetDriftfrom app.models.threat_intel import ThreatActor, ThreatIntelFeed, ThreatIntelIOC__all__ = [diff --git a/services/api/app/models/connector.py b/services/api/app/models/connector.pyindex 91b71d181..4347c3ffb 100644--- a/services/api/app/models/connector.py+++ b/services/api/app/models/connector.py@@ -54,9 +54,7 @@ class Connector(Base):# ``oauth_last_refresh_at`` is the timestamp of the most recent# successful refresh, so the UI can display "rotated 3 min ago".oauth_refresh_failures: Mapped[int] = mapped_column(default=0, nullable=False)- oauth_last_refresh_at: Mapped[datetime | None] = mapped_column(- DateTime(timezone=True), nullable=True- )+ oauth_last_refresh_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)# Workstream 5 (self-healing) — backfill-on-outage state.# ``last_outage_at`` is set when the connector first flips to# ``unhealthy`` and is cleared on recovery. The backfill worker@@ -65,12 +63,8 @@ class Connector(Base):# ``last_backfill_at`` is the wall clock of the most recent backfill# run — the worker uses it to avoid re-firing during a recovery# flap and the UI surfaces it as "backfilled to <ts>".- last_outage_at: Mapped[datetime | None] = mapped_column(- DateTime(timezone=True), nullable=True- )- last_backfill_at: Mapped[datetime | None] = mapped_column(- DateTime(timezone=True), nullable=True- )+ last_outage_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)+ last_backfill_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)# Workstream 4: per-instance capability downscoping. ``NULL`` means# "no downscoping — agent may use every capability the connector class# declares". A non-NULL JSON array is the canonical allow-list (e.g.@@ -86,4 +80,4 @@ class Connector(Base):onupdate=lambda: datetime.now(UTC),)- tenant: Mapped["Tenant"] = relationship("Tenant", back_populates="connectors")+ tenant: Mapped["Tenant"] = relationship("Tenant", back_populates="connectors") # type: ignore[name-defined]diff --git a/services/api/app/models/detection_proposal.py b/services/api/app/models/detection_proposal.pyindex abcbcfcaa..0f87dde54 100644--- a/services/api/app/models/detection_proposal.py+++ b/services/api/app/models/detection_proposal.py@@ -44,6 +44,10 @@ class DetectionRuleProposal(Base):decision_comment: Mapped[str | None] = mapped_column(Text, nullable=True)decided_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)+ # WS-B4: git PR path — URL of the GitHub Pull Request created on promotion.+ # NULL when AISOC_GITHUB_TOKEN is not configured or the deploy doesn't use GitHub.+ github_pr_url: Mapped[str | None] = mapped_column(Text, nullable=True)+created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),diff --git a/services/api/app/models/easm.py b/services/api/app/models/easm.pyindex 9d493c700..d8b5b140b 100644--- a/services/api/app/models/easm.py+++ b/services/api/app/models/easm.py@@ -1,18 +1,22 @@"""External Attack Surface Management (EASM) models (Tier 3.6)."""+from datetime import datetimefrom enum import Enumfrom uuid import UUID, uuid4from sqlalchemy import (DateTime,- Enum as SQLAEnum,ForeignKey,Index,String,)-from sqlalchemy.dialects.postgresql import JSONB, UUID as PGUUID+from sqlalchemy import (+ Enum as SQLAEnum,+)+from sqlalchemy.dialects.postgresql import JSONB+from sqlalchemy.dialects.postgresql import UUID as PGUUIDfrom sqlalchemy.orm import Mapped, mapped_column, relationshipfrom . import Base@@ -37,19 +41,11 @@ class ExternalAsset(Base):__tablename__ = "external_assets"id: Mapped[UUID] = mapped_column(PGUUID(as_uuid=True), primary_key=True, default=uuid4)- tenant_id: Mapped[UUID] = mapped_column(- PGUUID(as_uuid=True), ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False- )- asset_type: Mapped[ExternalAssetType] = mapped_column(- SQLAEnum(ExternalAssetType, name="external_asset_type"), nullable=False- )+ tenant_id: Mapped[UUID] = mapped_column(PGUUID(as_uuid=True), ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False)+ asset_type: Mapped[ExternalAssetType] = mapped_column(SQLAEnum(ExternalAssetType, name="external_asset_type"), nullable=False)value: Mapped[str] = mapped_column(String(512), nullable=False) # domain, IP, cert CN, etc.- first_seen: Mapped[datetime] = mapped_column(- DateTime(timezone=True), nullable=False, default=datetime.utcnow- )- last_seen: Mapped[datetime] = mapped_column(- DateTime(timezone=True), nullable=False, default=datetime.utcnow- )+ first_seen: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False, default=datetime.utcnow)+ last_seen: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False, default=datetime.utcnow)metadata_json: Mapped[dict] = mapped_column(JSONB, nullable=False, default={})# e.g. {"ports": [443, 22], "certs": [...], "asn": "...", "org": "..."}@@ -70,17 +66,13 @@ class ExternalAssetDrift(Base):__tablename__ = "external_asset_drift"id: Mapped[UUID] = mapped_column(PGUUID(as_uuid=True), primary_key=True, default=uuid4)- tenant_id: Mapped[UUID] = mapped_column(- PGUUID(as_uuid=True), ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False- )+ tenant_id: Mapped[UUID] = mapped_column(PGUUID(as_uuid=True), ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False)external_asset_id: Mapped[UUID] = mapped_column(PGUUID(as_uuid=True), ForeignKey("external_assets.id", ondelete="CASCADE"), nullable=False)drift_type: Mapped[str] = mapped_column(String(64), nullable=False) # e.g. "new_port", "new_cert"details: Mapped[dict] = mapped_column(JSONB, nullable=False)- detected_at: Mapped[datetime] = mapped_column(- DateTime(timezone=True), nullable=False, default=datetime.utcnow- )+ detected_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False, default=datetime.utcnow)# Relationshipstenant = relationship("Tenant", back_populates="external_asset_drift", lazy="selectin")@@ -89,4 +81,4 @@ class ExternalAssetDrift(Base):__table_args__ = (Index("idx_easm_drift_tenant", "tenant_id"),Index("idx_easm_drift_asset", "external_asset_id"),- )\ No newline at end of file+ )diff --git a/services/api/app/models/inbox.py b/services/api/app/models/inbox.pyindex 43f21814d..35551c853 100644--- a/services/api/app/models/inbox.py+++ b/services/api/app/models/inbox.py@@ -64,12 +64,8 @@ class TenantInboxToken(Base):)# Non-NULL means the token has been rotated and the ingest service# rejects requests for it.- revoked_at: Mapped[datetime | None] = mapped_column(- DateTime(timezone=True), nullable=True- )- last_used_at: Mapped[datetime | None] = mapped_column(- DateTime(timezone=True), nullable=True- )+ revoked_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)+ last_used_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)__table_args__ = (Index("tenant_inbox_tokens_tenant_idx", "tenant_id"),diff --git a/services/api/app/models/institutional_memory.py b/services/api/app/models/institutional_memory.pyindex 5c3192f99..a99ab6ba7 100644--- a/services/api/app/models/institutional_memory.py+++ b/services/api/app/models/institutional_memory.py@@ -25,9 +25,7 @@ from app.db.database import Baseclass InstitutionalMemory(Base):__tablename__ = "aisoc_institutional_memory"- id: Mapped[uuid.UUID] = mapped_column(- UUID(as_uuid=True), primary_key=True, default=uuid.uuid4- )+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)# Stored as TEXT in the agents-service migration so we keep the same type# here; tenants are addressed by their string id from auth context, which# the API service already coerces to/from UUID at the boundary.@@ -37,9 +35,7 @@ class InstitutionalMemory(Base):tags: Mapped[list[str]] = mapped_column(ARRAY(Text), nullable=False, default=list)analyst_override: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)override_reason: Mapped[str | None] = mapped_column(Text, nullable=True)- created_at: Mapped[datetime] = mapped_column(- DateTime(timezone=True), nullable=False, default=lambda: datetime.now(UTC)- )+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False, default=lambda: datetime.now(UTC))__table_args__ = (UniqueConstraint("tenant_id", "key", name="aisoc_institutional_memory_tenant_id_key_key"),diff --git a/services/api/app/models/llm_credential.py b/services/api/app/models/llm_credential.pyindex 2434e9ba9..9eb274503 100644--- a/services/api/app/models/llm_credential.py+++ b/services/api/app/models/llm_credential.py@@ -83,9 +83,7 @@ class TenantLlmCredential(Base):# Provider-specific settings escape hatch (e.g. Azure deployment name,# OpenAI organization id, max_tokens override). Empty in v1.0; v1.1# features can populate this without a migration.- settings: Mapped[dict] = mapped_column(- JSONB, default=dict, nullable=False- )+ settings: Mapped[dict] = mapped_column(JSONB, default=dict, nullable=False)# Soft-disable without deleting. Lets an operator pause LLM for a# tenant during a key rotation without losing the saved configuration.enabled: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)@@ -103,6 +101,4 @@ class TenantLlmCredential(Base):# Bumped only when api_key_vault changes (the API endpoint manages# this). Drives the "rotated 3 days ago" hint in the Settings UI so# operators have a key-hygiene signal at a glance.- last_rotated_at: Mapped[datetime | None] = mapped_column(- DateTime(timezone=True), nullable=True- )+ last_rotated_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)diff --git a/services/api/app/models/mssp.py b/services/api/app/models/mssp.pyindex de779a18f..916d2da60 100644--- a/services/api/app/models/mssp.py+++ b/services/api/app/models/mssp.py@@ -66,17 +66,13 @@ class MSSPRulePack(Base):__tablename__ = "mssp_rule_packs"id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)- parent_tenant_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True- )+ parent_tenant_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True)name: Mapped[str] = mapped_column(Text, nullable=False)description: Mapped[str | None] = mapped_column(Text, nullable=True)category: Mapped[str | None] = mapped_column(Text, nullable=True)is_default: Mapped[bool] = mapped_column(Boolean, default=False, nullable=False)metadata_json: Mapped[dict] = mapped_column("metadata", JSONB, default=dict, nullable=False)- created_by_user: Mapped[uuid.UUID | None] = mapped_column(- ForeignKey("users.id", ondelete="SET NULL"), nullable=True- )+ created_by_user: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("users.id", ondelete="SET NULL"), nullable=True)created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),@@ -95,16 +91,10 @@ class MSSPRulePackRule(Base):__tablename__ = "mssp_rule_pack_rules"- pack_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("mssp_rule_packs.id", ondelete="CASCADE"), primary_key=True- )- rule_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("detection_rules.id", ondelete="CASCADE"), primary_key=True- )+ pack_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("mssp_rule_packs.id", ondelete="CASCADE"), primary_key=True)+ rule_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("detection_rules.id", ondelete="CASCADE"), primary_key=True)added_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))- added_by_user: Mapped[uuid.UUID | None] = mapped_column(- ForeignKey("users.id", ondelete="SET NULL"), nullable=True- )+ added_by_user: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("users.id", ondelete="SET NULL"), nullable=True)class MSSPRulePackAssignment(Base):@@ -113,17 +103,11 @@ class MSSPRulePackAssignment(Base):__tablename__ = "mssp_rule_pack_assignments"id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)- pack_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("mssp_rule_packs.id", ondelete="CASCADE"), nullable=False, index=True- )- child_tenant_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True- )+ pack_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("mssp_rule_packs.id", ondelete="CASCADE"), nullable=False, index=True)+ child_tenant_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True)enabled: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)parameter_overrides: Mapped[dict] = mapped_column(JSONB, default=dict, nullable=False)- assigned_by_user: Mapped[uuid.UUID | None] = mapped_column(- ForeignKey("users.id", ondelete="SET NULL"), nullable=True- )+ assigned_by_user: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("users.id", ondelete="SET NULL"), nullable=True)created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),@@ -131,9 +115,7 @@ class MSSPRulePackAssignment(Base):onupdate=lambda: datetime.now(UTC),)- __table_args__ = (- UniqueConstraint("pack_id", "child_tenant_id", name="mssp_rule_pack_assignments_pack_id_child_tenant_id_key"),- )+ __table_args__ = (UniqueConstraint("pack_id", "child_tenant_id", name="mssp_rule_pack_assignments_pack_id_child_tenant_id_key"),)class MSSPRuleOverride(Base):@@ -142,23 +124,15 @@ class MSSPRuleOverride(Base):__tablename__ = "mssp_rule_overrides"id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)- parent_tenant_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True- )- child_tenant_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True- )- rule_id: Mapped[uuid.UUID] = mapped_column(- ForeignKey("detection_rules.id", ondelete="CASCADE"), nullable=False, index=True- )+ parent_tenant_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True)+ child_tenant_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("tenants.id", ondelete="CASCADE"), nullable=False, index=True)+ rule_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("detection_rules.id", ondelete="CASCADE"), nullable=False, index=True)# 'exclude' or 'customize'action: Mapped[str] = mapped_column(Text, nullable=False)severity_override: Mapped[str | None] = mapped_column(Text, nullable=True)parameter_overrides: Mapped[dict] = mapped_column(JSONB, default=dict, nullable=False)note: Mapped[str | None] = mapped_column(Text, nullable=True)- created_by_user: Mapped[uuid.UUID | None] = mapped_column(- ForeignKey("users.id", ondelete="SET NULL"), nullable=True- )+ created_by_user: Mapped[uuid.UUID | None] = mapped_column(ForeignKey("users.id", ondelete="SET NULL"), nullable=True)created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),@@ -166,6 +140,4 @@ class MSSPRuleOverride(Base):onupdate=lambda: datetime.now(UTC),)- __table_args__ = (- UniqueConstraint("child_tenant_id", "rule_id", name="mssp_rule_overrides_child_tenant_id_rule_id_key"),- )+ __table_args__ = (UniqueConstraint("child_tenant_id", "rule_id", name="mssp_rule_overrides_child_tenant_id_rule_id_key"),)diff --git a/services/api/app/models/oauth.py b/services/api/app/models/oauth.pyindex eb780f496..5ab08d5db 100644--- a/services/api/app/models/oauth.py+++ b/services/api/app/models/oauth.py@@ -63,9 +63,7 @@ class OAuthAppCredential(Base):# Optional scope downscoping. NULL means use the default scopes# from the connector's OAuthHints. Stored as JSON array of strings.scopes: Mapped[list[str] | None] = mapped_column(JSONB, nullable=True)- created_at: Mapped[datetime] = mapped_column(- DateTime(timezone=True), default=lambda: datetime.now(UTC)- )+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),default=lambda: datetime.now(UTC),@@ -120,12 +118,6 @@ class OAuthState(Base):extras: Mapped[dict] = mapped_column(JSONB, default=dict, nullable=False)# Where to redirect the operator after the callback. Defaults to# /onboarding so the verify-data-flowing screen lights up.- return_to: Mapped[str] = mapped_column(- Text, default="/onboarding", nullable=False- )- created_at: Mapped[datetime] = mapped_column(- DateTime(timezone=True), default=lambda: datetime.now(UTC), nullable=False- )- expires_at: Mapped[datetime] = mapped_column(- DateTime(timezone=True), nullable=False- )+ return_to: Mapped[str] = mapped_column(Text, default="/onboarding", nullable=False)+ created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC), nullable=False)+ expires_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), nullable=False)diff --git a/services/api/app/models/saved_view.py b/services/api/app/models/saved_view.pyindex b0fac0a23..b932eab08 100644--- a/services/api/app/models/saved_view.py+++ b/services/api/app/models/saved_view.py@@ -45,9 +45,7 @@ class SavedView(Base):__tablename__ = "saved_views"- id: Mapped[uuid.UUID] = mapped_column(- UUID(as_uuid=True), primary_key=True, default=uuid.uuid4- )+ id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)tenant_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True),@@ -71,23 +69,17 @@ class SavedView(Base):# Opaque JSON matching the list page's filter shape. The backend# never inspects the contents.- filters: Mapped[dict] = mapped_column(- JSONB, nullable=False, default=dict, server_default=text("'{}'::jsonb")- )+ filters: Mapped[dict] = mapped_column(JSONB, nullable=False, default=dict, server_default=text("'{}'::jsonb"))# Optional ordered list of column ids/widths. NULL means "use the# page default column set" — saves a row from carrying redundant# default state.- columns: Mapped[list | dict | None] = mapped_column(- JSONB, nullable=True, default=None- )+ columns: Mapped[list | dict | None] = mapped_column(JSONB, nullable=True, default=None)# Exactly one default per (tenant, user, view_type) — the partial# unique index in the migration enforces this at the DB layer so# we don't have to do a transactional toggle in the API.- is_default: Mapped[bool] = mapped_column(- Boolean, nullable=False, default=False, server_default=text("false")- )+ is_default: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False, server_default=text("false"))created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),diff --git a/services/api/app/models/tenant.py b/services/api/app/models/tenant.pyindex 96e9086fd..dae74d9b0 100644--- a/services/api/app/models/tenant.py+++ b/services/api/app/models/tenant.py@@ -20,6 +20,11 @@ class Tenant(Base):is_active: Mapped[bool] = mapped_column(Boolean, default=True)settings: Mapped[dict] = mapped_column(JSONB, default=dict)limits: Mapped[dict] = mapped_column(JSONB, default=dict)+ # MSSP hierarchy fields+ parent_tenant_id: Mapped[uuid.UUID | None] = mapped_column(+ UUID(as_uuid=True), ForeignKey("tenants.id"), nullable=True, index=True+ )+ mssp_role: Mapped[str | None] = mapped_column(String(50), nullable=True)created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=lambda: datetime.now(UTC))updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True),@@ -28,13 +33,9 @@ class Tenant(Base):)users: Mapped[list["User"]] = relationship("User", back_populates="tenant", lazy="noload")- connectors: Mapped[list["Connector"]] = relationship("Connector", back_populates="tenant", lazy="noload")- external_assets: Mapped[list["ExternalAsset"]] = relationship(- "ExternalAsset", back_populates="tenant", lazy="noload"- )- external_asset_drift: Mapped[list["ExternalAssetDrift"]] = relationship(- "ExternalAssetDrift", back_populates="tenant", lazy="noload"- )+ connectors: Mapped[list["Connector"]] = relationship("Connector", back_populates="tenant", lazy="noload") # type: ignore[name-defined]+ external_assets: Mapped[list["ExternalAsset"]] = relationship("ExternalAsset", back_populates="tenant", lazy="noload") # type: ignore[name-defined]+ external_asset_drift: Mapped[list["ExternalAssetDrift"]] = relationship("ExternalAssetDrift", back_populates="tenant", lazy="noload") # type: ignore[name-defined]class User(Base):diff --git a/services/api/app/scripts/run_migrations.py b/services/api/app/scripts/run_migrations.pyindex 09a514be9..4d3771001 100644--- a/services/api/app/scripts/run_migrations.py+++ b/services/api/app/scripts/run_migrations.py@@ -81,9 +81,7 @@ def _asyncpg_dsn(url: str) -> tuple[str, dict]:continueremaining.append((key, value))- new_url = urlunsplit(- (parts.scheme, parts.netloc, parts.path, "&".join(f"{k}={v}" for k, v in remaining), parts.fragment)- )+ new_url = urlunsplit((parts.scheme, parts.netloc, parts.path, "&".join(f"{k}={v}" for k, v in remaining), parts.fragment))return new_url, kwargsdiff --git a/services/api/app/scripts/seed_demo.py b/services/api/app/scripts/seed_demo.pyindex d5f47a36f..61467e71c 100644--- a/services/api/app/scripts/seed_demo.py+++ b/services/api/app/scripts/seed_demo.py@@ -351,15 +351,30 @@ _REALISTIC_INCIDENTS: list[dict] = ["trigger": "ransomware-encryption-pattern",},"steps": [- ("isolate-host", "Isolate host via CrowdStrike RTR", "completed",- {"action": "endpoint.isolate", "target": "WIN-FIN-DB01", "result": "contained", "duration_ms": 4_120}),- ("snapshot-disk", "Capture forensic disk image to S3", "completed",- {"action": "endpoint.snapshot", "target": "WIN-FIN-DB01",- "snapshot_id": "snap-0c7f1aa9", "duration_ms": 96_350}),- ("block-c2", "Block known LockBit C2 ranges on perimeter", "completed",- {"action": "network.block_ip", "targets": ["203.0.113.42", "198.51.100.71"], "duration_ms": 2_980}),- ("kill-encryption-process", "Kill encryption process on host", "running",- {"action": "endpoint.kill_process", "process_name": "lockbit.exe", "started_at_offset_s": 240}),+ (+ "isolate-host",+ "Isolate host via CrowdStrike RTR",+ "completed",+ {"action": "endpoint.isolate", "target": "WIN-FIN-DB01", "result": "contained", "duration_ms": 4_120},+ ),+ (+ "snapshot-disk",+ "Capture forensic disk image to S3",+ "completed",+ {"action": "endpoint.snapshot", "target": "WIN-FIN-DB01", "snapshot_id": "snap-0c7f1aa9", "duration_ms": 96_350},+ ),+ (+ "block-c2",+ "Block known LockBit C2 ranges on perimeter",+ "completed",+ {"action": "network.block_ip", "targets": ["203.0.113.42", "198.51.100.71"], "duration_ms": 2_980},+ ),+ (+ "kill-encryption-process",+ "Kill encryption process on host",+ "running",+ {"action": "endpoint.kill_process", "process_name": "lockbit.exe", "started_at_offset_s": 240},+ ),("rotate-credentials", "Rotate svc-backup credentials in AD + secrets vault", "pending", {}),("notify-stakeholders", "Open ticket, page incident commander, notify legal", "pending", {}),],@@ -431,14 +446,30 @@ _REALISTIC_INCIDENTS: list[dict] = ["wire_status": "recalled",},"steps": [- ("revoke-oauth-grant", "Revoke malicious OAuth grant", "completed",- {"action": "saas.revoke_oauth", "app": "Acme Calendar Sync", "duration_ms": 3_400}),- ("delete-inbox-rule", "Delete malicious inbox rule", "completed",- {"action": "saas.delete_inbox_rule", "duration_ms": 2_100}),- ("force-mfa-reset", "Force MFA + password reset for [email protected]", "completed",- {"action": "identity.force_mfa", "duration_ms": 5_780}),- ("notify-treasury", "Notify treasury to recall wire", "completed",- {"action": "ticket.create", "system": "ServiceNow", "ticket": "INC0019823"}),+ (+ "revoke-oauth-grant",+ "Revoke malicious OAuth grant",+ "completed",+ {"action": "saas.revoke_oauth", "app": "Acme Calendar Sync", "duration_ms": 3_400},+ ),+ (+ "delete-inbox-rule",+ "Delete malicious inbox rule",+ "completed",+ {"action": "saas.delete_inbox_rule", "duration_ms": 2_100},+ ),+ (+ "force-mfa-reset",+ "Force MFA + password reset for [email protected]",+ "completed",+ {"action": "identity.force_mfa", "duration_ms": 5_780},+ ),+ (+ "notify-treasury",+ "Notify treasury to recall wire",+ "completed",+ {"action": "ticket.create", "system": "ServiceNow", "ticket": "INC0019823"},+ ),("ioc-share", "Share sender IPs with TIP", "completed", {"action": "tip.share"}),],},@@ -500,10 +531,13 @@ _REALISTIC_INCIDENTS: list[dict] = ["status": "running","context": {"target_user": "[email protected]"},"steps": [- ("suspend-session", "Suspend Okta session for user", "completed",- {"action": "identity.suspend_session", "duration_ms": 1_900}),- ("force-mfa", "Force step-up MFA on next login", "completed",- {"action": "identity.force_mfa", "duration_ms": 1_200}),+ (+ "suspend-session",+ "Suspend Okta session for user",+ "completed",+ {"action": "identity.suspend_session", "duration_ms": 1_900},+ ),+ ("force-mfa", "Force step-up MFA on next login", "completed", {"action": "identity.force_mfa", "duration_ms": 1_200}),("rotate-app-tokens", "Revoke OAuth refresh tokens", "running", {}),("alert-user", "Page user for verification", "pending", {}),],@@ -566,12 +600,9 @@ _REALISTIC_INCIDENTS: list[dict] = ["status": "running","context": {"iam_user": "build-runner"},"steps": [- ("disable-key", "Deactivate IAM access key", "completed",- {"action": "aws.iam.deactivate_key", "duration_ms": 2_900}),- ("rotate-key", "Issue replacement key for service", "completed",- {"action": "aws.iam.create_key", "duration_ms": 3_400}),- ("block-ip", "Add NACL block for malicious IP", "completed",- {"action": "aws.nacl.deny", "ip": "104.244.42.193"}),+ ("disable-key", "Deactivate IAM access key", "completed", {"action": "aws.iam.deactivate_key", "duration_ms": 2_900}),+ ("rotate-key", "Issue replacement key for service", "completed", {"action": "aws.iam.create_key", "duration_ms": 3_400}),+ ("block-ip", "Add NACL block for malicious IP", "completed", {"action": "aws.nacl.deny", "ip": "104.244.42.193"}),("audit-bucket-access", "Audit corp-hr-backups access", "running", {}),],},@@ -769,8 +800,7 @@ _REALISTIC_INCIDENTS: list[dict] = ["status": "running","context": {"host": "WIN-DEVOPS-LT", "framework": "cobalt-strike"},"steps": [- ("isolate-host", "Isolate host via Defender", "completed",- {"action": "endpoint.isolate", "duration_ms": 3_900}),+ ("isolate-host", "Isolate host via Defender", "completed", {"action": "endpoint.isolate", "duration_ms": 3_900}),("block-c2-ip", "Block 23.106.222.74", "completed", {"duration_ms": 1_700}),("dns-sinkhole", "Sinkhole azonly-cdn.io", "running", {}),("memory-capture", "Capture memory image for analysis", "pending", {}),@@ -1062,7 +1092,9 @@ _REALISTIC_INCIDENTS: list[dict] = ["userIdentity": {"type": "IAMUser", "userName": "devops-admin"},"requestParameters": {"bucketName": "corp-hr-backups",- "AccessControlPolicy": {"Grants": [{"Permission": "READ", "Grantee": {"URI": "http://acs.amazonaws.com/groups/global/AllUsers"}}]},+ "AccessControlPolicy": {+ "Grants": [{"Permission": "READ", "Grantee": {"URI": "http://acs.amazonaws.com/groups/global/AllUsers"}}]+ },},"sourceIPAddress": "10.0.2.4",},@@ -1529,14 +1561,8 @@ def _make_realistic_alert() -> Alert:severity = alert_spec["severity"]priority = {"critical": 92, "high": 78, "medium": 55, "low": 28}[severity]- techniques = [- {"id": tid, "name": _TECHNIQUE_NAMES.get(tid, tid)}- for tid in incident["technique_ids"]- ]- tactics = [- {"id": tid, "name": _TACTIC_NAMES.get(tid, tid)}- for tid in incident["tactic_ids"]- ]+ techniques = [{"id": tid, "name": _TECHNIQUE_NAMES.get(tid, tid)} for tid in incident["technique_ids"]]+ tactics = [{"id": tid, "name": _TACTIC_NAMES.get(tid, tid)} for tid in incident["tactic_ids"]]raw_event = _bots_raw_event(when,@@ -1552,10 +1578,7 @@ def _make_realistic_alert(return Alert(tenant_id=tenant_id,title=alert_spec["title"],- description=(- f"{alert_spec['source']} detection. "- f"{incident['description']}"- ),+ description=(f"{alert_spec['source']} detection. {incident['description']}"),severity=severity,status=_alert_status_for_case(case_status),priority=priority,@@ -1595,14 +1618,8 @@ def _make_realistic_case(when: datetime,alert_ids: list[uuid.UUID],) -> Case:- techniques = [- {"id": tid, "name": _TECHNIQUE_NAMES.get(tid, tid)}- for tid in incident["technique_ids"]- ]- tactics = [- {"id": tid, "name": _TACTIC_NAMES.get(tid, tid)}- for tid in incident["tactic_ids"]- ]+ techniques = [{"id": tid, "name": _TECHNIQUE_NAMES.get(tid, tid)} for tid in incident["technique_ids"]]+ tactics = [{"id": tid, "name": _TACTIC_NAMES.get(tid, tid)} for tid in incident["tactic_ids"]]closed_at = when + timedelta(hours=4) if incident["status"] in ("resolved", "closed") else Nonereturn Case(@@ -1653,15 +1670,17 @@ def _serialize_playbook_run(for step_id, name, status, output in spec["steps"]:cursor = cursor + timedelta(seconds=_rng.randint(15, 120))finished = cursor + timedelta(milliseconds=output.get("duration_ms", 4_000)) if status == "completed" else None- step_results.append({- "step_id": step_id,- "name": name,- "status": status,- "started_at": cursor.isoformat() if status != "pending" else None,- "completed_at": finished.isoformat() if finished else None,- "output": output,- "attempts": 1 if status != "pending" else 0,- })+ step_results.append(+ {+ "step_id": step_id,+ "name": name,+ "status": status,+ "started_at": cursor.isoformat() if status != "pending" else None,+ "completed_at": finished.isoformat() if finished else None,+ "output": output,+ "attempts": 1 if status != "pending" else 0,+ }+ )if status == "completed" and finished:cursor = finished@@ -1691,12 +1710,7 @@ async def _seed_realistic_incidents(session, tenant: Tenant) -> tuple[int, int,Returns ``(alerts, cases, playbook_runs)``. Idempotent: short-circuits ifany case with an ``INC-RT-`` prefix is already present."""- existing = await session.execute(- select(Case)- .where(Case.tenant_id == tenant.id)- .where(Case.case_number.like("INC-RT-%"))- .limit(1)- )+ existing = await session.execute(select(Case).where(Case.tenant_id == tenant.id).where(Case.case_number.like("INC-RT-%")).limit(1))if existing.scalar_one_or_none() is not None:return 0, 0, 0@@ -1708,7 +1722,7 @@ async def _seed_realistic_incidents(session, tenant: Tenant) -> tuple[int, int,# Spread incidents across the last 14 days, keeping the in-flight one# very recent so it shows up at the top of the queue.- for index, incident in enumerate(_REALISTIC_INCIDENTS):+ for _index, incident in enumerate(_REALISTIC_INCIDENTS):is_in_flight = bool(incident.get("in_flight_investigation"))offset_minutes = 8 if is_in_flight else _rng.randint(60, 60 * 24 * 13)case_when = now - timedelta(minutes=offset_minutes)@@ -1787,7 +1801,7 @@ async def _seed_realistic_incidents(session, tenant: Tenant) -> tuple[int, int,session.add_all(timeline_rows)await session.flush()- _ = index # silence unused-loop-var lint+return len(new_alerts), len(new_cases), playbook_run_count@@ -1806,10 +1820,7 @@ async def _seed_in_flight_investigation(session, tenant: Tenant) -> int:return 0existing = await session.execute(- select(InvestigationRun)- .where(InvestigationRun.tenant_id == tenant.id)- .where(InvestigationRun.case_id == incident["key"])- .limit(1)+ select(InvestigationRun).where(InvestigationRun.tenant_id == tenant.id).where(InvestigationRun.case_id == incident["key"]).limit(1))if existing.scalar_one_or_none() is not None:return 0@@ -2066,11 +2077,7 @@ async def _mirror_cases_to_aisoc(session, tenant: Tenant) -> int:Idempotent: ``ON CONFLICT (id) DO NOTHING`` so re-runs are no-ops."""- rows = (- await session.execute(- select(Case).where(Case.tenant_id == tenant.id)- )- ).scalars().all()+ rows = (await session.execute(select(Case).where(Case.tenant_id == tenant.id))).scalars().all()if not rows:return 0@@ -2144,9 +2151,7 @@ async def main() -> None:user = await _ensure_user(session, tenant)new_connectors = await _seed_connectors(session, tenant)new_alerts, new_cases = await _seed_alerts_and_cases(session, tenant)- realistic_alerts, realistic_cases, playbook_runs = await _seed_realistic_incidents(- session, tenant- )+ realistic_alerts, realistic_cases, playbook_runs = await _seed_realistic_incidents(session, tenant)in_flight_runs = await _seed_in_flight_investigation(session, tenant)mirrored = await _mirror_cases_to_aisoc(session, tenant)await session.commit()diff --git a/services/api/app/scripts/serve.py b/services/api/app/scripts/serve.pyindex 3ad81bdb1..a32124865 100644--- a/services/api/app/scripts/serve.py+++ b/services/api/app/scripts/serve.py@@ -18,6 +18,7 @@ Why this exists:This wrapper is the production CMD for the API container."""+from __future__ import annotationsimport osdiff --git a/services/api/app/services/audit_export.py b/services/api/app/services/audit_export.pyindex a93226282..93f1e5124 100644--- a/services/api/app/services/audit_export.py+++ b/services/api/app/services/audit_export.py@@ -98,11 +98,7 @@ def render_audit_csv(rows: list[AuditRow]) -> str:writer = csv.writer(buf, quoting=csv.QUOTE_ALL, lineterminator="\r\n")writer.writerow(_CSV_HEADERS)for row in rows:- changes_blob = (- ""- if row.changes is None- else json.dumps(row.changes, sort_keys=True, separators=(",", ":"))- )+ changes_blob = "" if row.changes is None else json.dumps(row.changes, sort_keys=True, separators=(",", ":"))writer.writerow((row.id,@@ -139,7 +135,7 @@ def _filter_chip(label: str, value: str | None) -> str:return ""return ('<span style="display:inline-block;margin:0 6px 6px 0;padding:3px 8px;'- 'border:1px solid #cbd5e1;border-radius:9999px;background:#f1f5f9;'+ "border:1px solid #cbd5e1;border-radius:9999px;background:#f1f5f9;"'font-size:11px;color:#1e293b;">'f"{_esc(label)}: <strong>{_esc(value)}</strong></span>")@@ -180,7 +176,7 @@ def _changes_cell(changes: dict | None) -> str:return ('<pre style="margin:0;padding:6px 8px;background:#f8fafc;'"border:1px solid #e2e8f0;border-radius:4px;font-size:11px;"- 'font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;'+ "font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;"'white-space:pre-wrap;word-break:break-word;max-width:480px;">'f"{_esc(pretty)}</pre>")@@ -190,8 +186,7 @@ def _row_html(row: AuditRow) -> str:actor = row.actor_email or row.actor_id or "—"ip = row.actor_ip or "—"resource = (- f"{_esc(row.resource)}<br/><span style=\"color:#64748b;font-size:11px;\">"- f"{_esc(row.resource_id)}</span>"+ f'{_esc(row.resource)}<br/><span style="color:#64748b;font-size:11px;">{_esc(row.resource_id)}</span>'if row.resource and row.resource_idelse _esc(row.resource or row.resource_id or "—"))@@ -215,9 +210,10 @@ def render_audit_html(rows: list[AuditRow], context: ExportContext) -> str:the file remains portable when downloaded — no external stylesheets,no JavaScript, browser print-to-PDF works out of the box."""- filters_html = "".join(- _filter_chip(label, value) for label, value in context.filters.items()- ) or '<span style="color:#94a3b8;font-size:12px;">No filters applied — full audit trail.</span>'+ filters_html = (+ "".join(_filter_chip(label, value) for label, value in context.filters.items())+ or '<span style="color:#94a3b8;font-size:12px;">No filters applied — full audit trail.</span>'+ )rows_html = ("".join(_row_html(row) for row in rows)diff --git a/services/api/app/services/case_summary.py b/services/api/app/services/case_summary.pyindex cb9f57624..ede8a31ca 100644--- a/services/api/app/services/case_summary.py+++ b/services/api/app/services/case_summary.py@@ -41,7 +41,6 @@ from pydantic import BaseModel, Fieldfrom sqlalchemy import textfrom sqlalchemy.ext.asyncio import AsyncSession-# ---------------------------------------------------------------------------# Output schemas (Pydantic) — what the endpoint actually returns.# ---------------------------------------------------------------------------@@ -301,11 +300,7 @@ def _summarise_tasks(rows: list[SummaryTaskRow], *, now: datetime) -> TaskBreakdoverdue = 0for row in rows:counts[row.status] += 1- if (- row.status != "done"- and row.due_at is not None- and row.due_at < now- ):+ if row.status != "done" and row.due_at is not None and row.due_at < now:overdue += 1return TaskBreakdown(total=len(rows),@@ -349,21 +344,13 @@ def _build_timeline("""events: list[TimelineHighlight] = []- events.append(- TimelineHighlight(ts=case.opened_at, kind="case", label="Case opened")- )+ events.append(TimelineHighlight(ts=case.opened_at, kind="case", label="Case opened"))if case.triaged_at:- events.append(- TimelineHighlight(ts=case.triaged_at, kind="case", label="Triaged")- )+ events.append(TimelineHighlight(ts=case.triaged_at, kind="case", label="Triaged"))if case.resolved_at:- events.append(- TimelineHighlight(ts=case.resolved_at, kind="case", label="Resolved")- )+ events.append(TimelineHighlight(ts=case.resolved_at, kind="case", label="Resolved"))if case.closed_at:- events.append(- TimelineHighlight(ts=case.closed_at, kind="case", label="Closed")- )+ events.append(TimelineHighlight(ts=case.closed_at, kind="case", label="Closed"))for c in comments:body_excerpt = (c.body or "").strip().replace("\n", " ")@@ -373,9 +360,7 @@ def _build_timeline(TimelineHighlight(ts=c.created_at,kind="comment",- label=("System note" if c.is_system else "Analyst note") + (- f" — {c.author}" if c.author and not c.is_system else ""- ),+ label=("System note" if c.is_system else "Analyst note") + (f" — {c.author}" if c.author and not c.is_system else ""),detail=body_excerpt or None,))@@ -386,8 +371,7 @@ def _build_timeline(ts=t.created_at,kind="task",label=f"Task created — {t.title}",- detail=f"status={t.status}"- + (f" · assignee={t.assignee}" if t.assignee else ""),+ detail=f"status={t.status}" + (f" · assignee={t.assignee}" if t.assignee else ""),))@@ -455,17 +439,11 @@ def _build_recommendations(CaseRecommendation(severity="warning",title=f"{tasks.overdue} overdue task{'s' if tasks.overdue != 1 else ''}",- body=(- "Tasks past their due date are still open. Close them out or "- "reassign before archiving the case."- ),+ body=("Tasks past their due date are still open. Close them out or reassign before archiving the case."),))- if (- case.severity in {"high", "critical"}- and comments.analyst == 0- ):+ if case.severity in {"high", "critical"} and comments.analyst == 0:recs.append(CaseRecommendation(severity="warning",@@ -491,10 +469,7 @@ def _build_recommendations())- if (- lifecycle.time_to_resolve_hours is not None- and lifecycle.time_to_resolve_hours > 24- ):+ if lifecycle.time_to_resolve_hours is not None and lifecycle.time_to_resolve_hours > 24:recs.append(CaseRecommendation(severity="info",@@ -512,10 +487,7 @@ def _build_recommendations(CaseRecommendation(severity="info",title="Case closed cleanly",- body=(- "All headline metrics look healthy. Archive this case and "- "fold any new IOCs into your detection content."- ),+ body=("All headline metrics look healthy. Archive this case and fold any new IOCs into your detection content."),))@@ -545,10 +517,7 @@ def build_summary_from_rows(time_to_triage_hours=_hours_between(case.triaged_at, case.opened_at),time_to_resolve_hours=_hours_between(case.resolved_at, case.opened_at),time_to_close_hours=_hours_between(case.closed_at, case.opened_at),- sla_breached=bool(- case.sla_due_at- and (case.resolved_at or case.closed_at or moment) > case.sla_due_at- ),+ sla_breached=bool(case.sla_due_at and (case.resolved_at or case.closed_at or moment) > case.sla_due_at),)coverage = CoverageSummary(@@ -627,12 +596,8 @@ def _row_to_summary_case(row: Any) -> SummaryCaseRow:tags=dict(row.tags or {}) if isinstance(row.tags, dict) else {},mitre_techniques=techniques,alert_ids=[str(a) for a in (row.alert_ids or [])],- observable_graph=dict(row.observable_graph or {})- if isinstance(row.observable_graph, dict)- else {},- evidence_chain=list(row.evidence_chain or [])- if isinstance(row.evidence_chain, list)- else [],+ observable_graph=dict(row.observable_graph or {}) if isinstance(row.observable_graph, dict) else {},+ evidence_chain=list(row.evidence_chain or []) if isinstance(row.evidence_chain, list) else [],compliance_frameworks=list(row.compliance_frameworks or []),opened_at=row.opened_at,triaged_at=row.triaged_at,@@ -645,21 +610,16 @@ def _row_to_summary_case(row: Any) -> SummaryCaseRow:async def _fetch_case_for_summary(db: AsyncSession, case_id: uuid.UUID) -> SummaryCaseRow | None:- row = (- await db.execute(- text("SELECT * FROM aisoc_cases WHERE id = :id").bindparams(id=case_id)- )- ).fetchone()+ row = (await db.execute(text("SELECT * FROM aisoc_cases WHERE id = :id").bindparams(id=case_id))).fetchone()return _row_to_summary_case(row) if row else Noneasync def _fetch_comments(db: AsyncSession, case_id: uuid.UUID) -> list[SummaryCommentRow]:rows = (await db.execute(- text(- "SELECT author, body, is_system, created_at "- "FROM aisoc_case_comments WHERE case_id = :id ORDER BY created_at"- ).bindparams(id=case_id)+ text("SELECT author, body, is_system, created_at FROM aisoc_case_comments WHERE case_id = :id ORDER BY created_at").bindparams(+ id=case_id+ ))).fetchall()return [diff --git a/services/api/app/services/case_summary_html.py b/services/api/app/services/case_summary_html.pyindex e9eae518c..de56da1d0 100644--- a/services/api/app/services/case_summary_html.py+++ b/services/api/app/services/case_summary_html.py@@ -33,7 +33,6 @@ from .case_summary import (TimelineHighlight,)-_SEVERITY_COLOURS: dict[str, str] = {"critical": "#b91c1c","high": "#c2410c",@@ -71,17 +70,13 @@ def _severity_chip(severity: str) -> str:colour = _SEVERITY_COLOURS.get(severity, "#475569")return (f'<span style="display:inline-block;padding:2px 8px;border-radius:9999px;'- f'background:{colour};color:#fff;font-size:11px;text-transform:uppercase;'+ f"background:{colour};color:#fff;font-size:11px;text-transform:uppercase;"f'letter-spacing:0.04em;">{_esc(severity)}</span>')def _kpi(label: str, value: str, *, hint: str | None = None) -> str:- hint_html = (- f'<div style="font-size:11px;color:#64748b;margin-top:2px;">{_esc(hint)}</div>'- if hint- else ""- )+ hint_html = f'<div style="font-size:11px;color:#64748b;margin-top:2px;">{_esc(hint)}</div>' if hint else ""return ('<div style="flex:1 1 140px;background:#f8fafc;border:1px solid #e2e8f0;''border-radius:8px;padding:12px 14px;min-width:140px;">'@@ -96,20 +91,20 @@ def _kpi(label: str, value: str, *, hint: str | None = None) -> str:def _header_block(case: CaseSummaryHeader, lifecycle: CaseLifecycleTimings, headline: str) -> str:label = case.case_number or str(case.case_id)[:8]return (- '<header>'+ "<header>"'<div style="font-size:11px;color:#64748b;text-transform:uppercase;''letter-spacing:0.08em;">AiSOC case auto-summary</div>'- f'<h1>{_esc(label)} — {_esc(case.title)}</h1>'+ f"<h1>{_esc(label)} — {_esc(case.title)}</h1>"f'<div style="margin-top:6px;">{_severity_chip(case.severity)} 'f'<span style="display:inline-block;padding:2px 8px;border-radius:9999px;'f'background:#e2e8f0;color:#0f172a;font-size:11px;margin-left:6px;">'- f'{_esc(case.status)}</span></div>'+ f"{_esc(case.status)}</span></div>"f'<div style="color:#334155;font-size:14px;margin-top:8px;">{_esc(headline)}</div>'f'<div style="color:#94a3b8;font-size:11px;margin-top:6px;">'- f'Case {_esc(case.case_id)} · '- f'opened {_fmt_datetime(lifecycle.opened_at)} · '- f'generated {_fmt_datetime(datetime.now(UTC))}</div>'- '</header>'+ f"Case {_esc(case.case_id)} · "+ f"opened {_fmt_datetime(lifecycle.opened_at)} · "+ f"generated {_fmt_datetime(datetime.now(UTC))}</div>"+ "</header>")@@ -118,7 +113,7 @@ def _description_block(case: CaseSummaryHeader) -> str:return ""return ('<div style="background:#f8fafc;border:1px solid #e2e8f0;'- 'border-radius:8px;padding:12px 14px;margin-top:14px;color:#0f172a;'+ "border-radius:8px;padding:12px 14px;margin-top:14px;color:#0f172a;"f'font-size:13px;line-height:1.55;">{_esc(case.description)}</div>')@@ -168,8 +163,7 @@ def _coverage_block(coverage: CoverageSummary) -> str:technique_chips = ('<div style="margin-top:8px;display:flex;flex-wrap:wrap;gap:6px;">'+ "".join(- f'<span style="padding:2px 8px;border-radius:9999px;background:#eef2ff;'- f'color:#3730a3;font-size:11px;">{_esc(t)}</span>'+ f'<span style="padding:2px 8px;border-radius:9999px;background:#eef2ff;color:#3730a3;font-size:11px;">{_esc(t)}</span>'for t in techniques)+ "</div>"@@ -180,8 +174,7 @@ def _coverage_block(coverage: CoverageSummary) -> str:frameworks = ('<div style="margin-top:8px;display:flex;flex-wrap:wrap;gap:6px;">'+ "".join(- f'<span style="padding:2px 8px;border-radius:9999px;background:#ecfdf5;'- f'color:#047857;font-size:11px;">{_esc(f)}</span>'+ f'<span style="padding:2px 8px;border-radius:9999px;background:#ecfdf5;color:#047857;font-size:11px;">{_esc(f)}</span>'for f in coverage.compliance_frameworks)+ "</div>"@@ -189,13 +182,7 @@ def _coverage_block(coverage: CoverageSummary) -> str:else '<p style="color:#64748b;font-size:13px;">No compliance frameworks tagged.</p>')- return (- '<h2>MITRE ATT&CK techniques</h2>'- + technique_chips- + tactic_rows- + '<h2>Compliance frameworks</h2>'- + frameworks- )+ return "<h2>MITRE ATT&CK techniques</h2>" + technique_chips + tactic_rows + "<h2>Compliance frameworks</h2>" + frameworksdef _evidence_block(@@ -204,7 +191,7 @@ def _evidence_block(alerts: dict[str, object],) -> str:return (- '<h2>Evidence & observables</h2>'+ "<h2>Evidence & observables</h2>"'<div style="display:flex;flex-wrap:wrap;gap:12px;">'+ _kpi("Linked alerts", str(alerts.get("count", 0)))+ _kpi(@@ -225,7 +212,7 @@ def _activity_block(tasks: TaskBreakdown, comments: CommentBreakdown) -> str:overdue_hint = f"{tasks.overdue} overdue" if tasks.overdue else Noneauthors_hint = ", ".join(comments.distinct_authors[:3]) if comments.distinct_authors else Nonereturn (- '<h2>Activity</h2>'+ "<h2>Activity</h2>"'<div style="display:flex;flex-wrap:wrap;gap:12px;">'+ _kpi("Tasks (total)", str(tasks.total))+ _kpi("Tasks done", str(tasks.done), hint=overdue_hint)@@ -244,19 +231,19 @@ def _timeline_block(events: list[TimelineHighlight]) -> str:if not events:return ""rows = "".join(- '<tr>'+ "<tr>"f'<td style="padding:6px 8px;color:#64748b;font-size:11px;'f'white-space:nowrap;">{_fmt_datetime(e.ts)}</td>'f'<td style="padding:6px 8px;color:#475569;font-size:11px;text-transform:uppercase;'f'letter-spacing:0.06em;">{_esc(e.kind)}</td>'f'<td style="padding:6px 8px;color:#0f172a;">{_esc(e.label)}</td>'f'<td style="padding:6px 8px;color:#475569;font-size:12px;">'- f'{_esc(e.detail) if e.detail else "—"}</td>'- '</tr>'+ f"{_esc(e.detail) if e.detail else '—'}</td>"+ "</tr>"for e in events)return (- '<h2>Timeline</h2>'+ "<h2>Timeline</h2>"'<table style="width:100%;border-collapse:collapse;font-size:13px;">''<thead><tr style="text-align:left;color:#64748b;font-size:11px;''text-transform:uppercase;letter-spacing:0.06em;">'@@ -280,7 +267,7 @@ def _recommendation_block(recs: list[CaseRecommendation]) -> str:"</div>".format(colour=_REC_COLOURS.get(r.severity, "#475569"))for r in recs)- return '<h2>Post-mortem</h2>' + cards+ return "<h2>Post-mortem</h2>" + cardsdef render_case_summary_html(summary: CaseAutoSummary) -> str:@@ -302,7 +289,8 @@ def render_case_summary_html(summary: CaseAutoSummary) -> str:}}h1, h2, h3 {{ color: #0f172a; margin-top: 0; }}h1 {{ font-size: 22px; margin-bottom: 4px; }}- h2 {{ font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; margin: 20px 0 10px; border-top: 1px solid #e2e8f0; padding-top: 14px; }}+ h2 {{ font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em;+ color: #475569; margin: 20px 0 10px; border-top: 1px solid #e2e8f0; padding-top: 14px; }}table th, table td {{ border-bottom: 1px solid #f1f5f9; }}@media print {{body {{ padding: 0; }}diff --git a/services/api/app/services/compliance.py b/services/api/app/services/compliance.pyindex c32db3c63..c31df038e 100644--- a/services/api/app/services/compliance.py+++ b/services/api/app/services/compliance.py@@ -15,6 +15,7 @@ from sqlalchemy.ext.asyncio import AsyncSessionfrom app.models.audit import AuditLogfrom app.models.compliance import ComplianceControl, ComplianceEvidence+async def auto_collect_evidence(db: AsyncSession,tenant_id: uuid.UUID,diff --git a/services/api/app/services/cost_dashboard.py b/services/api/app/services/cost_dashboard.pyindex 46cd9698e..d0d1bad35 100644--- a/services/api/app/services/cost_dashboard.py+++ b/services/api/app/services/cost_dashboard.py@@ -44,7 +44,6 @@ from pydantic import BaseModel, Fieldfrom sqlalchemy import textfrom sqlalchemy.ext.asyncio import AsyncSession-# ---------------------------------------------------------------------------# Public list pricing for BYOK imputation.#@@ -83,8 +82,7 @@ def _impute_public_cost(_DEFAULT_PUBLIC_PRICING,)return round(- (max(prompt_tokens, 0) / 1000) * in_price- + (max(completion_tokens, 0) / 1000) * out_price,+ (max(prompt_tokens, 0) / 1000) * in_price + (max(completion_tokens, 0) / 1000) * out_price,6,)@@ -227,9 +225,7 @@ class DashboardInputs:period_end: datetimecost_rows: list[CostRow] = field(default_factory=list)audit_rows: list[AuditRow] = field(default_factory=list)- llm: LlmContext = field(- default_factory=lambda: LlmContext(provider="none", is_local=False)- )+ llm: LlmContext = field(default_factory=lambda: LlmContext(provider="none", is_local=False))# ---------------------------------------------------------------------------@@ -250,9 +246,7 @@ def _format_period_label(start: datetime, end: datetime) -> str:def _bucket_by_day(rows: list[CostRow]) -> list[CostBucket]:"""Group cost rows by UTC calendar date, ascending."""- buckets: dict[date, dict[str, float]] = defaultdict(- lambda: {"cost": 0.0, "tokens": 0, "calls": 0}- )+ buckets: dict[date, dict[str, float]] = defaultdict(lambda: {"cost": 0.0, "tokens": 0, "calls": 0})for r in rows:d = r.started_at.astimezone(UTC).date()b = buckets[d]@@ -291,9 +285,7 @@ def _model_breakdown(rows: list[CostRow]) -> list[ModelBreakdown]:agg["prompt"] += r.prompt_tokensagg["completion"] += r.completion_tokensagg["cost"] += r.cost_usd- agg["imputed"] += _impute_public_cost(- m, r.prompt_tokens, r.completion_tokens- )+ agg["imputed"] += _impute_public_cost(m, r.prompt_tokens, r.completion_tokens)agg["latency_ms"] += r.latency_msbreakdowns = [@@ -305,11 +297,7 @@ def _model_breakdown(rows: list[CostRow]) -> list[ModelBreakdown]:total_completion_tokens=int(agg["completion"]),total_cost_usd=round(agg["cost"], 4),imputed_public_cost_usd=round(agg["imputed"], 4),- avg_latency_ms=(- round(agg["latency_ms"] / agg["calls"], 2)- if agg["calls"]- else None- ),+ avg_latency_ms=(round(agg["latency_ms"] / agg["calls"], 2) if agg["calls"] else None),)for m, agg in by_model.items()]@@ -319,9 +307,7 @@ def _model_breakdown(rows: list[CostRow]) -> list[ModelBreakdown]:def _top_cases(rows: list[CostRow], *, limit: int = 10) -> list[TopCostCase]:"""The most expensive cases in the window."""- by_case: dict[str, dict[str, Any]] = defaultdict(- lambda: {"runs": set(), "cost": 0.0, "tokens": 0}- )+ by_case: dict[str, dict[str, Any]] = defaultdict(lambda: {"runs": set(), "cost": 0.0, "tokens": 0})for r in rows:if not r.case_id:continue@@ -346,10 +332,7 @@ def _top_cases(rows: list[CostRow], *, limit: int = 10) -> list[TopCostCase]:def _action_counts(rows: list[AuditRow], *, limit: int = 20) -> list[ActionCount]:"""How many of each action were recorded over the window."""counter: Counter[str] = Counter(r.action for r in rows if r.action)- return [- ActionCount(action=a, count=c)- for a, c in counter.most_common(limit)- ]+ return [ActionCount(action=a, count=c) for a, c in counter.most_common(limit)]def _byok_savings(rows: list[CostRow], llm: LlmContext) -> ByokSavings:@@ -368,10 +351,7 @@ def _byok_savings(rows: list[CostRow], llm: LlmContext) -> ByokSavings:UI can still surface a "you'd save X if you self-hosted" hint."""recorded = sum(r.cost_usd for r in rows)- imputed = sum(- _impute_public_cost(r.model, r.prompt_tokens, r.completion_tokens)- for r in rows- )+ imputed = sum(_impute_public_cost(r.model, r.prompt_tokens, r.completion_tokens) for r in rows)if llm.is_local:savings = imputedelse:@@ -395,9 +375,7 @@ def _headline(rows: list[CostRow]) -> CostHeadline:total_tokens=int(total_tokens),total_calls=int(total_calls),total_runs=total_runs,- avg_cost_per_run_usd=(- round(total_cost / total_runs, 4) if total_runs else None- ),+ avg_cost_per_run_usd=(round(total_cost / total_runs, 4) if total_runs else None),)diff --git a/services/api/app/services/detections/ocsf_mapping.py b/services/api/app/services/detections/ocsf_mapping.pyindex 47bae4215..65d6ae992 100644--- a/services/api/app/services/detections/ocsf_mapping.py+++ b/services/api/app/services/detections/ocsf_mapping.py@@ -26,7 +26,6 @@ from __future__ import annotationsfrom dataclasses import dataclassfrom typing import Final-# ─── Class / Category UIDs (mirrors packages/ocsf/src/types.ts) ──────────────diff --git a/services/api/app/services/detections/sigma_import.py b/services/api/app/services/detections/sigma_import.pyindex 43a4c717e..f53d16d2a 100644--- a/services/api/app/services/detections/sigma_import.py+++ b/services/api/app/services/detections/sigma_import.py@@ -301,14 +301,16 @@ _CATEGORY_ALIASES: dict[str, str] = {"exfiltration": "data-exfil",}-_NATIVE_CATEGORIES = frozenset({- "cloud",- "identity",- "endpoint",- "network",- "application",- "data-exfil",-})+_NATIVE_CATEGORIES = frozenset(+ {+ "cloud",+ "identity",+ "endpoint",+ "network",+ "application",+ "data-exfil",+ }+)def _category_for(logsource: dict[str, Any] | None) -> str:@@ -634,9 +636,7 @@ async def import_sigma_rules(upstream_id = str(raw.get("id") or "").strip()title = str(raw.get("title") or "").strip()if not upstream_id:- report.failures.append(- {"index": index, "reason": "missing rule id", "title": title or None}- )+ report.failures.append({"index": index, "reason": "missing rule id", "title": title or None})continueupstream_path = upstream_paths.get(upstream_id)diff --git a/services/api/app/services/digest_html.py b/services/api/app/services/digest_html.pyindex e7284db4d..456aa52f6 100644--- a/services/api/app/services/digest_html.py+++ b/services/api/app/services/digest_html.py@@ -30,7 +30,6 @@ from .executive_digest import (TopSourceHighlight,)-_SEVERITY_COLOURS: dict[str, str] = {"critical": "#b91c1c","high": "#c2410c",@@ -67,17 +66,13 @@ def _severity_chip(severity: str) -> str:colour = _SEVERITY_COLOURS.get(severity, "#475569")return (f'<span style="display:inline-block;padding:2px 8px;border-radius:9999px;'- f'background:{colour};color:#fff;font-size:11px;text-transform:uppercase;'+ f"background:{colour};color:#fff;font-size:11px;text-transform:uppercase;"f'letter-spacing:0.04em;">{_esc(severity)}</span>')def _kpi(label: str, value: str, *, hint: str | None = None) -> str:- hint_html = (- f'<div style="font-size:11px;color:#64748b;margin-top:2px;">{_esc(hint)}</div>'- if hint- else ""- )+ hint_html = f'<div style="font-size:11px;color:#64748b;margin-top:2px;">{_esc(hint)}</div>' if hint else ""return ('<div style="flex:1 1 140px;background:#f8fafc;border:1px solid #e2e8f0;''border-radius:8px;padding:12px 14px;min-width:140px;">'@@ -103,17 +98,12 @@ def _severity_table(split: SeveritySplit) -> str:f'<td style="padding:4px 8px;text-align:right;font-weight:600;">{count}</td></tr>'for label, count in rows)- return (- '<table style="width:100%;border-collapse:collapse;font-size:13px;">'- f"<tbody>{cells}</tbody></table>"- )+ return f'<table style="width:100%;border-collapse:collapse;font-size:13px;"><tbody>{cells}</tbody></table>'def _tactic_rows(tactics: list[TacticHighlight]) -> str:if not tactics:- return (- '<p style="color:#64748b;font-size:13px;">No MITRE-tagged alerts in this period.</p>'- )+ return '<p style="color:#64748b;font-size:13px;">No MITRE-tagged alerts in this period.</p>'body = "".join(f'<tr><td style="padding:6px 8px;">{_esc(t.tactic)}</td>'f'<td style="padding:6px 8px;text-align:right;font-weight:600;">{t.count}</td>'@@ -135,25 +125,18 @@ def _tactic_rows(tactics: list[TacticHighlight]) -> str:def _source_rows(sources: list[TopSourceHighlight]) -> str:if not sources:- return (- '<p style="color:#64748b;font-size:13px;">No connector activity in this period.</p>'- )+ return '<p style="color:#64748b;font-size:13px;">No connector activity in this period.</p>'body = "".join(f'<tr><td style="padding:6px 8px;">{_esc(s.connector_type)}</td>'f'<td style="padding:6px 8px;text-align:right;font-weight:600;">{s.count}</td></tr>'for s in sources)- return (- '<table style="width:100%;border-collapse:collapse;font-size:13px;">'- f"<tbody>{body}</tbody></table>"- )+ return f'<table style="width:100%;border-collapse:collapse;font-size:13px;"><tbody>{body}</tbody></table>'def _high_risk_table(items: list[HighRiskAlertHighlight]) -> str:if not items:- return (- '<p style="color:#64748b;font-size:13px;">No high-risk alerts surfaced this period.</p>'- )+ return '<p style="color:#64748b;font-size:13px;">No high-risk alerts surfaced this period.</p>'body = "".join("<tr>"f'<td style="padding:6px 8px;">{_severity_chip(a.severity)}</td>'@@ -198,7 +181,7 @@ def _recommendation_cards(recs: list[DigestRecommendation]) -> str:return ""cards = "".join('<div style="border-left:4px solid {colour};background:{bg};'- "padding:12px 14px;border-radius:6px;margin-bottom:10px;\">"+ 'padding:12px 14px;border-radius:6px;margin-bottom:10px;">''<div style="font-weight:600;color:#0f172a;font-size:14px;'f'margin-bottom:4px;">{_esc(r.title)}</div>'f'<div style="color:#334155;font-size:13px;line-height:1.45;">{_esc(r.body)}</div>'@@ -230,7 +213,8 @@ def render_digest_html(digest: ExecutiveDigest) -> str:}}h1, h2, h3 {{ color: #0f172a; margin-top: 0; }}h1 {{ font-size: 22px; margin-bottom: 4px; }}- h2 {{ font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: #475569; margin: 20px 0 10px; border-top: 1px solid #e2e8f0; padding-top: 14px; }}+ h2 {{ font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em;+ color: #475569; margin: 20px 0 10px; border-top: 1px solid #e2e8f0; padding-top: 14px; }}table th, table td {{ border-bottom: 1px solid #f1f5f9; }}@media print {{body {{ padding: 0; }}diff --git a/services/api/app/services/digest_pdf.py b/services/api/app/services/digest_pdf.pynew file mode 100644index 000000000..4276875fa--- /dev/null+++ b/services/api/app/services/digest_pdf.py@@ -0,0 +1,74 @@+"""WS-G2 — Server-side PDF generation for the Executive Weekly Digest.++Uses WeasyPrint to convert the print-ready HTML produced by+``digest_html.render_digest_html`` into a PDF byte stream.++WeasyPrint requires native libs (Pango, Cairo, GLib) that are installed in the+Docker image via ``apt-get``. When those libs are absent (e.g. CI or a macOS+dev machine without the native stack) we fall back gracefully so that+non-PDF code paths remain functional.++Author: Beenu <[email protected]>+"""++from __future__ import annotations++import logging++from app.services.digest_html import render_digest_html+from app.services.executive_digest import ExecutiveDigest++logger = logging.getLogger(__name__)++__all__ = ["render_digest_pdf", "WeasyPrintUnavailableError"]+++class WeasyPrintUnavailableError(RuntimeError):+ """Raised when the WeasyPrint native stack is not installed."""+++def render_digest_pdf(digest: ExecutiveDigest) -> bytes:+ """Render *digest* as a PDF byte string.++ Converts the ``ExecutiveDigest`` model to a self-contained, print-ready+ HTML page (via :func:`render_digest_html`) and then runs it through+ WeasyPrint to produce a PDF.++ Parameters+ ----------+ digest:+ The populated executive digest model.++ Returns+ -------+ bytes+ Raw PDF bytes ready to be streamed as ``application/pdf``.++ Raises+ ------+ WeasyPrintUnavailableError+ When WeasyPrint (or its native dependencies) is not installed.+ """+ try:+ from weasyprint import HTML # type: ignore[import-untyped]+ except (ImportError, OSError) as exc:+ raise WeasyPrintUnavailableError(+ "WeasyPrint is not available in this environment. "+ "Install it via `poetry add weasyprint` and ensure Pango/Cairo "+ "system libs are present. See services/api/Dockerfile for the "+ "required apt packages."+ ) from exc++ html_content = render_digest_html(digest)+ logger.info(+ "rendering executive digest PDF tenant_id=%s period_start=%s",+ digest.tenant_id,+ str(digest.period.start),+ )+ pdf_bytes: bytes = HTML(string=html_content).write_pdf()+ logger.info(+ "executive digest PDF rendered tenant_id=%s size_bytes=%d",+ digest.tenant_id,+ len(pdf_bytes),+ )+ return pdf_bytesdiff --git a/services/api/app/services/easm_discovery.py b/services/api/app/services/easm_discovery.pyindex 9243ffb1f..6ca152a53 100644--- a/services/api/app/services/easm_discovery.py+++ b/services/api/app/services/easm_discovery.py@@ -15,8 +15,9 @@ from __future__ import annotationsimport asyncioimport loggingimport socket+from collections.abc import Sequencefrom dataclasses import dataclass, field-from typing import Any, Sequence+from typing import Anyimport httpx@@ -64,17 +65,21 @@ async def _shodan_search(query: str, api_key: str) -> list[DiscoveredAsset]:}if ports:meta["ports"] = [ports]- results.append(DiscoveredAsset(- asset_type=ExternalAssetType.IP,- value=ip,- metadata=meta,- ))+ results.append(+ DiscoveredAsset(+ asset_type=ExternalAssetType.IP,+ value=ip,+ metadata=meta,+ )+ )for hostname in match.get("hostnames", []):- results.append(DiscoveredAsset(- asset_type=ExternalAssetType.SUBDOMAIN,- value=hostname,- metadata={"source": "shodan", "resolved_ip": ip},- ))+ results.append(+ DiscoveredAsset(+ asset_type=ExternalAssetType.SUBDOMAIN,+ value=hostname,+ metadata={"source": "shodan", "resolved_ip": ip},+ )+ )logger.info("Shodan returned %d assets for query=%s", len(results), query)return results@@ -108,17 +113,21 @@ async def _censys_search(query: str, api_id: str, api_secret: str) -> list[Disco"ports": ports,"services_count": len(services),}- results.append(DiscoveredAsset(- asset_type=ExternalAssetType.IP,- value=ip,- metadata=meta,- ))+ results.append(+ DiscoveredAsset(+ asset_type=ExternalAssetType.IP,+ value=ip,+ metadata=meta,+ )+ )for name in hit.get("dns", {}).get("names", []):- results.append(DiscoveredAsset(- asset_type=ExternalAssetType.SUBDOMAIN,- value=name,- metadata={"source": "censys", "resolved_ip": ip},- ))+ results.append(+ DiscoveredAsset(+ asset_type=ExternalAssetType.SUBDOMAIN,+ value=name,+ metadata={"source": "censys", "resolved_ip": ip},+ )+ )logger.info("Censys returned %d assets for query=%s", len(results), query)return results@@ -135,7 +144,7 @@ async def _probe_port(host: str, port: int, timeout: float = 3.0) -> bool:timeout=timeout,)return True- except (OSError, asyncio.TimeoutError):+ except (TimeoutError, OSError):return Falsefinally:sock.close()@@ -151,16 +160,18 @@ async def _active_scan(targets: Sequence[str], ports: Sequence[int]) -> list[Disoutcomes = await asyncio.gather(*(t[2] for t in tasks), return_exceptions=True)host_ports: dict[str, list[int]] = {}- for (target, port, _), outcome in zip(tasks, outcomes):+ for (target, port, _), outcome in zip(tasks, outcomes, strict=False):if outcome is True:host_ports.setdefault(target, []).append(port)for host, open_ports in host_ports.items():- results.append(DiscoveredAsset(- asset_type=ExternalAssetType.IP,- value=host,- metadata={"source": "active_scan", "ports": sorted(open_ports)},- ))+ results.append(+ DiscoveredAsset(+ asset_type=ExternalAssetType.IP,+ value=host,+ metadata={"source": "active_scan", "ports": sorted(open_ports)},+ )+ )logger.info("Active scan found %d hosts with open ports", len(results))return resultsdiff --git a/services/api/app/services/easm_drift.py b/services/api/app/services/easm_drift.pyindex 4a779ae6d..625c8180f 100644--- a/services/api/app/services/easm_drift.py+++ b/services/api/app/services/easm_drift.py@@ -13,8 +13,9 @@ snapshot for a tenant and emits ``ExternalAssetDrift`` records for:from __future__ import annotationsimport logging-from datetime import datetime, timezone-from typing import Any, Sequence+from collections.abc import Sequence+from datetime import UTC, datetime+from typing import Anyfrom uuid import UUIDfrom sqlalchemy import select@@ -99,7 +100,7 @@ async def detect_drift(Upsert discovered assets and emit drift records for changes.Returns the list of newly created ``ExternalAssetDrift`` rows."""- now = datetime.now(timezone.utc)+ now = datetime.now(UTC)drift_records: list[ExternalAssetDrift] = []for asset in discovered:@@ -143,6 +144,8 @@ async def detect_drift(await db.flush()logger.info("EASM drift: %d new drift records for tenant %s from %d discovered assets",- len(drift_records), tenant_id, len(discovered),+ len(drift_records),+ tenant_id,+ len(discovered),)return drift_recordsdiff --git a/services/api/app/services/executive_digest.py b/services/api/app/services/executive_digest.pyindex 83daadf7e..297860579 100644--- a/services/api/app/services/executive_digest.py+++ b/services/api/app/services/executive_digest.py@@ -40,7 +40,6 @@ from app.models.alert import Alertfrom app.models.case import Casefrom app.models.remediation import RemediationGateLog-# ---------------------------------------------------------------------------# Output schemas (Pydantic) — what the endpoint actually returns.# ---------------------------------------------------------------------------@@ -273,10 +272,7 @@ def _top_sources(rows: list[AlertRow], *, limit: int = 5) -> list[TopSourceHighlfor r in rows:if r.connector_type:counter[r.connector_type] += 1- return [- TopSourceHighlight(connector_type=ct, count=cnt)- for ct, cnt in counter.most_common(limit)- ]+ return [TopSourceHighlight(connector_type=ct, count=cnt) for ct, cnt in counter.most_common(limit)]def _high_risk_alerts(rows: list[AlertRow], *, limit: int = 5) -> list[HighRiskAlertHighlight]:@@ -286,7 +282,7 @@ def _high_risk_alerts(rows: list[AlertRow], *, limit: int = 5) -> list[HighRiskA"""severity_rank = {"critical": 0, "high": 1, "medium": 2, "low": 3, "info": 4}- def sort_key(r: AlertRow) -> tuple[int, float, datetime]:+ def sort_key(r: AlertRow) -> tuple[int, float, float]:sev = severity_rank.get(r.severity, 5)# Higher AI score = more interesting; flip the sign so it sorts ascending.score = -1.0 * (r.ai_score if r.ai_score is not None else 0.0)@@ -320,11 +316,7 @@ def _automation_summary(gate_log: list[GateLogRow]) -> AutomationSummary:def _case_summary(rows: list[CaseRow], open_at_end: int, period_start: datetime, period_end: datetime) -> CaseSummary:opened = sum(1 for r in rows if period_start <= r.created_at < period_end)- closed = sum(- 1- for r in rows- if r.closed_at is not None and period_start <= r.closed_at < period_end- )+ closed = sum(1 for r in rows if r.closed_at is not None and period_start <= r.closed_at < period_end)breached = sum(1 for r in rows if r.sla_breached)return CaseSummary(opened=opened,@@ -341,11 +333,7 @@ def _alert_summary(period_end: datetime,) -> AlertSummary:new = sum(1 for r in rows if period_start <= r.created_at < period_end)- resolved = sum(- 1- for r in rows- if r.resolved_at is not None and period_start <= r.resolved_at < period_end- )+ resolved = sum(1 for r in rows if r.resolved_at is not None and period_start <= r.resolved_at < period_end)return AlertSummary(total=len(rows),new=new,@@ -400,10 +388,7 @@ def _build_recommendations(DigestRecommendation(severity="warning",title=f"{cases.sla_breached} SLA breach{'es' if cases.sla_breached != 1 else ''}",- body=(- "One or more cases breached their SLA. Check assignment, escalation "- "paths, and on-call coverage."- ),+ body=("One or more cases breached their SLA. Check assignment, escalation paths, and on-call coverage."),))diff --git a/services/api/app/services/github.py b/services/api/app/services/github.pynew file mode 100644index 000000000..7c87a6b73--- /dev/null+++ b/services/api/app/services/github.py@@ -0,0 +1,273 @@+"""+AiSOC WS-B4: Detection-as-Code git PR path — GitHub integration service.+Author: Beenu - [email protected]++Creates a GitHub Pull Request that commits a detection rule file into the+configured repository branch when a detection proposal is promoted.++All public entry-points are async and return ``None`` gracefully when GitHub+credentials are not configured, so callers can always await them without+guarding for missing config.+"""++from __future__ import annotations++import base64+import logging+import re+from typing import Any++import httpx++from app.core.config import Settings++logger = logging.getLogger(__name__)++_GITHUB_API = "https://api.github.com"+_DETECTION_LANGUAGE_EXT: dict[str, str] = {+ "sigma": "yml",+ "yara": "yar",+ "suricata": "rules",+ "kql": "kql",+ "spl": "spl",+ "lucene": "json",+}+++def _slug(name: str) -> str:+ """Convert a human-readable rule name to a safe filename slug."""+ slug = name.lower().strip()+ slug = re.sub(r"[^a-z0-9]+", "_", slug)+ slug = slug.strip("_")+ return slug or "detection_rule"+++def _ext(language: str) -> str:+ return _DETECTION_LANGUAGE_EXT.get(language.lower(), "txt")+++def _is_configured(settings: Settings) -> bool:+ return bool(settings.AISOC_GITHUB_TOKEN and settings.AISOC_GITHUB_REPO and settings.AISOC_GITHUB_DETECTIONS_PATH)+++async def create_detection_pr(+ *,+ settings: Settings,+ proposal_id: str,+ rule_name: str,+ rule_language: str,+ rule_body: str,+ category: str,+) -> str | None:+ """+ Commit a detection rule file to a new branch and open a Pull Request.++ Parameters+ ----------+ settings: Application settings (reads AISOC_GITHUB_* vars).+ proposal_id: UUID string of the promoted ``DetectionRuleProposal``.+ rule_name: Human-readable name used for the filename and PR title.+ rule_language: Detection language (sigma, yara, …).+ rule_body: Raw rule content to commit.+ category: Rule category used as a subdirectory within the detections+ path (e.g. "endpoint", "network").++ Returns+ -------+ str | None+ The HTTPS URL of the newly created Pull Request, or ``None`` if GitHub+ integration is not configured or the API call fails.+ """+ if not _is_configured(settings):+ logger.debug("GitHub integration not configured — skipping PR creation.")+ return None++ token = settings.AISOC_GITHUB_TOKEN+ repo = settings.AISOC_GITHUB_REPO+ base_path = settings.AISOC_GITHUB_DETECTIONS_PATH.rstrip("/")+ slug = _slug(rule_name)+ ext = _ext(rule_language)+ short_id = proposal_id[:8]++ branch_name = f"detection/{slug}-{short_id}"+ file_path = f"{base_path}/{category}/{slug}.{ext}"+ commit_message = f"feat(detection): add {rule_name} [{short_id}]"+ pr_title = f"Detection: {rule_name}"+ pr_body = (+ f"**Proposal ID:** `{proposal_id}`\n\n"+ f"**Language:** {rule_language}\n"+ f"**Category:** {category}\n\n"+ f"This PR was auto-generated by AiSOC when proposal `{proposal_id}` "+ f"was promoted through the in-app Detection-as-Code editor. "+ f"Review the rule, run the eval harness, and merge when satisfied.\n\n"+ f"<!-- aisoc:proposal:{proposal_id} -->"+ )++ headers = {+ "Authorization": f"Bearer {token}",+ "Accept": "application/vnd.github+json",+ "X-GitHub-Api-Version": "2022-11-28",+ }++ async with httpx.AsyncClient(base_url=_GITHUB_API, timeout=30.0) as client:+ # 1. Resolve the default branch SHA.+ default_branch, base_sha = await _get_default_branch_and_sha(client, headers, repo)+ if not base_sha:+ return None++ # 2. Create branch from base SHA.+ created = await _create_branch(client, headers, repo, branch_name, base_sha)+ if not created:+ return None++ # 3. Commit the rule file.+ committed = await _commit_file(+ client,+ headers,+ repo,+ branch_name,+ file_path,+ rule_body,+ commit_message,+ )+ if not committed:+ return None++ # 4. Open the PR.+ pr_url = await _open_pr(+ client,+ headers,+ repo,+ pr_title,+ pr_body,+ branch_name,+ default_branch,+ )+ return pr_url+++# ---------------------------------------------------------------------------+# Private helpers+# ---------------------------------------------------------------------------+++async def _get_default_branch_and_sha(+ client: httpx.AsyncClient,+ headers: dict[str, str],+ repo: str,+) -> tuple[str, str | None]:+ try:+ resp = await client.get(f"/repos/{repo}", headers=headers)+ resp.raise_for_status()+ data: dict[str, Any] = resp.json()+ default_branch: str = data.get("default_branch", "main")++ ref_resp = await client.get(f"/repos/{repo}/git/ref/heads/{default_branch}", headers=headers)+ ref_resp.raise_for_status()+ sha: str = ref_resp.json()["object"]["sha"]+ return default_branch, sha+ except Exception as exc:+ logger.warning("GitHub: failed to resolve default branch SHA — %s", exc)+ return "main", None+++async def _create_branch(+ client: httpx.AsyncClient,+ headers: dict[str, str],+ repo: str,+ branch_name: str,+ sha: str,+) -> bool:+ try:+ resp = await client.post(+ f"/repos/{repo}/git/refs",+ headers=headers,+ json={"ref": f"refs/heads/{branch_name}", "sha": sha},+ )+ if resp.status_code == 422:+ # Branch already exists — safe to continue.+ return True+ resp.raise_for_status()+ return True+ except Exception as exc:+ logger.warning("GitHub: failed to create branch '%s' — %s", branch_name, exc)+ return False+++async def _commit_file(+ client: httpx.AsyncClient,+ headers: dict[str, str],+ repo: str,+ branch_name: str,+ file_path: str,+ content: str,+ message: str,+) -> bool:+ encoded = base64.b64encode(content.encode()).decode()+ payload: dict[str, Any] = {+ "message": message,+ "content": encoded,+ "branch": branch_name,+ }++ # Fetch existing file SHA if it exists (so GitHub accepts an update).+ try:+ existing = await client.get(+ f"/repos/{repo}/contents/{file_path}",+ headers=headers,+ params={"ref": branch_name},+ )+ if existing.status_code == 200:+ payload["sha"] = existing.json().get("sha")+ except Exception:+ pass++ try:+ resp = await client.put(+ f"/repos/{repo}/contents/{file_path}",+ headers=headers,+ json=payload,+ )+ resp.raise_for_status()+ return True+ except Exception as exc:+ logger.warning("GitHub: failed to commit file '%s' — %s", file_path, exc)+ return False+++async def _open_pr(+ client: httpx.AsyncClient,+ headers: dict[str, str],+ repo: str,+ title: str,+ body: str,+ head: str,+ base: str,+) -> str | None:+ try:+ resp = await client.post(+ f"/repos/{repo}/pulls",+ headers=headers,+ json={+ "title": title,+ "body": body,+ "head": head,+ "base": base,+ "draft": True,+ },+ )+ if resp.status_code == 422:+ # PR already exists for this branch — try to find it.+ search = await client.get(+ f"/repos/{repo}/pulls",+ headers=headers,+ params={"head": f"{repo.split('/')[0]}:{head}", "state": "open"},+ )+ if search.status_code == 200 and search.json():+ return search.json()[0]["html_url"]+ return None+ resp.raise_for_status()+ return resp.json()["html_url"]+ except Exception as exc:+ logger.warning("GitHub: failed to open PR for branch '%s' — %s", head, exc)+ return Nonediff --git a/services/api/app/services/lake_rate_limit.py b/services/api/app/services/lake_rate_limit.pyindex 516bd1c64..cf0dafdf8 100644--- a/services/api/app/services/lake_rate_limit.py+++ b/services/api/app/services/lake_rate_limit.py@@ -206,10 +206,7 @@ class LakeRateLimiter:# condition. Surfacing it as a denial would loop forever# because no amount of waiting could refill enough; it's# better to fail loudly here.- raise ValueError(- f"cost {cost} exceeds bucket capacity {self._capacity}; "- "this would never succeed"- )+ raise ValueError(f"cost {cost} exceeds bucket capacity {self._capacity}; this would never succeed")key = str(tenant_id)bucket = await self._get_bucket(key)diff --git a/services/api/app/services/lake_sql.py b/services/api/app/services/lake_sql.pyindex d575930b2..8ec9d738c 100644--- a/services/api/app/services/lake_sql.py+++ b/services/api/app/services/lake_sql.py@@ -45,7 +45,6 @@ from typing import Finalimport sqlglotfrom sqlglot import exp-# ----------------------------------------------------------- public surface@@ -169,20 +168,14 @@ def rewrite_for_tenant(# attack — a caller sending ``SELECT 1; DROP TABLE x;`` is rejected# even though the first statement on its own would have been fine.try:- statements = [- stmt- for stmt in sqlglot.parse(sql, read="clickhouse")- if stmt is not None- ]+ statements = [stmt for stmt in sqlglot.parse(sql, read="clickhouse") if stmt is not None]except sqlglot.errors.ParseError as exc:raise LakeSqlSyntaxError(f"unable to parse SQL: {exc}") from excif not statements:raise LakeSqlSyntaxError("empty SQL statement")if len(statements) > 1:- raise LakeSqlForbiddenError(- "only a single statement is allowed per request"- )+ raise LakeSqlForbiddenError("only a single statement is allowed per request")tree = statements[0]@@ -194,15 +187,10 @@ def rewrite_for_tenant(# Forbidden DML/DDL → 403. Parser-level garbage (NOT, IS, expressions,# bare identifiers) → 400. Selects, Unions, and CTEs → continue.if isinstance(root, _FORBIDDEN_ROOTS):- raise LakeSqlForbiddenError(- f"only SELECT statements are allowed (got {type(root).__name__.upper()})"- )+ raise LakeSqlForbiddenError(f"only SELECT statements are allowed (got {type(root).__name__.upper()})")if not isinstance(root, (exp.Select, exp.Union, exp.With)):- raise LakeSqlSyntaxError(- "expected a SELECT / WITH / UNION statement; got "- f"{type(root).__name__}"- )+ raise LakeSqlSyntaxError(f"expected a SELECT / WITH / UNION statement; got {type(root).__name__}")# ── Step 3: collect CTE aliases ──────────────────────────────────# CTE names are *aliases*, not real tables, so a reference like@@ -226,14 +214,10 @@ def rewrite_for_tenant(# expression.for select in selects:if not select.expressions:- raise LakeSqlSyntaxError(- "SELECT clause has no projection expressions"- )+ raise LakeSqlSyntaxError("SELECT clause has no projection expressions")for select in selects:- _validate_and_rewrite_select(- select, tenant_id, cte_aliases, referenced- )+ _validate_and_rewrite_select(select, tenant_id, cte_aliases, referenced)# ── Step 5: clamp the outer LIMIT ────────────────────────────────_clamp_outer_limit(root, effective_cap)@@ -288,16 +272,12 @@ def _validate_and_rewrite_select(# subtree) or as Tables whose backing ``this`` is an Anonymous# function call.if _is_table_function(table):- raise LakeSqlForbiddenError(- "ClickHouse table functions are not allowed in lake queries"- )+ raise LakeSqlForbiddenError("ClickHouse table functions are not allowed in lake queries")bare_name = table.nameif not bare_name:# Non-function table without a name — degenerate; reject.- raise LakeSqlForbiddenError(- "unrecognised table reference in FROM/JOIN"- )+ raise LakeSqlForbiddenError("unrecognised table reference in FROM/JOIN")# CTE references: allowed, but skipped (no allowlist check, no# predicate injection — the CTE body already has its own SELECT@@ -307,9 +287,7 @@ def _validate_and_rewrite_select(full = _qualified_name(table)if full not in ALLOWED_TABLES:- raise LakeSqlForbiddenError(- f"table '{full}' is not in the lake allowlist"- )+ raise LakeSqlForbiddenError(f"table '{full}' is not in the lake allowlist")# Backfill the schema on unqualified references so the rewritten# SQL is unambiguous regardless of the ClickHouse sessiondiff --git a/services/api/app/services/mssp_rule_resolver.py b/services/api/app/services/mssp_rule_resolver.pyindex 5948f5a34..29e1d2953 100644--- a/services/api/app/services/mssp_rule_resolver.py+++ b/services/api/app/services/mssp_rule_resolver.py@@ -36,7 +36,6 @@ from app.models.mssp import (MSSPRulePackRule,)-# ---------------------------------------------------------------------------# Public dataclass# ---------------------------------------------------------------------------@@ -167,9 +166,7 @@ async def resolve_effective_rules(assignments = (await db.execute(assignments_q)).scalars().all()if assignments:- pack_id_to_overrides: dict[uuid.UUID, dict[str, Any]] = {- a.pack_id: dict(a.parameter_overrides or {}) for a in assignments- }+ pack_id_to_overrides: dict[uuid.UUID, dict[str, Any]] = {a.pack_id: dict(a.parameter_overrides or {}) for a in assignments}pack_rule_filters: list[Any] = [MSSPRulePackRule.pack_id.in_(list(pack_id_to_overrides.keys())),diff --git a/services/api/app/services/override_learning.py b/services/api/app/services/override_learning.pyindex d0c528da0..2042a1e65 100644--- a/services/api/app/services/override_learning.py+++ b/services/api/app/services/override_learning.py@@ -45,7 +45,7 @@ class AlertSignature:primary_technique: str@classmethod- def from_alert(cls, alert: Alert) -> "AlertSignature":+ def from_alert(cls, alert: Alert) -> AlertSignature:techniques = list(alert.mitre_techniques or [])primary = str(techniques[0]) if techniques else ""return cls(@@ -187,12 +187,7 @@ async def find_redisposition_candidates(if signature.connector_type:conditions.append(Alert.connector_type == signature.connector_type)- query = (- select(Alert)- .where(and_(*conditions))- .order_by(Alert.event_time.desc())- .limit(limit * 4)- )+ query = select(Alert).where(and_(*conditions)).order_by(Alert.event_time.desc()).limit(limit * 4)rows = list((await db.scalars(query)).all())candidates: list[RedispositionCandidate] = []@@ -230,9 +225,7 @@ async def apply_redisposition(return 0now = datetime.now(UTC)result = await db.execute(- update(Alert)- .where(Alert.tenant_id == tenant_id, Alert.id.in_(alert_ids))- .values(disposition=new_disposition, updated_at=now)+ update(Alert).where(Alert.tenant_id == tenant_id, Alert.id.in_(alert_ids)).values(disposition=new_disposition, updated_at=now))await db.commit()rowcount = result.rowcount or 0diff --git a/services/api/app/services/rule_engine.py b/services/api/app/services/rule_engine.pyindex 0e6c4a6ec..5495d8cc3 100644--- a/services/api/app/services/rule_engine.py+++ b/services/api/app/services/rule_engine.py@@ -88,7 +88,7 @@ def _run_sigma(rule_body: str, events: list[dict[str, Any]]) -> tuple[list[dict]# pySigma not available – use simple YAML condition evaluatorreturn _sigma_fallback(rule_body, events), Noneexcept Exception as exc:- logger.warning("Sigma parse error", error=str(exc))+ logger.warning("Sigma parse error: %s", exc)return _sigma_fallback(rule_body, events), str(exc)@@ -110,7 +110,7 @@ def _sigma_fallback(rule_body: str, events: list[dict[str, Any]]) -> list[dict[smatched.append(event)return matchedexcept Exception as exc:- logger.debug("Sigma fallback evaluator error", error=str(exc))+ logger.debug("Sigma fallback evaluator error: %s", exc)return []@@ -185,7 +185,7 @@ def _run_yara(rule_body: str, events: list[dict[str, Any]]) -> tuple[list[dict],except ImportError:return [], "yara-python not installed"except Exception as exc:- logger.warning("YARA execution error", error=str(exc))+ logger.warning("YARA execution error: %s", exc)return [], str(exc)diff --git a/services/api/app/workers/oauth_refresh.py b/services/api/app/workers/oauth_refresh.pyindex 15079dd17..d64bc1e49 100644--- a/services/api/app/workers/oauth_refresh.py+++ b/services/api/app/workers/oauth_refresh.py@@ -92,9 +92,7 @@ class _CatalogResolver:return {}-def _resolve_token_url(- app_credential: OAuthAppCredential, hints: Mapping[str, Any]-) -> str | None:+def _resolve_token_url(app_credential: OAuthAppCredential, hints: Mapping[str, Any]) -> str | None:"""Mirror of :func:`oauth._resolve_token_url` for non-HTTP context.Returns ``None`` instead of raising — the worker logs and skips so@@ -126,9 +124,7 @@ def _parse_expires_at(value: Any) -> datetime | None:return parsed-async def _select_due_connectors(- db: AsyncSession, *, lead_time_s: int-) -> list[Connector]:+async def _select_due_connectors(db: AsyncSession, *, lead_time_s: int) -> list[Connector]:"""Find every OAuth-provisioned connector that needs a refresh."Due" means one of:@@ -147,11 +143,7 @@ async def _select_due_connectors(# can't push expires_at filtering into the DB. We pull all# OAuth-provisioned rows and filter in Python — the working set is# tiny (one row per tenant connector instance).- stmt = (- select(Connector)- .where(Connector.oauth_provisioned.is_(True))- .where(Connector.is_enabled.is_(True))- )+ stmt = select(Connector).where(Connector.oauth_provisioned.is_(True)).where(Connector.is_enabled.is_(True))result = await db.execute(stmt)candidates: list[Connector] = list(result.scalars().all())@@ -236,9 +228,7 @@ async def _refresh_one(OAuthAppCredential.tenant_id == tenant_id,OAuthAppCredential.connector_type == connector_type,)- app_credential: OAuthAppCredential | None = (- await db.execute(app_stmt)- ).scalar_one_or_none()+ app_credential: OAuthAppCredential | None = (await db.execute(app_stmt)).scalar_one_or_none()if app_credential is None:logger.warning("oauth_refresh.app_credential_missing connector_id=%s tenant=%s connector_type=%s",@@ -387,9 +377,7 @@ async def _refresh_one(expires_in = token_payload.get("expires_in")if isinstance(expires_in, (int, float)) and expires_in > 0:- auth_payload["expires_at"] = (- datetime.now(UTC) + timedelta(seconds=int(expires_in))- ).isoformat()+ auth_payload["expires_at"] = (datetime.now(UTC) + timedelta(seconds=int(expires_in))).isoformat()else:# Provider didn't tell us — drop the stale value so we refresh# again on the very next tick rather than running on a token of@@ -403,11 +391,7 @@ async def _refresh_one(# if we were the ones who flipped it to ``unhealthy`` — leave other# health states (e.g. "degraded" from the connectors scheduler)# alone. The connectors poll will reconcile on the next tick.- new_status = (- "healthy"- if connector.health_status == _HEALTH_UNHEALTHY- else connector.health_status- )+ new_status = "healthy" if connector.health_status == _HEALTH_UNHEALTHY else connector.health_statusawait db.execute(update(Connector).where(Connector.id == connector.id)@@ -452,8 +436,7 @@ async def _record_failure(if new_count >= alarm_threshold:values["health_status"] = _HEALTH_UNHEALTHYlogger.error(- "oauth_refresh.alarm connector_id=%s tenant=%s connector_type=%s "- "failures=%d reason=%s — flipping health_status=unhealthy",+ "oauth_refresh.alarm connector_id=%s tenant=%s connector_type=%s failures=%d reason=%s — flipping health_status=unhealthy",connector.id,connector.tenant_id,connector.connector_type,@@ -461,9 +444,7 @@ async def _record_failure(reason,)- await db.execute(- update(Connector).where(Connector.id == connector.id).values(**values)- )+ await db.execute(update(Connector).where(Connector.id == connector.id).values(**values))await db.commit()@@ -475,9 +456,7 @@ async def run_once() -> dict[str, int]:"""stats = {"checked": 0, "refreshed": 0, "failed": 0}async with AsyncSessionLocal() as db:- due = await _select_due_connectors(- db, lead_time_s=settings.OAUTH_REFRESH_LEAD_TIME_SECONDS- )+ due = await _select_due_connectors(db, lead_time_s=settings.OAUTH_REFRESH_LEAD_TIME_SECONDS)stats["checked"] = len(due)for conn in due:ok = await _refresh_one(@@ -525,15 +504,13 @@ async def run_forever(*, stop_event: asyncio.Event | None = None) -> None:# Never let a transient failure kill the loop — the# whole point of this worker is durability. The next# tick gets a fresh DB session.- logger.exception(- "oauth_refresh.tick_failed err=%s", type(exc).__name__- )+ logger.exception("oauth_refresh.tick_failed err=%s", type(exc).__name__)try:if stop_event is not None:await asyncio.wait_for(stop_event.wait(), timeout=interval)else:await asyncio.sleep(interval)- except asyncio.TimeoutError:+ except TimeoutError:continueexcept asyncio.CancelledError:logger.info("oauth_refresh.cancelled — shutting down cleanly")diff --git a/services/api/app/workers/weekly_digest_task.py b/services/api/app/workers/weekly_digest_task.pynew file mode 100644index 000000000..4afab560d--- /dev/null+++ b/services/api/app/workers/weekly_digest_task.py@@ -0,0 +1,282 @@+"""WS-G2 — Weekly executive digest auto-generation worker.++Runs as a single ``asyncio.Task`` started from the API's ``lifespan`` hook+(see ``app/main.py``). Every Monday at 00:05 UTC the worker:++1. Fetches all *active* tenants.+2. Calls :func:`build_weekly_digest` to assemble the ``ExecutiveDigest`` for+ the previous ISO week (Mon 00:00 → Sun 23:59 UTC).+3. Renders the digest to PDF bytes via :func:`render_digest_pdf` when+ WeasyPrint is available, otherwise falls back to storing the HTML body.+4. Persists a :class:`ReportArtefact` row (``report_type="weekly_digest"``,+ ``output_format="pdf"|"html"``) with the base-64–encoded payload in+ ``body_b64`` and a human-readable ``storage_key``.++Failure model+-------------+* A failure for one tenant is caught, logged, and does **not** abort the+ remaining tenants — resilience over atomicity for background work.+* The outer loop retries after ``WEEKLY_DIGEST_POLL_INTERVAL_SECONDS``+ (default: 3 600 s / 1 hour) so a transient DB hiccup self-heals without+ operator intervention.+* Cancellation (ASGI shutdown) propagates cleanly through ``CancelledError``.++Configuration+-------------+``WEEKLY_DIGEST_WORKER_ENABLED``+ Set to ``false`` to disable (e.g. in unit-test environments).+``WEEKLY_DIGEST_POLL_INTERVAL_SECONDS``+ How often (seconds) the worker checks whether a digest is due. Defaults+ to ``3600`` (1 hour). The worker only *generates* when the current UTC+ weekday is Monday and the hour is ``00``.++Author: Beenu <[email protected]>+"""++from __future__ import annotations++import asyncio+import base64+import logging+import uuid+from datetime import UTC, date, datetime, timedelta++from sqlalchemy import select+from sqlalchemy.ext.asyncio import AsyncSession++from app.db.database import AsyncSessionLocal+from app.models.report import ReportArtefact+from app.models.tenant import Tenant+from app.services.digest_pdf import WeasyPrintUnavailableError, render_digest_pdf+from app.services.executive_digest import build_weekly_digest++logger = logging.getLogger(__name__)++__all__ = ["run_once", "run_forever"]++# Weekday index for Monday in Python's datetime (0 = Monday).+_MONDAY = 0+# UTC hour at which we trigger generation (00:05 → hour == 0).+_TRIGGER_HOUR = 0+++# ---------------------------------------------------------------------------+# Internal helpers+# ---------------------------------------------------------------------------+++def _week_window(ref: date) -> tuple[datetime, datetime]:+ """Return the (period_start, period_end) for the ISO week ending on *ref*.++ *ref* is expected to be the current Monday. We generate for the+ **previous** completed week: Monday-7d → the Monday just passed.++ Returns+ -------+ tuple[datetime, datetime]+ ``(prev_monday_00:00, prev_sunday_23:59:59)`` — both UTC-aware.+ """+ prev_monday = ref - timedelta(days=7)+ period_start = datetime(prev_monday.year, prev_monday.month, prev_monday.day, tzinfo=UTC)+ # End is Sunday 23:59:59 of the prev week, which is one microsecond+ # before the current Monday 00:00.+ period_end = datetime(ref.year, ref.month, ref.day, tzinfo=UTC) - timedelta(microseconds=1)+ return period_start, period_end+++async def _fetch_active_tenants(db: AsyncSession) -> list[Tenant]:+ """Return all tenants with ``is_active=True``."""+ result = await db.execute(select(Tenant).where(Tenant.is_active.is_(True)))+ return list(result.scalars().all())+++async def _artefact_exists(+ db: AsyncSession,+ tenant_id: uuid.UUID,+ period_start: datetime,+) -> bool:+ """Return True if a weekly digest artefact already exists for this window.++ Prevents duplicate generation when the worker restarts within the same+ trigger window (e.g. after an API process restart on Monday morning).+ """+ result = await db.execute(+ select(ReportArtefact.id).where(+ ReportArtefact.tenant_id == tenant_id,+ ReportArtefact.report_type == "weekly_digest",+ ReportArtefact.period_start == period_start,+ )+ )+ return result.scalar_one_or_none() is not None+++async def _generate_for_tenant(+ tenant_id: uuid.UUID,+ period_start: datetime,+ period_end: datetime,+) -> None:+ """Build, render, and persist one weekly digest artefact for *tenant_id*.++ Uses its own ``AsyncSession`` so that a failure here does not poison the+ caller's session.+ """+ async with AsyncSessionLocal() as db:+ if await _artefact_exists(db, tenant_id, period_start):+ logger.info(+ "weekly_digest.skip tenant_id=%s period_start=%s — artefact already exists",+ tenant_id,+ period_start.date(),+ )+ return++ digest = await build_weekly_digest(+ db,+ tenant_id,+ period_start=period_start,+ period_end=period_end,+ )++ output_format = "pdf"+ try:+ raw_bytes = render_digest_pdf(digest)+ except WeasyPrintUnavailableError:+ # Fall back to HTML when the native WeasyPrint stack is absent+ # (e.g. dev containers without Pango/Cairo). The artefact is+ # still persisted so the digest is not silently lost.+ logger.warning(+ "weekly_digest.weasyprint_unavailable — storing HTML fallback tenant_id=%s",+ tenant_id,+ )+ from app.services.digest_html import render_digest_html # lazy import++ raw_bytes = render_digest_html(digest).encode("utf-8")+ output_format = "html"++ body_b64 = base64.b64encode(raw_bytes).decode("ascii")+ storage_key = f"weekly_digest/{tenant_id}/{period_start.strftime('%Y-%m-%d')}_{period_end.strftime('%Y-%m-%d')}.{output_format}"+ title = f"AiSOC Weekly Executive Digest {period_start.strftime('%d %b')}–{period_end.strftime('%d %b %Y')}"++ artefact = ReportArtefact(+ id=uuid.uuid4(),+ tenant_id=tenant_id,+ report_type="weekly_digest",+ title=title,+ period_start=period_start,+ period_end=period_end,+ output_format=output_format,+ body_b64=body_b64,+ storage_key=storage_key,+ file_size_bytes=len(raw_bytes),+ data_snapshot=digest.model_dump(mode="json"),+ generated_by="weekly_digest_worker",+ status="ready",+ )+ db.add(artefact)+ await db.commit()++ logger.info(+ "weekly_digest.stored tenant_id=%s storage_key=%s size_bytes=%d fmt=%s",+ tenant_id,+ storage_key,+ len(raw_bytes),+ output_format,+ )+++async def run_once(ref_date: date | None = None) -> dict[str, int]:+ """Generate weekly digests for all active tenants.++ Parameters+ ----------+ ref_date:+ The Monday that triggers generation; defaults to ``date.today()``.+ Primarily exposed for unit-test injection without mocking the clock.++ Returns+ -------+ dict[str, int]+ ``{"tenants": N, "generated": M, "failed": K}``+ """+ today = ref_date or datetime.now(UTC).date()+ period_start, period_end = _week_window(today)++ stats: dict[str, int] = {"tenants": 0, "generated": 0, "failed": 0}++ async with AsyncSessionLocal() as db:+ tenants = await _fetch_active_tenants(db)++ stats["tenants"] = len(tenants)++ for tenant in tenants:+ try:+ await _generate_for_tenant(tenant.id, period_start, period_end)+ stats["generated"] += 1+ except Exception as exc: # noqa: BLE001+ stats["failed"] += 1+ logger.exception(+ "weekly_digest.tenant_failed tenant_id=%s err=%s",+ tenant.id,+ type(exc).__name__,+ )++ logger.info(+ "weekly_digest.run_once tenants=%d generated=%d failed=%d",+ stats["tenants"],+ stats["generated"],+ stats["failed"],+ )+ return stats+++async def run_forever(*, stop_event: asyncio.Event | None = None) -> None:+ """Poll hourly and generate digests every Monday at 00:xx UTC.++ Mirrors the structure of ``workers/oauth_refresh.py`` so the two workers+ are consistent in how they integrate with the ASGI ``lifespan`` hook.++ The optional ``stop_event`` is provided so integration tests can halt the+ loop deterministically without raising ``CancelledError``.+ """+ from app.core.config import settings # local import avoids circular deps++ interval = max(60, getattr(settings, "WEEKLY_DIGEST_POLL_INTERVAL_SECONDS", 3600))++ logger.info("weekly_digest.started poll_interval=%ds", interval)++ try:+ while True:+ if stop_event is not None and stop_event.is_set():+ break++ now_utc = datetime.now(UTC)+ if now_utc.weekday() == _MONDAY and now_utc.hour == _TRIGGER_HOUR:+ try:+ stats = await run_once()+ logger.info(+ "weekly_digest.tick tenants=%d generated=%d failed=%d",+ stats["tenants"],+ stats["generated"],+ stats["failed"],+ )+ except Exception as exc: # noqa: BLE001+ logger.exception("weekly_digest.tick_failed err=%s", type(exc).__name__)+ else:+ logger.debug(+ "weekly_digest.idle weekday=%d hour=%d — not Monday 00:xx UTC",+ now_utc.weekday(),+ now_utc.hour,+ )++ try:+ if stop_event is not None:+ await asyncio.wait_for(stop_event.wait(), timeout=interval)+ else:+ await asyncio.sleep(interval)+ except TimeoutError:+ continue++ except asyncio.CancelledError:+ logger.info("weekly_digest.cancelled — shutting down cleanly")+ raise+ finally:+ logger.info("weekly_digest.stopped")diff --git a/services/api/migrations/039_detection_proposal_github_pr.sql b/services/api/migrations/039_detection_proposal_github_pr.sqlnew file mode 100644index 000000000..e330a6392--- /dev/null+++ b/services/api/migrations/039_detection_proposal_github_pr.sql@@ -0,0 +1,14 @@+-- AiSOC WS-B4: Detection-as-Code git PR path+-- Author: Beenu - [email protected]+--+-- Adds `github_pr_url` to `detection_rule_proposals` so the promote+-- endpoint can link each promoted proposal to the GitHub Pull Request+-- that carries the Sigma/YARA rule file into the detections/ directory.+-- The URL is optional — deployments without AISOC_GITHUB_TOKEN configured+-- will leave it NULL and the UI omits the link.++ALTER TABLE detection_rule_proposals+ ADD COLUMN IF NOT EXISTS github_pr_url TEXT;++COMMENT ON COLUMN detection_rule_proposals.github_pr_url IS+ 'GitHub Pull Request URL created when this proposal was promoted (e.g. https://github.com/org/repo/pull/42). NULL when GitHub integration is not configured.';diff --git a/services/api/pyproject.toml b/services/api/pyproject.tomlindex 1ae47a40d..6969ed035 100644--- a/services/api/pyproject.toml+++ b/services/api/pyproject.toml@@ -44,6 +44,7 @@ yara-python = "^4.5.0"pyyaml = "^6.0.1"strawberry-graphql = { version = "^0.236.0", extras = ["fastapi"] }webauthn = "^2.2.0"+weasyprint = "^62.0" # WS-G2: server-side PDF generation from print-ready HTML[tool.poetry.group.dev.dependencies]pytest = "^8.2.0"diff --git a/services/api/tests/api/v1/endpoints/test_detection_compat_helpers.py b/services/api/tests/api/v1/endpoints/test_detection_compat_helpers.pyindex 8d3f90e3c..12a6bb3fd 100644--- a/services/api/tests/api/v1/endpoints/test_detection_compat_helpers.py+++ b/services/api/tests/api/v1/endpoints/test_detection_compat_helpers.py@@ -16,7 +16,6 @@ from __future__ import annotationsimport uuidfrom datetime import UTC, datetime, timedelta-from typing import Anyfrom app.api.v1.endpoints.detection_compat import (DRIFT_FP_RATE_THRESHOLD,diff --git a/services/api/tests/services/detections/test_ocsf_mapping.py b/services/api/tests/services/detections/test_ocsf_mapping.pyindex 3d3e61c98..3e9209c5d 100644--- a/services/api/tests/services/detections/test_ocsf_mapping.py+++ b/services/api/tests/services/detections/test_ocsf_mapping.py@@ -81,17 +81,13 @@ class TestPrecedence:def test_product_category_wins_over_service(self) -> None:# product+category=PROCESS_ACTIVITY; product+service=AUTHENTICATION# The (product, category) lookup should win.- ref = map_logsource_to_ocsf(- {"product": "windows", "category": "process_creation", "service": "security"}- )+ ref = map_logsource_to_ocsf({"product": "windows", "category": "process_creation", "service": "security"})assert ref.class_uid == OcsfClassUid.PROCESS_ACTIVITYclass TestFallback:@pytest.mark.parametrize("logsource", [None, {}, {"product": "weirdvendor"}])- def test_unknown_logsource_falls_back_to_detection_finding(- self, logsource: dict | None- ) -> None:+ def test_unknown_logsource_falls_back_to_detection_finding(self, logsource: dict | None) -> None:ref = map_logsource_to_ocsf(logsource)assert ref.class_uid == OcsfClassUid.DETECTION_FINDINGassert ref.class_name == "Detection Finding"diff --git a/services/api/tests/services/detections/test_sigma_import.py b/services/api/tests/services/detections/test_sigma_import.pyindex 20583ec99..778298dad 100644--- a/services/api/tests/services/detections/test_sigma_import.py+++ b/services/api/tests/services/detections/test_sigma_import.py@@ -36,7 +36,6 @@ from sqlalchemy.ext.asyncio import AsyncSession, create_async_enginefrom sqlalchemy.ext.compiler import compilesfrom sqlalchemy.orm import sessionmaker-# ─── SQLite-friendly compilation overrides for PG types ─────────────────────## The model uses Postgres-only types (``JSONB``, ``UUID``) for production@@ -125,17 +124,13 @@ def _stable_sigma_rule(class TestExtractMitreTechniques:def test_extracts_techniques_and_subtechniques(self) -> None:- techniques = si._extract_mitre_techniques(- ["attack.t1078", "attack.t1078.004", "attack.execution"]- )+ techniques = si._extract_mitre_techniques(["attack.t1078", "attack.t1078.004", "attack.execution"])# Tactic tag (``attack.execution``) is not a technique and is# skipped. Sub-technique stays as-is, parent stays as-is.assert techniques == ["T1078", "T1078.004"]def test_dedupes_preserving_order(self) -> None:- techniques = si._extract_mitre_techniques(- ["attack.t1078", "attack.t1078", "attack.t1027"]- )+ techniques = si._extract_mitre_techniques(["attack.t1078", "attack.t1078", "attack.t1027"])assert techniques == ["T1078", "T1027"]def test_ignores_garbage_tags(self) -> None:@@ -151,9 +146,7 @@ class TestExtractMitreTechniques:class TestExtractMitreTactics:def test_recognises_canonical_tactics(self) -> None:- tactics = si._extract_mitre_tactics(- ["attack.execution", "attack.persistence", "attack.t1078"]- )+ tactics = si._extract_mitre_tactics(["attack.execution", "attack.persistence", "attack.t1078"])# Technique tags are ignored here (handled by the technique# extractor); tactic tags become TA-codes.assert tactics == ["TA0002", "TA0003"]@@ -333,7 +326,8 @@ class TestImportSigmaRulesPipeline:bad_not_dict = "not even a dict"report = await si.import_sigma_rules(- session, [good, bad_no_id, bad_not_dict] # type: ignore[list-item]+ session,+ [good, bad_no_id, bad_not_dict], # type: ignore[list-item])assert len(report.inserted) == 1assert len(report.failures) == 2diff --git a/services/api/tests/test_agents_tools_endpoint.py b/services/api/tests/test_agents_tools_endpoint.pyindex af7f41eff..4d758de2e 100644--- a/services/api/tests/test_agents_tools_endpoint.py+++ b/services/api/tests/test_agents_tools_endpoint.py@@ -17,7 +17,6 @@ from app.api.v1.endpoints.agents import (_default_description,)-# ----------------------------------------------------------- group lookupdiff --git a/services/api/tests/test_case_fanout.py b/services/api/tests/test_case_fanout.pyindex 265e697d5..8d4e205f9 100644--- a/services/api/tests/test_case_fanout.py+++ b/services/api/tests/test_case_fanout.py@@ -33,8 +33,8 @@ from unittest.mock import AsyncMock, MagicMock, patchimport httpximport pytestfrom app.services.case_fanout import (- FanoutResult,ITSM_PUSH_CAPABLE_TYPES,+ FanoutResult,_post_to_connector_service,_push_case_url,_push_status_url,@@ -43,7 +43,6 @@ from app.services.case_fanout import (fanout_status_change,)-# ---------------------------------------------------------------------------# Helpers# ---------------------------------------------------------------------------@@ -135,9 +134,7 @@ def _build_db_with_connectors(select_result.scalars.return_value.all.return_value = list(connectors)refs_result = MagicMock()- refs_result.fetchall.return_value = [- SimpleNamespace(_mapping=ref) for ref in (refs or [])- ]+ refs_result.fetchall.return_value = [SimpleNamespace(_mapping=ref) for ref in (refs or [])]side_effects: list[Any] = []if refs is not None:@@ -214,9 +211,7 @@ def test_serialize_case_for_push_drops_internal_fields() -> None:def test_serialize_case_for_push_handles_dict_input() -> None:case_id = uuid.uuid4()- payload = _serialize_case_for_push(- {"id": case_id, "title": "T", "status": "open", "severity": "low"}- )+ payload = _serialize_case_for_push({"id": case_id, "title": "T", "status": "open", "severity": "low"})assert payload["id"] == str(case_id)assert payload["title"] == "T"# Defaults for unset list/dict columns.@@ -247,12 +242,8 @@ async def test_post_returns_ok_on_2xx() -> None:json_body={"external_id": "AIS-1", "vendor": "jira"},)with patch("app.services.case_fanout.httpx.AsyncClient") as mock_client:- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )- status, body, err = await _post_to_connector_service(- url="http://x/y", payload={}, timeout_seconds=5.0- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)+ status, body, err = await _post_to_connector_service(url="http://x/y", payload={}, timeout_seconds=5.0)assert status == "ok"assert body == {"external_id": "AIS-1", "vendor": "jira"}assert err is None@@ -262,12 +253,8 @@ async def test_post_returns_ok_on_2xx() -> None:async def test_post_returns_unsupported_on_501() -> None:fake_resp = _build_post_response(status_code=501, text_body="capability missing")with patch("app.services.case_fanout.httpx.AsyncClient") as mock_client:- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )- status, body, err = await _post_to_connector_service(- url="http://x/y", payload={}, timeout_seconds=5.0- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)+ status, body, err = await _post_to_connector_service(url="http://x/y", payload={}, timeout_seconds=5.0)assert status == "unsupported"assert body is Noneassert err == "capability missing"@@ -280,12 +267,8 @@ async def test_post_returns_error_on_4xx_with_detail() -> None:json_body={"detail": "missing project_key"},)with patch("app.services.case_fanout.httpx.AsyncClient") as mock_client:- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )- status, body, err = await _post_to_connector_service(- url="http://x/y", payload={}, timeout_seconds=5.0- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)+ status, body, err = await _post_to_connector_service(url="http://x/y", payload={}, timeout_seconds=5.0)assert status == "error"assert body is Noneassert "missing project_key" in (err or "")@@ -298,12 +281,8 @@ async def test_post_returns_error_on_transport_failure() -> None:Fan-out is best-effort; a flaky Jira tenant must not 503 the casecreate endpoint."""with patch("app.services.case_fanout.httpx.AsyncClient") as mock_client:- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- side_effect=httpx.ConnectError("dns failed")- )- status, body, err = await _post_to_connector_service(- url="http://x/y", payload={}, timeout_seconds=5.0- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(side_effect=httpx.ConnectError("dns failed"))+ status, body, err = await _post_to_connector_service(url="http://x/y", payload={}, timeout_seconds=5.0)assert status == "error"assert body is Noneassert "connectors service unreachable" in (err or "")@@ -315,12 +294,8 @@ async def test_post_returns_error_on_non_dict_body() -> None:that as an error rather than crashing further down with KeyError."""fake_resp = _build_post_response(status_code=200, json_body=[1, 2, 3]) # type: ignore[arg-type]with patch("app.services.case_fanout.httpx.AsyncClient") as mock_client:- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )- status, body, err = await _post_to_connector_service(- url="http://x/y", payload={}, timeout_seconds=5.0- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)+ status, body, err = await _post_to_connector_service(url="http://x/y", payload={}, timeout_seconds=5.0)assert status == "error"assert "unexpected payload shape" in (err or "")@@ -372,9 +347,7 @@ async def test_fanout_create_case_happy_path_persists_external_ref() -> None:patch("app.services.case_fanout.httpx.AsyncClient") as mock_client,):mock_vault.return_value.decrypt_dict.return_value = {"api_token": "plain"}- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)results = await fanout_create_case(db,case_row=case,@@ -409,9 +382,7 @@ async def test_fanout_create_case_credential_vault_failure_short_circuits() -> Npatch("app.services.case_fanout.get_vault") as mock_vault,patch("app.services.case_fanout.httpx.AsyncClient") as mock_client,):- mock_vault.return_value.decrypt_dict.side_effect = CredentialVaultError(- "key rotated"- )+ mock_vault.return_value.decrypt_dict.side_effect = CredentialVaultError("key rotated")post_mock = AsyncMock()mock_client.return_value.__aenter__.return_value.post = post_mockresults = await fanout_create_case(@@ -443,9 +414,7 @@ async def test_fanout_create_case_unsupported_capability_is_recorded() -> None:patch("app.services.case_fanout.httpx.AsyncClient") as mock_client,):mock_vault.return_value.decrypt_dict.return_value = {"api_token": "plain"}- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)results = await fanout_create_case(db,case_row=case,@@ -477,9 +446,7 @@ async def test_fanout_create_case_missing_external_id_is_error() -> None:patch("app.services.case_fanout.httpx.AsyncClient") as mock_client,):mock_vault.return_value.decrypt_dict.return_value = {"api_token": "plain"}- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)results = await fanout_create_case(db,case_row=case,@@ -592,9 +559,7 @@ async def test_fanout_status_change_happy_path_updates_external_status() -> Nonepatch("app.services.case_fanout.httpx.AsyncClient") as mock_client,):mock_vault.return_value.decrypt_dict.return_value = {"api_token": "plain"}- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- return_value=fake_resp- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(return_value=fake_resp)results = await fanout_status_change(db,case_row=case,@@ -636,9 +601,7 @@ async def test_fanout_status_change_transport_error_records_failure() -> None:patch("app.services.case_fanout.httpx.AsyncClient") as mock_client,):mock_vault.return_value.decrypt_dict.return_value = {"api_token": "plain"}- mock_client.return_value.__aenter__.return_value.post = AsyncMock(- side_effect=httpx.ReadTimeout("read timed out")- )+ mock_client.return_value.__aenter__.return_value.post = AsyncMock(side_effect=httpx.ReadTimeout("read timed out"))results = await fanout_status_change(db,case_row=case,@@ -675,4 +638,4 @@ def test_fanout_result_serializable_for_api_response() -> None:payload = r.model_dump_json()assert str(cid) in payloadassert "AIS-1" in payload- assert "\"status\":\"ok\"" in payload+ assert '"status":"ok"' in payloaddiff --git a/services/api/tests/test_connector_freshness.py b/services/api/tests/test_connector_freshness.pyindex 2fdad717a..6c849f882 100644--- a/services/api/tests/test_connector_freshness.py+++ b/services/api/tests/test_connector_freshness.py@@ -27,7 +27,6 @@ from app.services.connector_freshness import (expected_cadence_seconds,)-# ---------------------------------------------------------- expected_cadence_seconds@@ -233,9 +232,7 @@ def test_compute_freshness_per_instance_override_overrides_status() -> None:# With override of 1 h: 70 min is still inside 2× = 2 h, so yellow,# not red. The point is "the override demotes the verdict," not# that it's automatically green.- override_verdict = compute_freshness(- category="saas", last_event_at=last, now=now, override_seconds=3600- )+ override_verdict = compute_freshness(category="saas", last_event_at=last, now=now, override_seconds=3600)assert override_verdict.status == "yellow"assert override_verdict.expected_cadence_seconds == 3600# A shorter event-age (50 min) under the same override is green.diff --git a/services/api/tests/test_cost_dashboard.py b/services/api/tests/test_cost_dashboard.pyindex 4f1c6c952..5f143e974 100644--- a/services/api/tests/test_cost_dashboard.py+++ b/services/api/tests/test_cost_dashboard.py@@ -25,7 +25,6 @@ import uuidfrom datetime import UTC, datetime, timedeltaimport pytest-from app.services.cost_dashboard import (AuditRow,CostRow,diff --git a/services/api/tests/test_db_url_normalize.py b/services/api/tests/test_db_url_normalize.pyindex eff19fd2f..4b9cfa41f 100644--- a/services/api/tests/test_db_url_normalize.py+++ b/services/api/tests/test_db_url_normalize.py@@ -40,17 +40,13 @@ def test_sslmode_disable_translated_to_false():def test_other_query_params_preserved():- url, args = _normalize_async_pg_url(- "postgresql://u:p@h/db?application_name=aisoc&sslmode=verify-full"- )+ url, args = _normalize_async_pg_url("postgresql://u:p@h/db?application_name=aisoc&sslmode=verify-full")assert "application_name=aisoc" in urlassert "sslmode" not in urlassert args == {"ssl": "verify-full"}def test_channel_binding_stripped():- url, args = _normalize_async_pg_url(- "postgresql://u:p@h/db?sslmode=require&channel_binding=require"- )+ url, args = _normalize_async_pg_url("postgresql://u:p@h/db?sslmode=require&channel_binding=require")assert "channel_binding" not in urlassert args == {"ssl": "require"}diff --git a/services/api/tests/test_detection_management.py b/services/api/tests/test_detection_management.pyindex 1b2ce06d0..e4be69278 100644--- a/services/api/tests/test_detection_management.py+++ b/services/api/tests/test_detection_management.py@@ -31,7 +31,6 @@ from app.api.v1.endpoints.detection_compat import (_primary_tactic,)-# ---------------------------------------------------------------------------# Test doubles# ---------------------------------------------------------------------------diff --git a/services/api/tests/test_digest_pdf.py b/services/api/tests/test_digest_pdf.pynew file mode 100644index 000000000..9e719df6f--- /dev/null+++ b/services/api/tests/test_digest_pdf.py@@ -0,0 +1,313 @@+"""WS-G2 — Tests for digest_pdf.py (server-side PDF generation).++WeasyPrint requires native system libraries (Pango, Cairo, GLib) that are not+present on every CI or dev machine. These tests therefore **mock** WeasyPrint+entirely:++* ``test_render_digest_pdf_*`` — verify the ``render_digest_pdf`` wrapper by+ replacing ``weasyprint.HTML`` with a lightweight stub that returns a+ sentinel bytes object.+* ``test_render_digest_pdf_unavailable_*`` — verify that+ ``WeasyPrintUnavailableError`` is raised when the import fails.+* ``test_weekly_digest_task_*`` — unit-test ``run_once`` from the scheduler+ worker without touching the database (full DB mocking via ``AsyncMock``).++No production code in this module imports WeasyPrint at module scope; all+production imports are guarded by a ``try/except (ImportError, OSError)``.++Author: Beenu <[email protected]>+"""++from __future__ import annotations++import base64+import sys+import types+import uuid+from datetime import UTC, date, datetime, timedelta+from unittest.mock import AsyncMock, MagicMock, patch++import pytest+from app.services.digest_pdf import WeasyPrintUnavailableError, render_digest_pdf+from app.services.executive_digest import (+ AlertRow,+ DigestInputs,+ build_digest_from_rows,+)++# ---------------------------------------------------------------------------+# Shared fixtures+# ---------------------------------------------------------------------------++PERIOD_START = datetime(2026, 5, 4, tzinfo=UTC) # a Monday+PERIOD_END = datetime(2026, 5, 10, 23, 59, 59, tzinfo=UTC)+TENANT_ID = uuid.uuid4()+++def _make_digest():+ """Return a small but valid ExecutiveDigest for use across tests."""+ inputs = DigestInputs(+ tenant_id=TENANT_ID,+ period_start=PERIOD_START,+ period_end=PERIOD_END,+ current_alerts=[+ AlertRow(+ severity="high",+ status="closed",+ created_at=PERIOD_START + timedelta(hours=1),+ resolved_at=PERIOD_START + timedelta(hours=5),+ first_seen_at=PERIOD_START + timedelta(hours=1, minutes=10),+ disposition="true_positive",+ mitre_tactics=["execution"],+ connector_type="edr-crowdstrike",+ ai_score=0.9,+ title="Suspicious PowerShell",+ alert_id=str(uuid.uuid4()),+ event_time=PERIOD_START + timedelta(hours=1),+ )+ ],+ )+ return build_digest_from_rows(inputs)+++# ---------------------------------------------------------------------------+# render_digest_pdf — happy path (mocked WeasyPrint)+# ---------------------------------------------------------------------------+++def _install_fake_weasyprint(pdf_bytes: bytes = b"%PDF-1.4 fake") -> None:+ """Inject a fake ``weasyprint`` module into ``sys.modules``.++ The fake provides ``HTML`` as a class whose ``write_pdf()`` method+ returns *pdf_bytes*. Injecting into sys.modules makes the lazy+ ``from weasyprint import HTML`` inside ``render_digest_pdf`` resolve to+ the stub without any native library.+ """+ fake_html_instance = MagicMock()+ fake_html_instance.write_pdf.return_value = pdf_bytes++ fake_html_class = MagicMock(return_value=fake_html_instance)++ fake_module = types.ModuleType("weasyprint")+ fake_module.HTML = fake_html_class # type: ignore[attr-defined]++ sys.modules["weasyprint"] = fake_module+++def _remove_fake_weasyprint() -> None:+ """Undo ``_install_fake_weasyprint`` so later tests start clean."""+ sys.modules.pop("weasyprint", None)+++class TestRenderDigestPdf:+ """Happy-path tests for ``render_digest_pdf``."""++ def setup_method(self) -> None:+ _install_fake_weasyprint(b"%PDF-1.4 sentinel")++ def teardown_method(self) -> None:+ _remove_fake_weasyprint()++ def test_returns_bytes(self) -> None:+ digest = _make_digest()+ result = render_digest_pdf(digest)+ assert isinstance(result, bytes)++ def test_returns_fake_pdf_bytes(self) -> None:+ digest = _make_digest()+ result = render_digest_pdf(digest)+ assert result == b"%PDF-1.4 sentinel"++ def test_html_called_with_string_kwarg(self) -> None:+ """WeasyPrint's ``HTML`` must be initialised with ``string=...``."""+ digest = _make_digest()+ render_digest_pdf(digest)++ fake_html_class = sys.modules["weasyprint"].HTML # type: ignore[attr-defined]+ call_kwargs = fake_html_class.call_args.kwargs+ assert "string" in call_kwargs, "HTML() was not called with `string=` kwarg"+ # The HTML string should contain DOCTYPE and digest content.+ assert "<!DOCTYPE html>" in call_kwargs["string"]++ def test_write_pdf_called_once(self) -> None:+ digest = _make_digest()+ render_digest_pdf(digest)++ fake_instance = sys.modules["weasyprint"].HTML.return_value # type: ignore[attr-defined]+ fake_instance.write_pdf.assert_called_once()+++# ---------------------------------------------------------------------------+# render_digest_pdf — WeasyPrint unavailable+# ---------------------------------------------------------------------------+++class TestRenderDigestPdfUnavailable:+ """Verify graceful failure when the WeasyPrint native stack is absent."""++ def setup_method(self) -> None:+ # Remove any stub that a previous test may have left behind.+ _remove_fake_weasyprint()+ # Make import fail so the guard path is exercised.+ sys.modules["weasyprint"] = None # type: ignore[assignment]++ def teardown_method(self) -> None:+ _remove_fake_weasyprint()++ def test_raises_weasyprint_unavailable_error(self) -> None:+ digest = _make_digest()+ with pytest.raises(WeasyPrintUnavailableError):+ render_digest_pdf(digest)++ def test_error_message_mentions_installation(self) -> None:+ digest = _make_digest()+ with pytest.raises(WeasyPrintUnavailableError, match="WeasyPrint"):+ render_digest_pdf(digest)+++# ---------------------------------------------------------------------------+# weekly_digest_task — unit tests (no DB, no real WeasyPrint)+# ---------------------------------------------------------------------------+++class TestWeeklyDigestRunOnce:+ """Tests for ``weekly_digest_task.run_once`` with all I/O mocked."""++ def setup_method(self) -> None:+ _install_fake_weasyprint(b"%PDF-1.4 ok")++ def teardown_method(self) -> None:+ _remove_fake_weasyprint()++ @pytest.mark.asyncio+ async def test_run_once_generates_artefact_for_each_active_tenant(self) -> None:+ """``run_once`` should call ``_generate_for_tenant`` N times."""+ from app.workers import weekly_digest_task as wdt++ tenant_a = MagicMock()+ tenant_a.id = uuid.uuid4()+ tenant_b = MagicMock()+ tenant_b.id = uuid.uuid4()++ with (+ patch.object(wdt, "_fetch_active_tenants", new=AsyncMock(return_value=[tenant_a, tenant_b])),+ patch.object(wdt, "_generate_for_tenant", new=AsyncMock()) as mock_gen,+ patch("app.workers.weekly_digest_task.AsyncSessionLocal"),+ ):+ stats = await wdt.run_once(ref_date=date(2026, 5, 11)) # a Monday++ assert stats["tenants"] == 2+ assert stats["generated"] == 2+ assert stats["failed"] == 0+ assert mock_gen.call_count == 2++ @pytest.mark.asyncio+ async def test_run_once_records_failure_without_aborting_other_tenants(self) -> None:+ """A failure on tenant A must not prevent tenant B from being processed."""+ from app.workers import weekly_digest_task as wdt++ tenant_a = MagicMock()+ tenant_a.id = uuid.uuid4()+ tenant_b = MagicMock()+ tenant_b.id = uuid.uuid4()++ async def gen_side_effect(tenant_id, *args, **kwargs):+ if tenant_id == tenant_a.id:+ raise RuntimeError("DB exploded")++ with (+ patch.object(wdt, "_fetch_active_tenants", new=AsyncMock(return_value=[tenant_a, tenant_b])),+ patch.object(wdt, "_generate_for_tenant", new=AsyncMock(side_effect=gen_side_effect)),+ patch("app.workers.weekly_digest_task.AsyncSessionLocal"),+ ):+ stats = await wdt.run_once(ref_date=date(2026, 5, 11))++ assert stats["tenants"] == 2+ assert stats["generated"] == 1+ assert stats["failed"] == 1++ @pytest.mark.asyncio+ async def test_artefact_exists_skips_generation(self) -> None:+ """If a digest artefact already exists for the window, skip generation."""+ from app.workers import weekly_digest_task as wdt++ tenant = MagicMock()+ tenant.id = uuid.uuid4()++ with (+ patch.object(wdt, "_fetch_active_tenants", new=AsyncMock(return_value=[tenant])),+ patch.object(wdt, "_artefact_exists", new=AsyncMock(return_value=True)),+ patch.object(wdt, "build_weekly_digest", new=AsyncMock()) as mock_build,+ patch("app.workers.weekly_digest_task.AsyncSessionLocal"),+ ):+ # Call _generate_for_tenant directly to test the skip path.+ period_start = datetime(2026, 5, 4, tzinfo=UTC)+ period_end = datetime(2026, 5, 10, 23, 59, 59, tzinfo=UTC)+ await wdt._generate_for_tenant(tenant.id, period_start, period_end)++ mock_build.assert_not_called()++ @pytest.mark.asyncio+ async def test_html_fallback_used_when_weasyprint_unavailable(self) -> None:+ """When WeasyPrint is unavailable, artefact uses HTML format."""+ from app.workers import weekly_digest_task as wdt++ # Remove fake WeasyPrint to force the fallback path.+ _remove_fake_weasyprint()+ sys.modules["weasyprint"] = None # type: ignore[assignment]++ digest = _make_digest()++ added_artefact: dict = {}++ async def fake_generate(tenant_id, period_start, period_end):+ """Thin inline re-implementation that captures the artefact without DB."""+ from app.services.digest_html import render_digest_html+ from app.services.digest_pdf import WeasyPrintUnavailableError, render_digest_pdf++ output_format = "pdf"+ try:+ raw_bytes = render_digest_pdf(digest)+ except WeasyPrintUnavailableError:+ raw_bytes = render_digest_html(digest).encode("utf-8")+ output_format = "html"++ added_artefact["output_format"] = output_format+ added_artefact["body_b64"] = base64.b64encode(raw_bytes).decode("ascii")++ period_start = datetime(2026, 5, 4, tzinfo=UTC)+ period_end = datetime(2026, 5, 10, 23, 59, 59, tzinfo=UTC)++ with patch.object(wdt, "_generate_for_tenant", new=fake_generate):+ await wdt._generate_for_tenant(TENANT_ID, period_start, period_end)++ assert added_artefact["output_format"] == "html"+ body = base64.b64decode(added_artefact["body_b64"]).decode("utf-8")+ assert "<!DOCTYPE html>" in body++ # Restore the fake for subsequent tests.+ _install_fake_weasyprint(b"%PDF-1.4 ok")+++# ---------------------------------------------------------------------------+# _week_window helper+# ---------------------------------------------------------------------------+++def test_week_window_returns_correct_bounds() -> None:+ from app.workers.weekly_digest_task import _week_window++ # Monday 2026-05-11 → previous week: 2026-05-04 to 2026-05-10 23:59:59.999999+ start, end = _week_window(date(2026, 5, 11))+ assert start == datetime(2026, 5, 4, tzinfo=UTC)+ # end should be just before 2026-05-11 00:00:00+ assert end == datetime(2026, 5, 11, tzinfo=UTC) - timedelta(microseconds=1)+++def test_week_window_period_end_is_before_ref_date() -> None:+ from app.workers.weekly_digest_task import _week_window++ ref = date(2026, 5, 18)+ start, end = _week_window(ref)+ assert start < end+ assert end < datetime(ref.year, ref.month, ref.day, tzinfo=UTC)diff --git a/services/api/tests/test_easm.py b/services/api/tests/test_easm.pyindex a2854fa3b..dadaf07ae 100644--- a/services/api/tests/test_easm.py+++ b/services/api/tests/test_easm.py@@ -12,18 +12,17 @@ All tests run with mocked HTTP and socket calls — no live APIs required.from __future__ import annotationsimport uuid-from datetime import datetime, timezone+from datetime import UTC, datetimefrom typing import Anyfrom unittest.mock import AsyncMock, MagicMock, patchimport pytest-from app.models.easm import ExternalAsset, ExternalAssetTypefrom app.services.easm_discovery import (DiscoveredAsset,- _shodan_search,- _censys_search,_active_scan,+ _censys_search,+ _shodan_search,run_discovery,)from app.services.easm_drift import (@@ -32,7 +31,6 @@ from app.services.easm_drift import (detect_drift,)-# ---------------------------------------------------------------------------# Fixtures# ---------------------------------------------------------------------------@@ -85,6 +83,7 @@ def _fake_censys_response() -> dict[str, Any]:# Discovery: Shodan# ---------------------------------------------------------------------------+@pytest.mark.asyncioasync def test_shodan_search_parses_matches():mock_resp = MagicMock()@@ -130,6 +129,7 @@ async def test_shodan_search_handles_error():# Discovery: Censys# ---------------------------------------------------------------------------+@pytest.mark.asyncioasync def test_censys_search_parses_hits():mock_resp = MagicMock()@@ -160,6 +160,7 @@ async def test_censys_search_parses_hits():# Discovery: Active scan# ---------------------------------------------------------------------------+@pytest.mark.asyncioasync def test_active_scan_open_ports():async def mock_probe(host, port, timeout=3.0):@@ -189,6 +190,7 @@ async def test_active_scan_no_open_ports():# Discovery: run_discovery orchestrator# ---------------------------------------------------------------------------+@pytest.mark.asyncioasync def test_run_discovery_uses_configured_connectors():fake_settings = MagicMock()@@ -248,6 +250,7 @@ async def test_run_discovery_runs_active_when_enabled():# Drift: metadata merge# ---------------------------------------------------------------------------+def test_merge_metadata_combines_ports():old = {"source": "shodan", "ports": [22, 80]}new = {"source": "censys", "ports": [80, 443]}@@ -269,6 +272,7 @@ def test_merge_metadata_no_ports():# Drift: port drift detection# ---------------------------------------------------------------------------+def test_detect_port_drift_new_ports():old = {"ports": [22, 80]}new = {"ports": [22, 80, 443, 8080]}@@ -306,6 +310,7 @@ def test_detect_port_drift_no_change():# Drift: detect_drift integration (mock DB)# ---------------------------------------------------------------------------+@pytest.mark.asyncioasync def test_detect_drift_new_asset():"""A brand-new asset should produce a 'new_asset' drift record."""@@ -336,7 +341,7 @@ async def test_detect_drift_existing_asset_port_change():existing_asset = MagicMock(spec=ExternalAsset)existing_asset.id = uuid.uuid4()existing_asset.metadata_json = {"source": "shodan", "ports": [22]}- existing_asset.last_seen = datetime(2025, 1, 1, tzinfo=timezone.utc)+ existing_asset.last_seen = datetime(2025, 1, 1, tzinfo=UTC)db = AsyncMock()diff --git a/services/api/tests/test_inbox_itsm_endpoint.py b/services/api/tests/test_inbox_itsm_endpoint.pyindex f341666e2..7a6324eb7 100644--- a/services/api/tests/test_inbox_itsm_endpoint.py+++ b/services/api/tests/test_inbox_itsm_endpoint.py@@ -54,7 +54,6 @@ from app.api.v1.endpoints.inbox_itsm import ()from fastapi import HTTPException-# ---------------------------------------------------------------------------# _verify_hmac — auth glue. The biggest single attack surface for the# whole module: a bug here is "anyone can set any case status", so the@@ -358,9 +357,7 @@ async def test_fetch_token_and_connector_happy_path() -> None:enabled=True,)db = _mock_db(token_row, connector_row)- tok, conn = await _fetch_token_and_connector(- db, tenant_token="tok-xyz", connector_instance_id=connector_id- )+ tok, conn = await _fetch_token_and_connector(db, tenant_token="tok-xyz", connector_instance_id=connector_id)assert tok is token_rowassert conn is connector_row@@ -370,9 +367,7 @@ async def test_fetch_token_and_connector_missing_token_raises_401() -> None:"""Revoked / never-existed tokens are auth failures."""db = _mock_db(token_row=None, connector_row=None)with pytest.raises(HTTPException) as exc:- await _fetch_token_and_connector(- db, tenant_token="tok-revoked", connector_instance_id=uuid.uuid4()- )+ await _fetch_token_and_connector(db, tenant_token="tok-revoked", connector_instance_id=uuid.uuid4())assert exc.value.status_code == 401# Don't echo the full token in the error — leakage minimisation.assert "tok-revoked" not in str(exc.value.detail)@@ -395,9 +390,7 @@ async def test_fetch_token_and_connector_wrong_template_raises_403() -> None:)db = _mock_db(token_row, None)with pytest.raises(HTTPException) as exc:- await _fetch_token_and_connector(- db, tenant_token="tok-pagerduty", connector_instance_id=uuid.uuid4()- )+ await _fetch_token_and_connector(db, tenant_token="tok-pagerduty", connector_instance_id=uuid.uuid4())assert exc.value.status_code == 403assert "itsm-inbound" in exc.value.detail@@ -415,9 +408,7 @@ async def test_fetch_token_and_connector_missing_connector_raises_404() -> None:)db = _mock_db(token_row, connector_row=None)with pytest.raises(HTTPException) as exc:- await _fetch_token_and_connector(- db, tenant_token="tok-xyz", connector_instance_id=uuid.uuid4()- )+ await _fetch_token_and_connector(db, tenant_token="tok-xyz", connector_instance_id=uuid.uuid4())assert exc.value.status_code == 404@@ -444,9 +435,7 @@ async def test_fetch_token_and_connector_cross_tenant_raises_403() -> None:)db = _mock_db(token_row, connector_row)with pytest.raises(HTTPException) as exc:- await _fetch_token_and_connector(- db, tenant_token="tok-xyz", connector_instance_id=connector_row.id- )+ await _fetch_token_and_connector(db, tenant_token="tok-xyz", connector_instance_id=connector_row.id)assert exc.value.status_code == 403assert "different tenants" in exc.value.detail@@ -475,9 +464,7 @@ async def test_fetch_token_and_connector_disabled_connector_raises_409() -> None)db = _mock_db(token_row, connector_row)with pytest.raises(HTTPException) as exc:- await _fetch_token_and_connector(- db, tenant_token="tok-xyz", connector_instance_id=connector_row.id- )+ await _fetch_token_and_connector(db, tenant_token="tok-xyz", connector_instance_id=connector_row.id)assert exc.value.status_code == 409@@ -500,9 +487,7 @@ async def test_fetch_token_and_connector_unsupported_vendor_raises_422() -> None)db = _mock_db(token_row, connector_row)with pytest.raises(HTTPException) as exc:- await _fetch_token_and_connector(- db, tenant_token="tok-xyz", connector_instance_id=connector_row.id- )+ await _fetch_token_and_connector(db, tenant_token="tok-xyz", connector_instance_id=connector_row.id)assert exc.value.status_code == 422assert "splunk" in exc.value.detail@@ -846,9 +831,7 @@ async def test_endpoint_unlinked_external_id_returns_200_with_note() -> None:enabled=True,)# ref_row=None means the JOIN found no AiSOC link.- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=None- )+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=None)body = json.dumps({"issue": {@@ -909,12 +892,8 @@ async def test_endpoint_idempotent_when_case_already_in_target_status() -> None:case_number="CASE-1",status="resolved", # already in the target state)- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=ref_row- )- body = json.dumps(- {"issue": {"key": "AIS-1", "fields": {"status": {"name": "Done"}}}}- ).encode()+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=ref_row)+ body = json.dumps({"issue": {"key": "AIS-1", "fields": {"status": {"name": "Done"}}}}).encode()request = _build_request(body)result = await inbound_itsm_webhook(@@ -964,9 +943,7 @@ async def test_endpoint_unmapped_status_bumps_last_synced_only() -> None:case_number="CASE-2",status="investigating",)- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=ref_row- )+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=ref_row)body = json.dumps({"issue": {@@ -1018,12 +995,8 @@ async def test_endpoint_real_status_change_writes_and_returns_changed() -> None:case_number="CASE-7",status="investigating",)- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=ref_row- )- body = json.dumps(- {"issue": {"key": "AIS-7", "fields": {"status": {"name": "Done"}}}}- ).encode()+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=ref_row)+ body = json.dumps({"issue": {"key": "AIS-7", "fields": {"status": {"name": "Done"}}}}).encode()request = _build_request(body)result = await inbound_itsm_webhook(@@ -1073,9 +1046,7 @@ async def test_endpoint_servicenow_dispatches_to_servicenow_parser() -> None:case_number="CASE-9",status="investigating",)- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=ref_row- )+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=ref_row)body = json.dumps({"sys_id": "abc-1", "state": 6}).encode()request = _build_request(body)@@ -1116,9 +1087,7 @@ async def test_endpoint_hmac_required_but_missing_returns_401() -> None:connector_type="jira",enabled=True,)- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=None- )+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=None)request = _build_request(b"{}")with pytest.raises(HTTPException) as exc:@@ -1159,12 +1128,8 @@ async def test_endpoint_hmac_valid_passes_through() -> None:case_number="CASE-5",status="investigating",)- db = _build_db_for_endpoint(- token_row=token_row, connector_row=connector_row, ref_row=ref_row- )- body = json.dumps(- {"issue": {"key": "AIS-5", "fields": {"status": {"name": "Done"}}}}- ).encode()+ db = _build_db_for_endpoint(token_row=token_row, connector_row=connector_row, ref_row=ref_row)+ body = json.dumps({"issue": {"key": "AIS-5", "fields": {"status": {"name": "Done"}}}}).encode()sig = f"sha256={_expected_sig('seekret', body)}"request = _build_request(body)diff --git a/services/api/tests/test_lake_endpoint.py b/services/api/tests/test_lake_endpoint.pyindex 2fc7a3395..b7f0de820 100644--- a/services/api/tests/test_lake_endpoint.py+++ b/services/api/tests/test_lake_endpoint.py@@ -46,7 +46,6 @@ from app.api.v1.endpoints.lake import (from app.services.lake_rate_limit import RateLimitDecisionfrom fastapi import HTTPException, Response-# --------------------------------------------------------- _scrub_sql_for_logdiff --git a/services/api/tests/test_lake_rate_limit.py b/services/api/tests/test_lake_rate_limit.pyindex 22f1be924..2b4901d02 100644--- a/services/api/tests/test_lake_rate_limit.py+++ b/services/api/tests/test_lake_rate_limit.py@@ -43,7 +43,6 @@ from unittest.mock import patchfrom uuid import UUID, uuid4import pytest-from app.services.lake_rate_limit import (DEFAULT_CAPACITY,DEFAULT_REFILL_PER_SECOND,diff --git a/services/api/tests/test_lake_sql.py b/services/api/tests/test_lake_sql.pyindex 5e1000f98..459fc53ff 100644--- a/services/api/tests/test_lake_sql.py+++ b/services/api/tests/test_lake_sql.py@@ -40,7 +40,6 @@ from app.services.lake_sql import (rewrite_for_tenant,)-# A stable tenant UUID we can grep for in the rewritten SQL. Picked once# at import time so every test in the module gets the same value, which# makes assertion failures easier to read.@@ -161,9 +160,7 @@ def test_select_with_no_from_passes_through_unchanged() -> None:def test_qualified_allowlisted_table_accepted() -> None:- result = rewrite_for_tenant(- "SELECT * FROM aisoc.raw_events", TENANT_ID- )+ result = rewrite_for_tenant("SELECT * FROM aisoc.raw_events", TENANT_ID)assert "aisoc.raw_events" in result.referenced_tablesassert _count_predicates(result.sql, TENANT_ID) == 1@@ -231,9 +228,7 @@ def test_table_functions_rejected(sql: str) -> None:def test_predicate_injected_on_simple_select() -> None:- result = rewrite_for_tenant(- "SELECT id FROM aisoc.raw_events", TENANT_ID- )+ result = rewrite_for_tenant("SELECT id FROM aisoc.raw_events", TENANT_ID)assert _count_predicates(result.sql, TENANT_ID) == 1@@ -340,9 +335,7 @@ def test_union_branches_each_get_predicate() -> None:def test_default_row_cap_applied_when_no_limit() -> None:- result = rewrite_for_tenant(- "SELECT * FROM aisoc.raw_events", TENANT_ID- )+ result = rewrite_for_tenant("SELECT * FROM aisoc.raw_events", TENANT_ID)assert result.row_cap == DEFAULT_ROW_CAPassert f"limit {DEFAULT_ROW_CAP}" in result.sql.lower()@@ -352,9 +345,7 @@ def test_caller_smaller_limit_preserved() -> None:The cap exists to prevent runaway queries, not to expand them."""- result = rewrite_for_tenant(- "SELECT * FROM aisoc.raw_events LIMIT 5", TENANT_ID- )+ result = rewrite_for_tenant("SELECT * FROM aisoc.raw_events LIMIT 5", TENANT_ID)# The clamp leaves the LIMIT alone.assert "limit 5" in result.sql.lower()# ``row_cap`` reflects the configured cap (the LIMIT is below it).@@ -370,9 +361,7 @@ def test_caller_larger_limit_clamped_to_default() -> None:def test_explicit_row_cap_respected() -> None:- result = rewrite_for_tenant(- "SELECT * FROM aisoc.raw_events", TENANT_ID, row_cap=50- )+ result = rewrite_for_tenant("SELECT * FROM aisoc.raw_events", TENANT_ID, row_cap=50)assert result.row_cap == 50assert "limit 50" in result.sql.lower()diff --git a/services/api/tests/test_llm_credentials_endpoint.py b/services/api/tests/test_llm_credentials_endpoint.pyindex 1cbc0d94c..e017cafa4 100644--- a/services/api/tests/test_llm_credentials_endpoint.py+++ b/services/api/tests/test_llm_credentials_endpoint.py@@ -66,7 +66,6 @@ from cryptography.fernet import Fernetfrom fastapi import HTTPExceptionfrom pydantic import ValidationError-# ---------------------------------------------------------------------------# Test fixtures / helpers# ---------------------------------------------------------------------------@@ -257,9 +256,7 @@ def test_project_normalises_settings_none_to_empty_dict() -> None:(None, None),],)-def test_base_url_validator_accepts_valid_inputs(- value: str | None, expected: str | None-) -> None:+def test_base_url_validator_accepts_valid_inputs(value: str | None, expected: str | None) -> None:"""The validator strips whitespace and collapses empties to ``None``."""payload = LlmCredentialUpsert(provider="custom", base_url=value, api_key="k")assert payload.base_url == expected@@ -314,9 +311,7 @@ def test_provider_enum_rejects_unknown_value() -> None:# ---------------------------------------------------------------------------- "provider", ["local-ollama", "local-vllm", "local-litellm", "custom"]-)[email protected]("provider", ["local-ollama", "local-vllm", "local-litellm", "custom"])def test_enforce_invariants_requires_base_url_for_local_and_custom(provider: str,) -> None:@@ -476,9 +471,7 @@ async def test_put_creates_new_row_encrypts_and_emits_audit() -> None:"app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(return_value=None),) as mock_emit:- result = await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ result = await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)db.add.assert_called_once()added_row = db.add.call_args.args[0]@@ -538,16 +531,14 @@ async def test_put_rotation_only_keeps_existing_ciphertext_and_does_not_bump_rotpayload = LlmCredentialUpsert(provider="openai",model="gpt-4o-mini", # changed- api_key=None, # keep existing+ api_key=None, # keep existing)with patch("app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(return_value=None),) as mock_emit:- result = await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ result = await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)# The mutated row is the same object; assert the in-place mutations.assert existing.api_key_vault == original_ciphertext@@ -589,9 +580,7 @@ async def test_put_with_new_key_bumps_last_rotated_at_on_existing() -> None:"app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(return_value=None),) as mock_emit:- await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)# Ciphertext changed; the new value is a real vault token (not the# plaintext) and is not the original.@@ -623,17 +612,13 @@ async def test_put_records_provider_transition_in_audit_changes() -> None:db = _mock_db_with_existing(existing)request = _build_request()- payload = LlmCredentialUpsert(- provider="azure-openai", api_key="sk-azure"- )+ payload = LlmCredentialUpsert(provider="azure-openai", api_key="sk-azure")with patch("app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(return_value=None),) as mock_emit:- await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)changes = mock_emit.call_args.kwargs["changes"]assert changes["provider"] == "azure-openai"@@ -669,9 +654,7 @@ async def test_put_vault_failure_surfaces_500_and_does_not_commit() -> None:return_value=bad_vault,):with pytest.raises(HTTPException) as exc:- await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)assert exc.value.status_code == 500assert "Failed to encrypt" in exc.value.detail@@ -693,9 +676,7 @@ async def test_put_validation_blocks_local_provider_without_base_url() -> None:payload = LlmCredentialUpsert(provider="local-ollama", base_url=None)with pytest.raises(HTTPException) as exc:- await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)assert exc.value.status_code == 422assert "requires base_url" in exc.value.detail@@ -712,9 +693,7 @@ async def test_put_validation_blocks_first_openai_write_without_api_key() -> Nonpayload = LlmCredentialUpsert(provider="openai", api_key=None)with pytest.raises(HTTPException) as exc:- await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)assert exc.value.status_code == 422assert "requires api_key" in exc.value.detail@@ -740,9 +719,7 @@ async def test_put_audit_failure_does_not_500_the_call() -> None:new=AsyncMock(side_effect=RuntimeError("audit table is gone")),):# Should NOT raise — the endpoint catches and logs.- result = await upsert_llm_credential(- payload=payload, request=request, current_user=user, db=db- )+ result = await upsert_llm_credential(payload=payload, request=request, current_user=user, db=db)assert result.provider == "openai"assert result.has_api_key is True@@ -775,9 +752,7 @@ async def test_delete_existing_row_emits_audit_with_provider() -> None:"app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(return_value=None),) as mock_emit:- result = await delete_llm_credential(- request=request, current_user=user, db=db- )+ result = await delete_llm_credential(request=request, current_user=user, db=db)assert result is None # 204 response# Two execute calls: SELECT existing, then DELETE.@@ -808,9 +783,7 @@ async def test_delete_idempotent_when_no_row_exists() -> None:"app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(return_value=None),) as mock_emit:- result = await delete_llm_credential(- request=request, current_user=user, db=db- )+ result = await delete_llm_credential(request=request, current_user=user, db=db)assert result is Nonedb.commit.assert_awaited_once()@@ -830,9 +803,7 @@ async def test_delete_audit_failure_does_not_500_the_call() -> None:"app.api.v1.endpoints.llm_credentials.emit_audit",new=AsyncMock(side_effect=RuntimeError("audit table is gone")),):- result = await delete_llm_credential(- request=request, current_user=user, db=db- )+ result = await delete_llm_credential(request=request, current_user=user, db=db)assert result is Nonedb.commit.assert_awaited_once()diff --git a/services/api/tests/test_llm_status.py b/services/api/tests/test_llm_status.pyindex 7a2df0776..610c64529 100644--- a/services/api/tests/test_llm_status.py+++ b/services/api/tests/test_llm_status.py@@ -63,9 +63,7 @@ class TestNoConfiguration:class TestKeyHandling:"""The key itself must never leave the process."""- def test_key_set_true_when_openai_api_key_present(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_key_set_true_when_openai_api_key_present(self, monkeypatch: pytest.MonkeyPatch):# NB: the value is intentionally fake; the assertion is that# we report the *presence* of a key, not the value.monkeypatch.setenv("OPENAI_API_KEY", "sk-test-not-a-real-key")@@ -74,9 +72,7 @@ class TestKeyHandling:# And the value never appears anywhere in the snapshot.assert "sk-test-not-a-real-key" not in str(snap)- def test_key_set_true_when_llm_api_key_alias_present(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_key_set_true_when_llm_api_key_alias_present(self, monkeypatch: pytest.MonkeyPatch):monkeypatch.setenv("LLM_API_KEY", "anything")snap = llm_status()assert snap["key_set"] is True@@ -85,9 +81,7 @@ class TestKeyHandling:class TestProviderClassification:"""``provider`` should match what the operator set, not OpenAI by default."""- def test_openai_default_when_key_set_no_base_url(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_openai_default_when_key_set_no_base_url(self, monkeypatch: pytest.MonkeyPatch):monkeypatch.setenv("OPENAI_API_KEY", "x")snap = llm_status()assert snap["provider"] == "openai"@@ -106,9 +100,7 @@ class TestProviderClassification:def test_azure_openai(self, monkeypatch: pytest.MonkeyPatch):monkeypatch.setenv("OPENAI_API_KEY", "x")- monkeypatch.setenv(- "OPENAI_BASE_URL", "https://my-resource.openai.azure.com/openai"- )+ monkeypatch.setenv("OPENAI_BASE_URL", "https://my-resource.openai.azure.com/openai")snap = llm_status()assert snap["provider"] == "azure-openai"@@ -130,18 +122,14 @@ class TestProviderClassification:assert snap["provider"] in {"custom", "local-vllm"}assert snap["is_local"] is True- def test_local_vllm_with_explicit_hostname(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_local_vllm_with_explicit_hostname(self, monkeypatch: pytest.MonkeyPatch):monkeypatch.setenv("OPENAI_API_KEY", "x")monkeypatch.setenv("OPENAI_BASE_URL", "http://vllm-gateway.local:8000/v1")snap = llm_status()assert snap["provider"] == "local-vllm"assert snap["is_local"] is True- def test_lm_alias_takes_precedence_over_openai_alias(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_lm_alias_takes_precedence_over_openai_alias(self, monkeypatch: pytest.MonkeyPatch):# If both are set, LLM_BASE_URL wins to match the precedence in# ``services/api/app/core/config.py``.monkeypatch.setenv("LLM_BASE_URL", "http://ollama:11434/v1")@@ -182,9 +170,7 @@ class TestAirgapCompliance:assert snap["effective_path"] == "live"assert snap["is_local"] is True- def test_airgap_on_allows_allowlisted_external_mirror(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_airgap_on_allows_allowlisted_external_mirror(self, monkeypatch: pytest.MonkeyPatch):monkeypatch.setattr(airgap_module.settings, "AISOC_AIRGAPPED", True)monkeypatch.setattr(airgap_module.settings,@@ -192,9 +178,7 @@ class TestAirgapCompliance:["llm-mirror.acme-internal.example.com"],)monkeypatch.setenv("OPENAI_API_KEY", "x")- monkeypatch.setenv(- "OPENAI_BASE_URL", "https://llm-mirror.acme-internal.example.com/v1"- )+ monkeypatch.setenv("OPENAI_BASE_URL", "https://llm-mirror.acme-internal.example.com/v1")snap = llm_status()assert snap["airgap_compliant"] is Trueassert snap["effective_path"] == "live"@@ -224,9 +208,7 @@ class TestEffectivePath:snap = llm_status()assert snap["effective_path"] == "fallback"- def test_fallback_when_key_set_but_airgap_blocks(- self, monkeypatch: pytest.MonkeyPatch- ):+ def test_fallback_when_key_set_but_airgap_blocks(self, monkeypatch: pytest.MonkeyPatch):monkeypatch.setattr(airgap_module.settings, "AISOC_AIRGAPPED", True)monkeypatch.setenv("OPENAI_API_KEY", "x")# No base_url + airgap on → would default to api.openai.com → blocked.diff --git a/services/api/tests/test_mssp_rule_resolver.py b/services/api/tests/test_mssp_rule_resolver.pyindex 6ce508a98..c5eeae354 100644--- a/services/api/tests/test_mssp_rule_resolver.py+++ b/services/api/tests/test_mssp_rule_resolver.py@@ -14,17 +14,16 @@ import uuidfrom unittest.mock import AsyncMock, MagicMockimport pytest-from app.services.mssp_rule_resolver import (ResolvedRule,resolve_effective_rules,)-# ---------------------------------------------------------------------------# Helpers — tiny fakes for ORM rows# ---------------------------------------------------------------------------+def _rule(*,rid: uuid.UUID | None = None,@@ -159,9 +158,11 @@ class TestResolveEffectiveRules:async def test_tenant_rules_only(self):tid = uuid.uuid4()r1 = _rule(tenant_id=tid, name="r1")- db = _mock_session([- [r1], # direct rules query- ])+ db = _mock_session(+ [+ [r1], # direct rules query+ ]+ )resolved = await resolve_effective_rules(db, tid, include_packs=False)assert len(resolved) == 1assert resolved[0].name == "r1"@@ -172,9 +173,11 @@ class TestResolveEffectiveRules:tid = uuid.uuid4()r1 = _rule(tenant_id=tid, name="tenant-rule")b1 = _rule(tenant_id=None, name="builtin-rule", is_builtin=True)- db = _mock_session([- [r1, b1], # direct rules query- ])+ db = _mock_session(+ [+ [r1, b1], # direct rules query+ ]+ )resolved = await resolve_effective_rules(db, tid, include_packs=False)assert len(resolved) == 2sources = {r.source for r in resolved}@@ -184,9 +187,11 @@ class TestResolveEffectiveRules:async def test_builtin_excluded(self):tid = uuid.uuid4()r1 = _rule(tenant_id=tid, name="tenant-rule")- db = _mock_session([- [r1], # direct rules query (no builtins)- ])+ db = _mock_session(+ [+ [r1], # direct rules query (no builtins)+ ]+ )resolved = await resolve_effective_rules(db, tid, include_builtin=False, include_packs=False)assert len(resolved) == 1assert resolved[0].source == "tenant"@@ -200,12 +205,14 @@ class TestResolveEffectiveRules:assignment = _assignment(pack_id, tid)- db = _mock_session([- [r1], # direct rules- [assignment], # pack assignments- [(pack_id, pr1)], # pack rule join results- [], # overrides- ])+ db = _mock_session(+ [+ [r1], # direct rules+ [assignment], # pack assignments+ [(pack_id, pr1)], # pack rule join results+ [], # overrides+ ]+ )resolved = await resolve_effective_rules(db, tid)assert len(resolved) == 2pack_rules = [r for r in resolved if r.source == "pack"]@@ -220,10 +227,12 @@ class TestResolveEffectiveRules:override = _override(tid, r2.id, action="exclude")- db = _mock_session([- [r1, r2], # direct rules- [], # overrides- ])+ db = _mock_session(+ [+ [r1, r2], # direct rules+ [], # overrides+ ]+ )# Manually wire override into the third callcall_counter = {"n": 0}original_execute = db.execute@@ -249,7 +258,8 @@ class TestResolveEffectiveRules:r1 = _rule(tenant_id=tid, name="adjustable", severity="medium")override = _override(- tid, r1.id,+ tid,+ r1.id,action="customize",severity_override="critical",note="escalated per SOC policy",@@ -284,8 +294,10 @@ class TestResolveEffectiveRules:@pytest.mark.asyncioasync def test_empty_tenant(self):tid = uuid.uuid4()- db = _mock_session([- [], # no direct rules- ])+ db = _mock_session(+ [+ [], # no direct rules+ ]+ )resolved = await resolve_effective_rules(db, tid, include_packs=False)assert resolved == []diff --git a/services/api/tests/test_oauth_refresh_worker.py b/services/api/tests/test_oauth_refresh_worker.pyindex f1fd4e78c..95bf9239a 100644--- a/services/api/tests/test_oauth_refresh_worker.py+++ b/services/api/tests/test_oauth_refresh_worker.py@@ -29,9 +29,9 @@ from app.security.credential_vault import CredentialVaultfrom app.workers import oauth_refresh as workerfrom cryptography.fernet import Fernet-# --------------------------------------------------------------- helpers+class _FakeConnector:"""Minimal stand-in for the SQLAlchemy ``Connector`` model.@@ -75,9 +75,7 @@ def _build_vault() -> CredentialVault:return CredentialVault(Fernet.generate_key())-def _mock_db(- *, app_credential: Any = None, scalars_seq: list[Any] | None = None-) -> AsyncMock:+def _mock_db(*, app_credential: Any = None, scalars_seq: list[Any] | None = None) -> AsyncMock:"""Build an ``AsyncSession``-shaped mock.``execute`` is an ``AsyncMock`` whose awaited return is a *plain*@@ -134,19 +132,13 @@ def test_resolve_token_url_prefers_tenant_override() -> None:"""Per-tenant ``token_url`` wins over catalog hints."""cred = _FakeAppCredential(token_url="https://override.example.com/token")hints = {"token_url": "https://catalog.example.com/token"}- assert (- worker._resolve_token_url(cred, hints)- == "https://override.example.com/token"- )+ assert worker._resolve_token_url(cred, hints) == "https://override.example.com/token"def test_resolve_token_url_falls_back_to_hints() -> None:cred = _FakeAppCredential(token_url=None)hints = {"token_url": "https://catalog.example.com/token"}- assert (- worker._resolve_token_url(cred, hints)- == "https://catalog.example.com/token"- )+ assert worker._resolve_token_url(cred, hints) == "https://catalog.example.com/token"def test_resolve_token_url_returns_none_when_unresolved() -> None:@@ -169,9 +161,7 @@ async def test_record_failure_increments_below_threshold() -> None:conn = _FakeConnector(oauth_refresh_failures=0, health_status="healthy")db = _mock_db()- await worker._record_failure(- db, connector=conn, alarm_threshold=3, reason="http_500"- )+ await worker._record_failure(db, connector=conn, alarm_threshold=3, reason="http_500")db.execute.assert_awaited_once()db.commit.assert_awaited_once()@@ -190,9 +180,7 @@ async def test_record_failure_trips_alarm_at_threshold() -> None:conn = _FakeConnector(oauth_refresh_failures=2, health_status="healthy")db = _mock_db()- await worker._record_failure(- db, connector=conn, alarm_threshold=3, reason="invalid_grant"- )+ await worker._record_failure(db, connector=conn, alarm_threshold=3, reason="invalid_grant")update_call = db.execute.call_args.args[0]compiled = update_call.compile().params@@ -212,9 +200,7 @@ def patched_vault(monkeypatch: pytest.MonkeyPatch) -> CredentialVault:@pytest.mark.asyncio-async def test_refresh_one_happy_path(- patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch-) -> None:+async def test_refresh_one_happy_path(patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch) -> None:"""Successful refresh rotates tokens, zeros counter, restores health."""# Build a connector with an encrypted refresh_token + expires_at.auth_payload = {@@ -255,9 +241,7 @@ async def test_refresh_one_happy_path(with patch("httpx.AsyncClient") as client_cls:client_cls.return_value.__aenter__.return_value.post = mock_post- ok = await worker._refresh_one(- db, connector=conn, timeout_s=5.0, alarm_threshold=3- )+ ok = await worker._refresh_one(db, connector=conn, timeout_s=5.0, alarm_threshold=3)assert ok is Truemock_post.assert_awaited_once()@@ -274,9 +258,7 @@ async def test_refresh_one_happy_path(@pytest.mark.asyncio-async def test_refresh_one_4xx_records_failure(- patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch-) -> None:+async def test_refresh_one_4xx_records_failure(patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch) -> None:"""A 4xx (e.g. invalid_grant) trips the failure path with the status code."""auth_payload = {"refresh_token": "revoked-refresh",@@ -301,19 +283,13 @@ async def test_refresh_one_4xx_records_failure(bad_response = MagicMock()bad_response.status_code = 400bad_response.text = '{"error":"invalid_grant"}'- bad_response.raise_for_status = MagicMock(- side_effect=httpx.HTTPStatusError(- "400", request=MagicMock(), response=bad_response- )- )+ bad_response.raise_for_status = MagicMock(side_effect=httpx.HTTPStatusError("400", request=MagicMock(), response=bad_response))mock_post = AsyncMock(return_value=bad_response)with patch("httpx.AsyncClient") as client_cls:client_cls.return_value.__aenter__.return_value.post = mock_post- ok = await worker._refresh_one(- db, connector=conn, timeout_s=5.0, alarm_threshold=3- )+ ok = await worker._refresh_one(db, connector=conn, timeout_s=5.0, alarm_threshold=3)assert ok is False# Last UPDATE should set health_status=unhealthy because we crossed 3.@@ -324,9 +300,7 @@ async def test_refresh_one_4xx_records_failure(@pytest.mark.asyncio-async def test_refresh_one_network_error_no_alarm_yet(- patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch-) -> None:+async def test_refresh_one_network_error_no_alarm_yet(patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch) -> None:"""A transient ``ConnectError`` increments the counter without alarming."""auth_payload = {"refresh_token": "ok"}conn = _FakeConnector(@@ -348,9 +322,7 @@ async def test_refresh_one_network_error_no_alarm_yet(with patch("httpx.AsyncClient") as client_cls:client_cls.return_value.__aenter__.return_value.post = mock_post- ok = await worker._refresh_one(- db, connector=conn, timeout_s=5.0, alarm_threshold=3- )+ ok = await worker._refresh_one(db, connector=conn, timeout_s=5.0, alarm_threshold=3)assert ok is Falselast_update = db.execute.call_args_list[-1].args[0]@@ -360,9 +332,7 @@ async def test_refresh_one_network_error_no_alarm_yet(@pytest.mark.asyncio-async def test_refresh_one_missing_app_credential(- patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch-) -> None:+async def test_refresh_one_missing_app_credential(patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch) -> None:"""No OAuthAppCredential row → record failure with that reason, no POST."""auth_payload = {"refresh_token": "ok"}conn = _FakeConnector(@@ -378,9 +348,7 @@ async def test_refresh_one_missing_app_credential()with patch("httpx.AsyncClient") as client_cls:- ok = await worker._refresh_one(- db, connector=conn, timeout_s=5.0, alarm_threshold=3- )+ ok = await worker._refresh_one(db, connector=conn, timeout_s=5.0, alarm_threshold=3)assert ok is False# We never reached the POST step.@@ -391,9 +359,7 @@ async def test_refresh_one_missing_app_credential(@pytest.mark.asyncio-async def test_refresh_one_missing_token_url(- patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch-) -> None:+async def test_refresh_one_missing_token_url(patched_vault: CredentialVault, monkeypatch: pytest.MonkeyPatch) -> None:"""Token URL unresolvable → failure recorded, no POST."""auth_payload = {"refresh_token": "ok"}conn = _FakeConnector(@@ -412,9 +378,7 @@ async def test_refresh_one_missing_token_url()with patch("httpx.AsyncClient") as client_cls:- ok = await worker._refresh_one(- db, connector=conn, timeout_s=5.0, alarm_threshold=3- )+ ok = await worker._refresh_one(db, connector=conn, timeout_s=5.0, alarm_threshold=3)assert ok is Falseclient_cls.assert_not_called()@@ -455,9 +419,7 @@ async def test_refresh_one_keeps_existing_refresh_token_when_provider_omits(with patch("httpx.AsyncClient") as client_cls:client_cls.return_value.__aenter__.return_value.post = mock_post- ok = await worker._refresh_one(- db, connector=conn, timeout_s=5.0, alarm_threshold=3- )+ ok = await worker._refresh_one(db, connector=conn, timeout_s=5.0, alarm_threshold=3)assert ok is True# Decrypt the auth_config we wrote and verify refresh_token survived.@@ -479,9 +441,7 @@ async def test_run_forever_exits_on_stop_event(import asynciomonkeypatch.setattr(worker.settings, "OAUTH_REFRESH_INTERVAL_SECONDS", 5)- monkeypatch.setattr(- worker, "run_once", AsyncMock(return_value={"checked": 0, "refreshed": 0, "failed": 0})- )+ monkeypatch.setattr(worker, "run_once", AsyncMock(return_value={"checked": 0, "refreshed": 0, "failed": 0}))stop = asyncio.Event()stop.set()diff --git a/services/api/tests/test_override_learning.py b/services/api/tests/test_override_learning.pyindex 337a7adff..b1f103aa9 100644--- a/services/api/tests/test_override_learning.py+++ b/services/api/tests/test_override_learning.py@@ -153,10 +153,7 @@ class TestFindRedispositionCandidates:connector_type="crowdstrike",primary_technique="T1059",)- rows = [- _alert(category="malware", connector_type="crowdstrike", techniques=["T1059"])- for _ in range(20)- ]+ rows = [_alert(category="malware", connector_type="crowdstrike", techniques=["T1059"]) for _ in range(20)]scalars_result = MagicMock()scalars_result.all = MagicMock(return_value=rows)db = MagicMock()diff --git a/services/api/tests/test_saved_views_endpoint.py b/services/api/tests/test_saved_views_endpoint.pyindex fd6279e46..d2820ed6e 100644--- a/services/api/tests/test_saved_views_endpoint.py+++ b/services/api/tests/test_saved_views_endpoint.py@@ -42,6 +42,7 @@ from types import SimpleNamespacefrom typing import Anyfrom unittest.mock import AsyncMock, MagicMock+import pydanticimport pytestfrom app.api.v1.endpoints.saved_views import (CreateSavedViewRequest,@@ -59,7 +60,6 @@ from app.api.v1.endpoints.saved_views import (from fastapi import HTTPExceptionfrom sqlalchemy.exc import IntegrityError-# ---------------------------------------------------------------------------# Test fixtures / helpers# ---------------------------------------------------------------------------@@ -280,14 +280,14 @@ def test_create_request_rejects_empty_name() -> None:*also* strips and re-checks (covered separately) so a whitespace-only string is caught even if pydantic accepts it."""- with pytest.raises(Exception): # pydantic.ValidationError, but importing for the type is overkill+ with pytest.raises(pydantic.ValidationError): # pydantic.ValidationError, but importing for the type is overkillCreateSavedViewRequest(view_type="alerts", name="")def test_update_request_extra_fields_forbidden() -> None:"""Unknown PATCH keys are rejected — defends against typos like``is_defualt`` silently being a no-op."""- with pytest.raises(Exception):+ with pytest.raises(pydantic.ValidationError):UpdateSavedViewRequest(unknown_field="oops")@@ -412,9 +412,7 @@ def _mock_db_for_create(*, integrity_error: bool = False) -> MagicMock:db.execute = AsyncMock()db.add = MagicMock()if integrity_error:- db.flush = AsyncMock(- side_effect=IntegrityError("duplicate", None, BaseException("dup"))- )+ db.flush = AsyncMock(side_effect=IntegrityError("duplicate", None, BaseException("dup")))else:db.flush = AsyncMock()db.commit = AsyncMock()@@ -559,9 +557,7 @@ def _mock_db_for_update(db.scalar = AsyncMock(return_value=existing_row)db.execute = AsyncMock()if integrity_error:- db.flush = AsyncMock(- side_effect=IntegrityError("duplicate", None, BaseException("dup"))- )+ db.flush = AsyncMock(side_effect=IntegrityError("duplicate", None, BaseException("dup")))else:db.flush = AsyncMock()db.commit = AsyncMock()diff --git a/services/connectors/app/connectors/aws_security_hub.py b/services/connectors/app/connectors/aws_security_hub.pyindex 3c45368f2..7f40a3901 100644--- a/services/connectors/app/connectors/aws_security_hub.py+++ b/services/connectors/app/connectors/aws_security_hub.py@@ -51,7 +51,13 @@ class AWSSecurityHubConnector(BaseConnector):def capabilities(cls) -> tuple[Capability, ...]:# Security Hub aggregates findings from GuardDuty/Inspector/Macie/3p partners,# which we surface to the agent layer as alerts.- return (Capability.PULL_ALERTS,)+ # WS-E2: Live AWS Security Groups network blocking actions now wired+ # via services/actions/app/clients/aws_security_groups.py+ return (+ Capability.PULL_ALERTS,+ Capability.BLOCK_IP,+ Capability.ALLOW_IP,+ )def __init__(self, region: str = "us-east-1", access_key: str = "", secret_key: str = ""):self._region = regiondiff --git a/services/connectors/app/connectors/azure_defender.py b/services/connectors/app/connectors/azure_defender.pyindex 7634b05cf..9d21f9295 100644--- a/services/connectors/app/connectors/azure_defender.py+++ b/services/connectors/app/connectors/azure_defender.py@@ -67,7 +67,15 @@ class AzureDefenderConnector(BaseConnector):@classmethoddef capabilities(cls) -> tuple[Capability, ...]:# Microsoft 365 Defender unified alerts feed.- return (Capability.PULL_ALERTS,)+ # WS-E4: Live Microsoft Defender for Endpoint response actions now wired+ # via services/actions/app/clients/defender_client.py+ return (+ Capability.PULL_ALERTS,+ Capability.ISOLATE_HOST,+ Capability.UNISOLATE_HOST,+ Capability.BLOCK_IOC,+ Capability.RUN_AV_SCAN,+ )def __init__(self, tenant_id: str, client_id: str, client_secret: str):self._tenant_id = tenant_iddiff --git a/services/connectors/app/connectors/base.py b/services/connectors/app/connectors/base.pyindex 085557f4f..a782263f1 100644--- a/services/connectors/app/connectors/base.py+++ b/services/connectors/app/connectors/base.py@@ -101,6 +101,24 @@ class Capability(str, Enum):RESET_PASSWORD = "reset_password"REVOKE_TOKEN = "revoke_token"+ # WS-E: additional live vendor action verbs+ # CrowdStrike Falcon RTR+ RUN_SCRIPT = "run_script"+ # AWS / Network+ BLOCK_IP = "block_ip"+ ALLOW_IP = "allow_ip"+ # Microsoft Defender for Endpoint+ BLOCK_IOC = "block_ioc"+ RUN_AV_SCAN = "run_av_scan"+ # Okta identity response+ SUSPEND_SESSION = "suspend_session"+ FORCE_MFA = "force_mfa"+ # SIEM response (Splunk + Elastic)+ SEARCH_SIEM = "search_siem"+ CREATE_NOTABLE_EVENT = "create_notable_event"+ SYNC_DETECTION_RULE = "sync_detection_rule"+ UPDATE_WATCHER = "update_watcher"+# TICKET — bidirectional ITSM (Jira / ServiceNow / etc.).PUSH_CASE = "push_case"PUSH_STATUS = "push_status"diff --git a/services/connectors/app/connectors/crowdstrike.py b/services/connectors/app/connectors/crowdstrike.pyindex e6dfc0954..df8c3bc72 100644--- a/services/connectors/app/connectors/crowdstrike.py+++ b/services/connectors/app/connectors/crowdstrike.py@@ -23,11 +23,16 @@ class CrowdStrikeConnector(BaseConnector):@classmethoddef capabilities(cls) -> tuple[Capability, ...]:- # Honest declaration: today the runtime only implements ``fetch_alerts``.- # ``ISOLATE_HOST`` / ``KILL_PROCESS`` belong here once we wire the- # corresponding Falcon Real-Time-Response endpoints — declaring them- # before the methods exist would be a lie to the agent layer.- return (Capability.PULL_ALERTS,)+ # WS-E1: Live CrowdStrike Falcon RTR — all response actions now wired+ # via services/actions/app/clients/crowdstrike_rtr.py+ return (+ Capability.PULL_ALERTS,+ Capability.ISOLATE_HOST,+ Capability.UNISOLATE_HOST,+ Capability.KILL_PROCESS,+ Capability.QUARANTINE_FILE,+ Capability.RUN_SCRIPT,+ )@classmethoddef schema(cls) -> ConnectorSchema:diff --git a/services/connectors/app/connectors/elastic.py b/services/connectors/app/connectors/elastic.pyindex 153ad17cf..21807dc9d 100644--- a/services/connectors/app/connectors/elastic.py+++ b/services/connectors/app/connectors/elastic.py@@ -75,7 +75,15 @@ class ElasticConnector(BaseConnector):def capabilities(cls) -> tuple[Capability, ...]:# Elastic SIEM exposes detection alerts plus an ES|QL search surface# we federate against — the latter maps cleanly to QUERY_LOGS.- return (Capability.PULL_ALERTS, Capability.QUERY_LOGS)+ # WS-E6: Live Elastic Security / Elasticsearch response actions now wired+ # via services/actions/app/clients/elastic_client.py+ return (+ Capability.PULL_ALERTS,+ Capability.QUERY_LOGS,+ Capability.SEARCH_SIEM,+ Capability.SYNC_DETECTION_RULE,+ Capability.UPDATE_WATCHER,+ )def __init__(self,diff --git a/services/connectors/app/connectors/okta.py b/services/connectors/app/connectors/okta.pyindex c19220b6e..305a3fa48 100644--- a/services/connectors/app/connectors/okta.py+++ b/services/connectors/app/connectors/okta.py@@ -59,7 +59,16 @@ class OktaConnector(BaseConnector):@classmethoddef capabilities(cls) -> tuple[Capability, ...]:# Okta System Log streams identity audit events (logins, MFA, admin actions).- return (Capability.PULL_AUDIT,)+ # WS-E3: Live Okta Management API response actions now wired+ # via services/actions/app/clients/okta_client.py+ return (+ Capability.PULL_AUDIT,+ Capability.DISABLE_USER,+ Capability.RESET_PASSWORD,+ Capability.SUSPEND_SESSION,+ Capability.FORCE_MFA,+ Capability.REVOKE_SESSION,+ )def __init__(self, domain: str, api_token: str):self._domain = domain.rstrip("/")diff --git a/services/connectors/app/connectors/splunk.py b/services/connectors/app/connectors/splunk.pyindex 396460a36..23e49a4c0 100644--- a/services/connectors/app/connectors/splunk.py+++ b/services/connectors/app/connectors/splunk.py@@ -62,7 +62,14 @@ class SplunkConnector(BaseConnector):def capabilities(cls) -> tuple[Capability, ...]:# Splunk surfaces notable events (alerts) and supports federated SPL# search over indexes — the latter maps to QUERY_LOGS.- return (Capability.PULL_ALERTS, Capability.QUERY_LOGS)+ # WS-E5: Live Splunk REST API response actions now wired+ # via services/actions/app/clients/splunk_client.py+ return (+ Capability.PULL_ALERTS,+ Capability.QUERY_LOGS,+ Capability.SEARCH_SIEM,+ Capability.CREATE_NOTABLE_EVENT,+ )def __init__(self,diff --git a/services/slack-bot/poetry.lock b/services/slack-bot/poetry.locknew file mode 100644index 000000000..4a83be301--- /dev/null+++ b/services/slack-bot/poetry.lock@@ -0,0 +1,1737 @@+# This file is automatically @generated by Poetry 2.4.1 and should not be changed by hand.++[[package]]+name = "aiohappyeyeballs"+version = "2.6.1"+description = "Happy Eyeballs for asyncio"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8"},+ {file = "aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558"},+]++[[package]]+name = "aiohttp"+version = "3.13.5"+description = "Async http client/server framework (asyncio)"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "aiohttp-3.13.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:02222e7e233295f40e011c1b00e3b0bd451f22cf853a0304c3595633ee47da4b"},+ {file = "aiohttp-3.13.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:bace460460ed20614fa6bc8cb09966c0b8517b8c58ad8046828c6078d25333b5"},+ {file = "aiohttp-3.13.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f546a4dc1e6a5edbb9fd1fd6ad18134550e096a5a43f4ad74acfbd834fc6670"},+ {file = "aiohttp-3.13.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c86969d012e51b8e415a8c6ce96f7857d6a87d6207303ab02d5d11ef0cad2274"},+ {file = "aiohttp-3.13.5-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b6f6cd1560c5fa427e3b6074bb24d2c64e225afbb7165008903bd42e4e33e28a"},+ {file = "aiohttp-3.13.5-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:636bc362f0c5bbc7372bc3ae49737f9e3030dbce469f0f422c8f38079780363d"},+ {file = "aiohttp-3.13.5-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:6a7cbeb06d1070f1d14895eeeed4dac5913b22d7b456f2eb969f11f4b3993796"},+ {file = "aiohttp-3.13.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bca9ef7517fd7874a1a08970ae88f497bf5c984610caa0bf40bd7e8450852b95"},+ {file = "aiohttp-3.13.5-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:019a67772e034a0e6b9b17c13d0a8fe56ad9fb150fc724b7f3ffd3724288d9e5"},+ {file = "aiohttp-3.13.5-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:f34ecee82858e41dd217734f0c41a532bd066bcaab636ad830f03a30b2a96f2a"},+ {file = "aiohttp-3.13.5-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:4eac02d9af4813ee289cd63a361576da36dba57f5a1ab36377bc2600db0cbb73"},+ {file = "aiohttp-3.13.5-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:4beac52e9fe46d6abf98b0176a88154b742e878fdf209d2248e99fcdf73cd297"},+ {file = "aiohttp-3.13.5-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:c180f480207a9b2475f2b8d8bd7204e47aec952d084b2a2be58a782ffcf96074"},+ {file = "aiohttp-3.13.5-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:2837fb92951564d6339cedae4a7231692aa9f73cbc4fb2e04263b96844e03b4e"},+ {file = "aiohttp-3.13.5-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d9010032a0b9710f58012a1e9c222528763d860ba2ee1422c03473eab47703e7"},+ {file = "aiohttp-3.13.5-cp310-cp310-win32.whl", hash = "sha256:7c4b6668b2b2b9027f209ddf647f2a4407784b5d88b8be4efcc72036f365baf9"},+ {file = "aiohttp-3.13.5-cp310-cp310-win_amd64.whl", hash = "sha256:cd3db5927bf9167d5a6157ddb2f036f6b6b0ad001ac82355d43e97a4bde76d76"},+ {file = "aiohttp-3.13.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7ab7229b6f9b5c1ba4910d6c41a9eb11f543eadb3f384df1b4c293f4e73d44d6"},+ {file = "aiohttp-3.13.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8f14c50708bb156b3a3ca7230b3d820199d56a48e3af76fa21c2d6087190fe3d"},+ {file = "aiohttp-3.13.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e7d2f8616f0ff60bd332022279011776c3ac0faa0f1b463f7bb12326fbc97a1c"},+ {file = "aiohttp-3.13.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a2567b72e1ffc3ab25510db43f355b29eeada56c0a622e58dcdb19530eb0a3cb"},+ {file = "aiohttp-3.13.5-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:fb0540c854ac9c0c5ad495908fdfd3e332d553ec731698c0e29b1877ba0d2ec6"},+ {file = "aiohttp-3.13.5-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c9883051c6972f58bfc4ebb2116345ee2aa151178e99c3f2b2bbe2af712abd13"},+ {file = "aiohttp-3.13.5-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2294172ce08a82fb7c7273485895de1fa1186cc8294cfeb6aef4af42ad261174"},+ {file = "aiohttp-3.13.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3a807cabd5115fb55af198b98178997a5e0e57dead43eb74a93d9c07d6d4a7dc"},+ {file = "aiohttp-3.13.5-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aa6d0d932e0f39c02b80744273cd5c388a2d9bc07760a03164f229c8e02662f6"},+ {file = "aiohttp-3.13.5-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:60869c7ac4aaabe7110f26499f3e6e5696eae98144735b12a9c3d9eae2b51a49"},+ {file = "aiohttp-3.13.5-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:26d2f8546f1dfa75efa50c3488215a903c0168d253b75fba4210f57ab77a0fb8"},+ {file = "aiohttp-3.13.5-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:f1162a1492032c82f14271e831c8f4b49f2b6078f4f5fc74de2c912fa225d51d"},+ {file = "aiohttp-3.13.5-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:8b14eb3262fad0dc2f89c1a43b13727e709504972186ff6a99a3ecaa77102b6c"},+ {file = "aiohttp-3.13.5-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:ca9ac61ac6db4eb6c2a0cd1d0f7e1357647b638ccc92f7e9d8d133e71ed3c6ac"},+ {file = "aiohttp-3.13.5-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:7996023b2ed59489ae4762256c8516df9820f751cf2c5da8ed2fb20ee50abab3"},+ {file = "aiohttp-3.13.5-cp311-cp311-win32.whl", hash = "sha256:77dfa48c9f8013271011e51c00f8ada19851f013cde2c48fca1ba5e0caf5bb06"},+ {file = "aiohttp-3.13.5-cp311-cp311-win_amd64.whl", hash = "sha256:d3a4834f221061624b8887090637db9ad4f61752001eae37d56c52fddade2dc8"},+ {file = "aiohttp-3.13.5-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:023ecba036ddd840b0b19bf195bfae970083fd7024ce1ac22e9bba90464620e9"},+ {file = "aiohttp-3.13.5-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:15c933ad7920b7d9a20de151efcd05a6e38302cbf0e10c9b2acb9a42210a2416"},+ {file = "aiohttp-3.13.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ab2899f9fa2f9f741896ebb6fa07c4c883bfa5c7f2ddd8cf2aafa86fa981b2d2"},+ {file = "aiohttp-3.13.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a60eaa2d440cd4707696b52e40ed3e2b0f73f65be07fd0ef23b6b539c9c0b0b4"},+ {file = "aiohttp-3.13.5-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:55b3bdd3292283295774ab585160c4004f4f2f203946997f49aac032c84649e9"},+ {file = "aiohttp-3.13.5-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c2b2355dc094e5f7d45a7bb262fe7207aa0460b37a0d87027dcf21b5d890e7d5"},+ {file = "aiohttp-3.13.5-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b38765950832f7d728297689ad78f5f2cf79ff82487131c4d26fe6ceecdc5f8e"},+ {file = "aiohttp-3.13.5-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b18f31b80d5a33661e08c89e202edabf1986e9b49c42b4504371daeaa11b47c1"},+ {file = "aiohttp-3.13.5-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:33add2463dde55c4f2d9635c6ab33ce154e5ecf322bd26d09af95c5f81cfa286"},+ {file = "aiohttp-3.13.5-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:327cc432fdf1356fb4fbc6fe833ad4e9f6aacb71a8acaa5f1855e4b25910e4a9"},+ {file = "aiohttp-3.13.5-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:7c35b0bf0b48a70b4cb4fc5d7bed9b932532728e124874355de1a0af8ec4bc88"},+ {file = "aiohttp-3.13.5-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:df23d57718f24badef8656c49743e11a89fd6f5358fa8a7b96e728fda2abf7d3"},+ {file = "aiohttp-3.13.5-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:02e048037a6501a5ec1f6fc9736135aec6eb8a004ce48838cb951c515f32c80b"},+ {file = "aiohttp-3.13.5-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:31cebae8b26f8a615d2b546fee45d5ffb76852ae6450e2a03f42c9102260d6fe"},+ {file = "aiohttp-3.13.5-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:888e78eb5ca55a615d285c3c09a7a91b42e9dd6fc699b166ebd5dee87c9ccf14"},+ {file = "aiohttp-3.13.5-cp312-cp312-win32.whl", hash = "sha256:8bd3ec6376e68a41f9f95f5ed170e2fcf22d4eb27a1f8cb361d0508f6e0557f3"},+ {file = "aiohttp-3.13.5-cp312-cp312-win_amd64.whl", hash = "sha256:110e448e02c729bcebb18c60b9214a87ba33bac4a9fa5e9a5f139938b56c6cb1"},+ {file = "aiohttp-3.13.5-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a5029cc80718bbd545123cd8fe5d15025eccaaaace5d0eeec6bd556ad6163d61"},+ {file = "aiohttp-3.13.5-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4bb6bf5811620003614076bdc807ef3b5e38244f9d25ca5fe888eaccea2a9832"},+ {file = "aiohttp-3.13.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:a84792f8631bf5a94e52d9cc881c0b824ab42717165a5579c760b830d9392ac9"},+ {file = "aiohttp-3.13.5-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:57653eac22c6a4c13eb22ecf4d673d64a12f266e72785ab1c8b8e5940d0e8090"},+ {file = "aiohttp-3.13.5-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e5e5f7debc7a57af53fdf5c5009f9391d9f4c12867049d509bf7bb164a6e295b"},+ {file = "aiohttp-3.13.5-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c719f65bebcdf6716f10e9eff80d27567f7892d8988c06de12bbbd39307c6e3a"},+ {file = "aiohttp-3.13.5-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d97f93fdae594d886c5a866636397e2bcab146fd7a132fd6bb9ce182224452f8"},+ {file = "aiohttp-3.13.5-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3df334e39d4c2f899a914f1dba283c1aadc311790733f705182998c6f7cae665"},+ {file = "aiohttp-3.13.5-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:fe6970addfea9e5e081401bcbadf865d2b6da045472f58af08427e108d618540"},+ {file = "aiohttp-3.13.5-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7becdf835feff2f4f335d7477f121af787e3504b48b449ff737afb35869ba7bb"},+ {file = "aiohttp-3.13.5-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:676e5651705ad5d8a70aeb8eb6936c436d8ebbd56e63436cb7dd9bb36d2a9a46"},+ {file = "aiohttp-3.13.5-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:9b16c653d38eb1a611cc898c41e76859ca27f119d25b53c12875fd0474ae31a8"},+ {file = "aiohttp-3.13.5-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:999802d5fa0389f58decd24b537c54aa63c01c3219ce17d1214cbda3c2b22d2d"},+ {file = "aiohttp-3.13.5-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:ec707059ee75732b1ba130ed5f9580fe10ff75180c812bc267ded039db5128c6"},+ {file = "aiohttp-3.13.5-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2d6d44a5b48132053c2f6cd5c8cb14bc67e99a63594e336b0f2af81e94d5530c"},+ {file = "aiohttp-3.13.5-cp313-cp313-win32.whl", hash = "sha256:329f292ed14d38a6c4c435e465f48bebb47479fd676a0411936cc371643225cc"},+ {file = "aiohttp-3.13.5-cp313-cp313-win_amd64.whl", hash = "sha256:69f571de7500e0557801c0b51f4780482c0ec5fe2ac851af5a92cfce1af1cb83"},+ {file = "aiohttp-3.13.5-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:eb4639f32fd4a9904ab8fb45bf3383ba71137f3d9d4ba25b3b3f3109977c5b8c"},+ {file = "aiohttp-3.13.5-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:7e5dc4311bd5ac493886c63cbf76ab579dbe4641268e7c74e48e774c74b6f2be"},+ {file = "aiohttp-3.13.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:756c3c304d394977519824449600adaf2be0ccee76d206ee339c5e76b70ded25"},+ {file = "aiohttp-3.13.5-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ecc26751323224cf8186efcf7fbcbc30f4e1d8c7970659daf25ad995e4032a56"},+ {file = "aiohttp-3.13.5-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:10a75acfcf794edf9d8db50e5a7ec5fc818b2a8d3f591ce93bc7b1210df016d2"},+ {file = "aiohttp-3.13.5-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0f7a18f258d124cd678c5fe072fe4432a4d5232b0657fca7c1847f599233c83a"},+ {file = "aiohttp-3.13.5-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:df6104c009713d3a89621096f3e3e88cc323fd269dbd7c20afe18535094320be"},+ {file = "aiohttp-3.13.5-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:241a94f7de7c0c3b616627aaad530fe2cb620084a8b144d3be7b6ecfe95bae3b"},+ {file = "aiohttp-3.13.5-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c974fb66180e58709b6fc402846f13791240d180b74de81d23913abe48e96d94"},+ {file = "aiohttp-3.13.5-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:6e27ea05d184afac78aabbac667450c75e54e35f62238d44463131bd3f96753d"},+ {file = "aiohttp-3.13.5-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:a79a6d399cef33a11b6f004c67bb07741d91f2be01b8d712d52c75711b1e07c7"},+ {file = "aiohttp-3.13.5-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:c632ce9c0b534fbe25b52c974515ed674937c5b99f549a92127c85f771a78772"},+ {file = "aiohttp-3.13.5-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:fceedde51fbd67ee2bcc8c0b33d0126cc8b51ef3bbde2f86662bd6d5a6f10ec5"},+ {file = "aiohttp-3.13.5-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:f92995dfec9420bb69ae629abf422e516923ba79ba4403bc750d94fb4a6c68c1"},+ {file = "aiohttp-3.13.5-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:20ae0ff08b1f2c8788d6fb85afcb798654ae6ba0b747575f8562de738078457b"},+ {file = "aiohttp-3.13.5-cp314-cp314-win32.whl", hash = "sha256:b20df693de16f42b2472a9c485e1c948ee55524786a0a34345511afdd22246f3"},+ {file = "aiohttp-3.13.5-cp314-cp314-win_amd64.whl", hash = "sha256:f85c6f327bf0b8c29da7d93b1cabb6363fb5e4e160a32fa241ed2dce21b73162"},+ {file = "aiohttp-3.13.5-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:1efb06900858bb618ff5cee184ae2de5828896c448403d51fb633f09e109be0a"},+ {file = "aiohttp-3.13.5-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:fee86b7c4bd29bdaf0d53d14739b08a106fdda809ca5fe032a15f52fae5fe254"},+ {file = "aiohttp-3.13.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:20058e23909b9e65f9da62b396b77dfa95965cbe840f8def6e572538b1d32e36"},+ {file = "aiohttp-3.13.5-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8cf20a8d6868cb15a73cab329ffc07291ba8c22b1b88176026106ae39aa6df0f"},+ {file = "aiohttp-3.13.5-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:330f5da04c987f1d5bdb8ae189137c77139f36bd1cb23779ca1a354a4b027800"},+ {file = "aiohttp-3.13.5-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6f1cbf0c7926d315c3c26c2da41fd2b5d2fe01ac0e157b78caefc51a782196cf"},+ {file = "aiohttp-3.13.5-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:53fc049ed6390d05423ba33103ded7281fe897cf97878f369a527070bd95795b"},+ {file = "aiohttp-3.13.5-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:898703aa2667e3c5ca4c54ca36cd73f58b7a38ef87a5606414799ebce4d3fd3a"},+ {file = "aiohttp-3.13.5-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0494a01ca9584eea1e5fbd6d748e61ecff218c51b576ee1999c23db7066417d8"},+ {file = "aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:6cf81fe010b8c17b09495cbd15c1d35afbc8fb405c0c9cf4738e5ae3af1d65be"},+ {file = "aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:c564dd5f09ddc9d8f2c2d0a301cd30a79a2cc1b46dd1a73bef8f0038863d016b"},+ {file = "aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:2994be9f6e51046c4f864598fd9abeb4fba6e88f0b2152422c9666dcd4aea9c6"},+ {file = "aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:157826e2fa245d2ef46c83ea8a5faf77ca19355d278d425c29fda0beb3318037"},+ {file = "aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:a8aca50daa9493e9e13c0f566201a9006f080e7c50e5e90d0b06f53146a54500"},+ {file = "aiohttp-3.13.5-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:3b13560160d07e047a93f23aaa30718606493036253d5430887514715b67c9d9"},+ {file = "aiohttp-3.13.5-cp314-cp314t-win32.whl", hash = "sha256:9a0f4474b6ea6818b41f82172d799e4b3d29e22c2c520ce4357856fced9af2f8"},+ {file = "aiohttp-3.13.5-cp314-cp314t-win_amd64.whl", hash = "sha256:18a2f6c1182c51baa1d28d68fea51513cb2a76612f038853c0ad3c145423d3d9"},+ {file = "aiohttp-3.13.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:347542f0ea3f95b2a955ee6656461fa1c776e401ac50ebce055a6c38454a0adf"},+ {file = "aiohttp-3.13.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:178c7b5e62b454c2bc790786e6058c3cc968613b4419251b478c153a4aec32b1"},+ {file = "aiohttp-3.13.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:af545c2cffdb0967a96b6249e6f5f7b0d92cdfd267f9d5238d5b9ca63e8edb10"},+ {file = "aiohttp-3.13.5-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:206b7b3ef96e4ce211754f0cd003feb28b7d81f0ad26b8d077a5d5161436067f"},+ {file = "aiohttp-3.13.5-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:ee5e86776273de1795947d17bddd6bb19e0365fd2af4289c0d2c5454b6b1d36b"},+ {file = "aiohttp-3.13.5-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:95d14ca7abefde230f7639ec136ade282655431fd5db03c343b19dda72dd1643"},+ {file = "aiohttp-3.13.5-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:912d4b6af530ddb1338a66229dac3a25ff11d4448be3ec3d6340583995f56031"},+ {file = "aiohttp-3.13.5-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e999f0c88a458c836d5fb521814e92ed2172c649200336a6df514987c1488258"},+ {file = "aiohttp-3.13.5-cp39-cp39-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:39380e12bd1f2fdab4285b6e055ad48efbaed5c836433b142ed4f5b9be71036a"},+ {file = "aiohttp-3.13.5-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:9efcc0f11d850cefcafdd9275b9576ad3bfb539bed96807663b32ad99c4d4b88"},+ {file = "aiohttp-3.13.5-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:147b4f501d0292077f29d5268c16bb7c864a1f054d7001c4c1812c0421ea1ed0"},+ {file = "aiohttp-3.13.5-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:d147004fede1b12f6013a6dbb2a26a986a671a03c6ea740ddc76500e5f1c399f"},+ {file = "aiohttp-3.13.5-cp39-cp39-musllinux_1_2_riscv64.whl", hash = "sha256:9277145d36a01653863899c665243871434694bcc3431922c3b35c978061bdb8"},+ {file = "aiohttp-3.13.5-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:4e704c52438f66fdd89588346183d898bb42167cf88f8b7ff1c0f9fc957c348f"},+ {file = "aiohttp-3.13.5-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:a8a4d3427e8de1312ddf309cc482186466c79895b3a139fed3259fc01dfa9a5b"},+ {file = "aiohttp-3.13.5-cp39-cp39-win32.whl", hash = "sha256:6f497a6876aa4b1a102b04996ce4c1170c7040d83faa9387dd921c16e30d5c83"},+ {file = "aiohttp-3.13.5-cp39-cp39-win_amd64.whl", hash = "sha256:cb979826071c0986a5f08333a36104153478ce6018c58cba7f9caddaf63d5d67"},+ {file = "aiohttp-3.13.5.tar.gz", hash = "sha256:9d98cc980ecc96be6eb4c1994ce35d28d8b1f5e5208a23b421187d1209dbb7d1"},+]++[package.dependencies]+aiohappyeyeballs = ">=2.5.0"+aiosignal = ">=1.4.0"+attrs = ">=17.3.0"+frozenlist = ">=1.1.1"+multidict = ">=4.5,<7.0"+propcache = ">=0.2.0"+yarl = ">=1.17.0,<2.0"++[package.extras]+speedups = ["Brotli (>=1.2) ; platform_python_implementation == \"CPython\"", "aiodns (>=3.3.0)", "backports.zstd ; platform_python_implementation == \"CPython\" and python_version < \"3.14\"", "brotlicffi (>=1.2) ; platform_python_implementation != \"CPython\""]++[[package]]+name = "aiosignal"+version = "1.4.0"+description = "aiosignal: a list of registered asynchronous callbacks"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "aiosignal-1.4.0-py3-none-any.whl", hash = "sha256:053243f8b92b990551949e63930a839ff0cf0b0ebbe0597b0f3fb19e1a0fe82e"},+ {file = "aiosignal-1.4.0.tar.gz", hash = "sha256:f47eecd9468083c2029cc99945502cb7708b082c232f9aca65da147157b251c7"},+]++[package.dependencies]+frozenlist = ">=1.1.0"+typing-extensions = {version = ">=4.2", markers = "python_version < \"3.13\""}++[[package]]+name = "annotated-doc"+version = "0.0.4"+description = "Document parameters, class attributes, return types, and variables inline, with Annotated."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320"},+ {file = "annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4"},+]++[[package]]+name = "annotated-types"+version = "0.7.0"+description = "Reusable constraint types to use with typing.Annotated"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"},+ {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"},+]++[[package]]+name = "anyio"+version = "4.13.0"+description = "High-level concurrency and networking framework on top of asyncio or Trio"+optional = false+python-versions = ">=3.10"+groups = ["main", "dev"]+files = [+ {file = "anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708"},+ {file = "anyio-4.13.0.tar.gz", hash = "sha256:334b70e641fd2221c1505b3890c69882fe4a2df910cba14d97019b90b24439dc"},+]++[package.dependencies]+idna = ">=2.8"+typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""}++[package.extras]+trio = ["trio (>=0.32.0)"]++[[package]]+name = "attrs"+version = "26.1.0"+description = "Classes Without Boilerplate"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "attrs-26.1.0-py3-none-any.whl", hash = "sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309"},+ {file = "attrs-26.1.0.tar.gz", hash = "sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32"},+]++[[package]]+name = "certifi"+version = "2026.4.22"+description = "Python package for providing Mozilla's CA Bundle."+optional = false+python-versions = ">=3.7"+groups = ["main", "dev"]+files = [+ {file = "certifi-2026.4.22-py3-none-any.whl", hash = "sha256:3cb2210c8f88ba2318d29b0388d1023c8492ff72ecdde4ebdaddbb13a31b1c4a"},+ {file = "certifi-2026.4.22.tar.gz", hash = "sha256:8d455352a37b71bf76a79caa83a3d6c25afee4a385d632127b6afb3963f1c580"},+]++[[package]]+name = "click"+version = "8.3.3"+description = "Composable command line interface toolkit"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "click-8.3.3-py3-none-any.whl", hash = "sha256:a2bf429bb3033c89fa4936ffb35d5cb471e3719e1f3c8a7c3fff0b8314305613"},+ {file = "click-8.3.3.tar.gz", hash = "sha256:398329ad4837b2ff7cbe1dd166a4c0f8900c3ca3a218de04466f38f6497f18a2"},+]++[package.dependencies]+colorama = {version = "*", markers = "platform_system == \"Windows\""}++[[package]]+name = "colorama"+version = "0.4.6"+description = "Cross-platform colored terminal text."+optional = false+python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"+groups = ["main", "dev"]+files = [+ {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},+ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},+]+markers = {main = "platform_system == \"Windows\" or sys_platform == \"win32\"", dev = "sys_platform == \"win32\""}++[[package]]+name = "fastapi"+version = "0.136.1"+description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "fastapi-0.136.1-py3-none-any.whl", hash = "sha256:a6e9d7eeada96c93a4d69cb03836b44fa34e2854accb7244a1ece36cd4781c3f"},+ {file = "fastapi-0.136.1.tar.gz", hash = "sha256:7af665ad7acfa0a3baf8983d393b6b471b9da10ede59c60045f49fbc89a0fa7f"},+]++[package.dependencies]+annotated-doc = ">=0.0.2"+pydantic = ">=2.9.0"+starlette = ">=0.46.0"+typing-extensions = ">=4.8.0"+typing-inspection = ">=0.4.2"++[package.extras]+all = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.8)", "httpx (>=0.23.0,<1.0.0)", "itsdangerous (>=1.1.0)", "jinja2 (>=3.1.5)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "pyyaml (>=5.3.1)", "uvicorn[standard] (>=0.12.0)"]+standard = ["email-validator (>=2.0.0)", "fastapi-cli[standard] (>=0.0.8)", "fastar (>=0.9.0)", "httpx (>=0.23.0,<1.0.0)", "jinja2 (>=3.1.5)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"]+standard-no-fastapi-cloud-cli = ["email-validator (>=2.0.0)", "fastapi-cli[standard-no-fastapi-cloud-cli] (>=0.0.8)", "httpx (>=0.23.0,<1.0.0)", "jinja2 (>=3.1.5)", "pydantic-extra-types (>=2.0.0)", "pydantic-settings (>=2.0.0)", "python-multipart (>=0.0.18)", "uvicorn[standard] (>=0.12.0)"]++[[package]]+name = "frozenlist"+version = "1.8.0"+description = "A list-like structure which implements collections.abc.MutableSequence"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "frozenlist-1.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:b37f6d31b3dcea7deb5e9696e529a6aa4a898adc33db82da12e4c60a7c4d2011"},+ {file = "frozenlist-1.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ef2b7b394f208233e471abc541cc6991f907ffd47dc72584acee3147899d6565"},+ {file = "frozenlist-1.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:a88f062f072d1589b7b46e951698950e7da00442fc1cacbe17e19e025dc327ad"},+ {file = "frozenlist-1.8.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f57fb59d9f385710aa7060e89410aeb5058b99e62f4d16b08b91986b9a2140c2"},+ {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:799345ab092bee59f01a915620b5d014698547afd011e691a208637312db9186"},+ {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c23c3ff005322a6e16f71bf8692fcf4d5a304aaafe1e262c98c6d4adc7be863e"},+ {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8a76ea0f0b9dfa06f254ee06053d93a600865b3274358ca48a352ce4f0798450"},+ {file = "frozenlist-1.8.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c7366fe1418a6133d5aa824ee53d406550110984de7637d65a178010f759c6ef"},+ {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:13d23a45c4cebade99340c4165bd90eeb4a56c6d8a9d8aa49568cac19a6d0dc4"},+ {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:e4a3408834f65da56c83528fb52ce7911484f0d1eaf7b761fc66001db1646eff"},+ {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:42145cd2748ca39f32801dad54aeea10039da6f86e303659db90db1c4b614c8c"},+ {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:e2de870d16a7a53901e41b64ffdf26f2fbb8917b3e6ebf398098d72c5b20bd7f"},+ {file = "frozenlist-1.8.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:20e63c9493d33ee48536600d1a5c95eefc870cd71e7ab037763d1fbb89cc51e7"},+ {file = "frozenlist-1.8.0-cp310-cp310-win32.whl", hash = "sha256:adbeebaebae3526afc3c96fad434367cafbfd1b25d72369a9e5858453b1bb71a"},+ {file = "frozenlist-1.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:667c3777ca571e5dbeb76f331562ff98b957431df140b54c85fd4d52eea8d8f6"},+ {file = "frozenlist-1.8.0-cp310-cp310-win_arm64.whl", hash = "sha256:80f85f0a7cc86e7a54c46d99c9e1318ff01f4687c172ede30fd52d19d1da1c8e"},+ {file = "frozenlist-1.8.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:09474e9831bc2b2199fad6da3c14c7b0fbdd377cce9d3d77131be28906cb7d84"},+ {file = "frozenlist-1.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:17c883ab0ab67200b5f964d2b9ed6b00971917d5d8a92df149dc2c9779208ee9"},+ {file = "frozenlist-1.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fa47e444b8ba08fffd1c18e8cdb9a75db1b6a27f17507522834ad13ed5922b93"},+ {file = "frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2552f44204b744fba866e573be4c1f9048d6a324dfe14475103fd51613eb1d1f"},+ {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:957e7c38f250991e48a9a73e6423db1bb9dd14e722a10f6b8bb8e16a0f55f695"},+ {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:8585e3bb2cdea02fc88ffa245069c36555557ad3609e83be0ec71f54fd4abb52"},+ {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:edee74874ce20a373d62dc28b0b18b93f645633c2943fd90ee9d898550770581"},+ {file = "frozenlist-1.8.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c9a63152fe95756b85f31186bddf42e4c02c6321207fd6601a1c89ebac4fe567"},+ {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:b6db2185db9be0a04fecf2f241c70b63b1a242e2805be291855078f2b404dd6b"},+ {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:f4be2e3d8bc8aabd566f8d5b8ba7ecc09249d74ba3c9ed52e54dc23a293f0b92"},+ {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:c8d1634419f39ea6f5c427ea2f90ca85126b54b50837f31497f3bf38266e853d"},+ {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:1a7fa382a4a223773ed64242dbe1c9c326ec09457e6b8428efb4118c685c3dfd"},+ {file = "frozenlist-1.8.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:11847b53d722050808926e785df837353bd4d75f1d494377e59b23594d834967"},+ {file = "frozenlist-1.8.0-cp311-cp311-win32.whl", hash = "sha256:27c6e8077956cf73eadd514be8fb04d77fc946a7fe9f7fe167648b0b9085cc25"},+ {file = "frozenlist-1.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:ac913f8403b36a2c8610bbfd25b8013488533e71e62b4b4adce9c86c8cea905b"},+ {file = "frozenlist-1.8.0-cp311-cp311-win_arm64.whl", hash = "sha256:d4d3214a0f8394edfa3e303136d0575eece0745ff2b47bd2cb2e66dd92d4351a"},+ {file = "frozenlist-1.8.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:78f7b9e5d6f2fdb88cdde9440dc147259b62b9d3b019924def9f6478be254ac1"},+ {file = "frozenlist-1.8.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:229bf37d2e4acdaf808fd3f06e854a4a7a3661e871b10dc1f8f1896a3b05f18b"},+ {file = "frozenlist-1.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f833670942247a14eafbb675458b4e61c82e002a148f49e68257b79296e865c4"},+ {file = "frozenlist-1.8.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:494a5952b1c597ba44e0e78113a7266e656b9794eec897b19ead706bd7074383"},+ {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:96f423a119f4777a4a056b66ce11527366a8bb92f54e541ade21f2374433f6d4"},+ {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3462dd9475af2025c31cc61be6652dfa25cbfb56cbbf52f4ccfe029f38decaf8"},+ {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c4c800524c9cd9bac5166cd6f55285957fcfc907db323e193f2afcd4d9abd69b"},+ {file = "frozenlist-1.8.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d6a5df73acd3399d893dafc71663ad22534b5aa4f94e8a2fabfe856c3c1b6a52"},+ {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:405e8fe955c2280ce66428b3ca55e12b3c4e9c336fb2103a4937e891c69a4a29"},+ {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:908bd3f6439f2fef9e85031b59fd4f1297af54415fb60e4254a95f75b3cab3f3"},+ {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:294e487f9ec720bd8ffcebc99d575f7eff3568a08a253d1ee1a0378754b74143"},+ {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:74c51543498289c0c43656701be6b077f4b265868fa7f8a8859c197006efb608"},+ {file = "frozenlist-1.8.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:776f352e8329135506a1d6bf16ac3f87bc25b28e765949282dcc627af36123aa"},+ {file = "frozenlist-1.8.0-cp312-cp312-win32.whl", hash = "sha256:433403ae80709741ce34038da08511d4a77062aa924baf411ef73d1146e74faf"},+ {file = "frozenlist-1.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:34187385b08f866104f0c0617404c8eb08165ab1272e884abc89c112e9c00746"},+ {file = "frozenlist-1.8.0-cp312-cp312-win_arm64.whl", hash = "sha256:fe3c58d2f5db5fbd18c2987cba06d51b0529f52bc3a6cdc33d3f4eab725104bd"},+ {file = "frozenlist-1.8.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:8d92f1a84bb12d9e56f818b3a746f3efba93c1b63c8387a73dde655e1e42282a"},+ {file = "frozenlist-1.8.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:96153e77a591c8adc2ee805756c61f59fef4cf4073a9275ee86fe8cba41241f7"},+ {file = "frozenlist-1.8.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f21f00a91358803399890ab167098c131ec2ddd5f8f5fd5fe9c9f2c6fcd91e40"},+ {file = "frozenlist-1.8.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:fb30f9626572a76dfe4293c7194a09fb1fe93ba94c7d4f720dfae3b646b45027"},+ {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eaa352d7047a31d87dafcacbabe89df0aa506abb5b1b85a2fb91bc3faa02d822"},+ {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:03ae967b4e297f58f8c774c7eabcce57fe3c2434817d4385c50661845a058121"},+ {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f6292f1de555ffcc675941d65fffffb0a5bcd992905015f85d0592201793e0e5"},+ {file = "frozenlist-1.8.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29548f9b5b5e3460ce7378144c3010363d8035cea44bc0bf02d57f5a685e084e"},+ {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ec3cc8c5d4084591b4237c0a272cc4f50a5b03396a47d9caaf76f5d7b38a4f11"},+ {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:517279f58009d0b1f2e7c1b130b377a349405da3f7621ed6bfae50b10adf20c1"},+ {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:db1e72ede2d0d7ccb213f218df6a078a9c09a7de257c2fe8fcef16d5925230b1"},+ {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:b4dec9482a65c54a5044486847b8a66bf10c9cb4926d42927ec4e8fd5db7fed8"},+ {file = "frozenlist-1.8.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:21900c48ae04d13d416f0e1e0c4d81f7931f73a9dfa0b7a8746fb2fe7dd970ed"},+ {file = "frozenlist-1.8.0-cp313-cp313-win32.whl", hash = "sha256:8b7b94a067d1c504ee0b16def57ad5738701e4ba10cec90529f13fa03c833496"},+ {file = "frozenlist-1.8.0-cp313-cp313-win_amd64.whl", hash = "sha256:878be833caa6a3821caf85eb39c5ba92d28e85df26d57afb06b35b2efd937231"},+ {file = "frozenlist-1.8.0-cp313-cp313-win_arm64.whl", hash = "sha256:44389d135b3ff43ba8cc89ff7f51f5a0bb6b63d829c8300f79a2fe4fe61bcc62"},+ {file = "frozenlist-1.8.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:e25ac20a2ef37e91c1b39938b591457666a0fa835c7783c3a8f33ea42870db94"},+ {file = "frozenlist-1.8.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:07cdca25a91a4386d2e76ad992916a85038a9b97561bf7a3fd12d5d9ce31870c"},+ {file = "frozenlist-1.8.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:4e0c11f2cc6717e0a741f84a527c52616140741cd812a50422f83dc31749fb52"},+ {file = "frozenlist-1.8.0-cp313-cp313t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:b3210649ee28062ea6099cfda39e147fa1bc039583c8ee4481cb7811e2448c51"},+ {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:581ef5194c48035a7de2aefc72ac6539823bb71508189e5de01d60c9dcd5fa65"},+ {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3ef2d026f16a2b1866e1d86fc4e1291e1ed8a387b2c333809419a2f8b3a77b82"},+ {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5500ef82073f599ac84d888e3a8c1f77ac831183244bfd7f11eaa0289fb30714"},+ {file = "frozenlist-1.8.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:50066c3997d0091c411a66e710f4e11752251e6d2d73d70d8d5d4c76442a199d"},+ {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:5c1c8e78426e59b3f8005e9b19f6ff46e5845895adbde20ece9218319eca6506"},+ {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:eefdba20de0d938cec6a89bd4d70f346a03108a19b9df4248d3cf0d88f1b0f51"},+ {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:cf253e0e1c3ceb4aaff6df637ce033ff6535fb8c70a764a8f46aafd3d6ab798e"},+ {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:032efa2674356903cd0261c4317a561a6850f3ac864a63fc1583147fb05a79b0"},+ {file = "frozenlist-1.8.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6da155091429aeba16851ecb10a9104a108bcd32f6c1642867eadaee401c1c41"},+ {file = "frozenlist-1.8.0-cp313-cp313t-win32.whl", hash = "sha256:0f96534f8bfebc1a394209427d0f8a63d343c9779cda6fc25e8e121b5fd8555b"},+ {file = "frozenlist-1.8.0-cp313-cp313t-win_amd64.whl", hash = "sha256:5d63a068f978fc69421fb0e6eb91a9603187527c86b7cd3f534a5b77a592b888"},+ {file = "frozenlist-1.8.0-cp313-cp313t-win_arm64.whl", hash = "sha256:bf0a7e10b077bf5fb9380ad3ae8ce20ef919a6ad93b4552896419ac7e1d8e042"},+ {file = "frozenlist-1.8.0-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:cee686f1f4cadeb2136007ddedd0aaf928ab95216e7691c63e50a8ec066336d0"},+ {file = "frozenlist-1.8.0-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:119fb2a1bd47307e899c2fac7f28e85b9a543864df47aa7ec9d3c1b4545f096f"},+ {file = "frozenlist-1.8.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:4970ece02dbc8c3a92fcc5228e36a3e933a01a999f7094ff7c23fbd2beeaa67c"},+ {file = "frozenlist-1.8.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cba69cb73723c3f329622e34bdbf5ce1f80c21c290ff04256cff1cd3c2036ed2"},+ {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:778a11b15673f6f1df23d9586f83c4846c471a8af693a22e066508b77d201ec8"},+ {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0325024fe97f94c41c08872db482cf8ac4800d80e79222c6b0b7b162d5b13686"},+ {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:97260ff46b207a82a7567b581ab4190bd4dfa09f4db8a8b49d1a958f6aa4940e"},+ {file = "frozenlist-1.8.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:54b2077180eb7f83dd52c40b2750d0a9f175e06a42e3213ce047219de902717a"},+ {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:2f05983daecab868a31e1da44462873306d3cbfd76d1f0b5b69c473d21dbb128"},+ {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:33f48f51a446114bc5d251fb2954ab0164d5be02ad3382abcbfe07e2531d650f"},+ {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:154e55ec0655291b5dd1b8731c637ecdb50975a2ae70c606d100750a540082f7"},+ {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:4314debad13beb564b708b4a496020e5306c7333fa9a3ab90374169a20ffab30"},+ {file = "frozenlist-1.8.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:073f8bf8becba60aa931eb3bc420b217bb7d5b8f4750e6f8b3be7f3da85d38b7"},+ {file = "frozenlist-1.8.0-cp314-cp314-win32.whl", hash = "sha256:bac9c42ba2ac65ddc115d930c78d24ab8d4f465fd3fc473cdedfccadb9429806"},+ {file = "frozenlist-1.8.0-cp314-cp314-win_amd64.whl", hash = "sha256:3e0761f4d1a44f1d1a47996511752cf3dcec5bbdd9cc2b4fe595caf97754b7a0"},+ {file = "frozenlist-1.8.0-cp314-cp314-win_arm64.whl", hash = "sha256:d1eaff1d00c7751b7c6662e9c5ba6eb2c17a2306ba5e2a37f24ddf3cc953402b"},+ {file = "frozenlist-1.8.0-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:d3bb933317c52d7ea5004a1c442eef86f426886fba134ef8cf4226ea6ee1821d"},+ {file = "frozenlist-1.8.0-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:8009897cdef112072f93a0efdce29cd819e717fd2f649ee3016efd3cd885a7ed"},+ {file = "frozenlist-1.8.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:2c5dcbbc55383e5883246d11fd179782a9d07a986c40f49abe89ddf865913930"},+ {file = "frozenlist-1.8.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:39ecbc32f1390387d2aa4f5a995e465e9e2f79ba3adcac92d68e3e0afae6657c"},+ {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:92db2bf818d5cc8d9c1f1fc56b897662e24ea5adb36ad1f1d82875bd64e03c24"},+ {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2dc43a022e555de94c3b68a4ef0b11c4f747d12c024a520c7101709a2144fb37"},+ {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:cb89a7f2de3602cfed448095bab3f178399646ab7c61454315089787df07733a"},+ {file = "frozenlist-1.8.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:33139dc858c580ea50e7e60a1b0ea003efa1fd42e6ec7fdbad78fff65fad2fd2"},+ {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:168c0969a329b416119507ba30b9ea13688fafffac1b7822802537569a1cb0ef"},+ {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:28bd570e8e189d7f7b001966435f9dac6718324b5be2990ac496cf1ea9ddb7fe"},+ {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b2a095d45c5d46e5e79ba1e5b9cb787f541a8dee0433836cea4b96a2c439dcd8"},+ {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:eab8145831a0d56ec9c4139b6c3e594c7a83c2c8be25d5bcf2d86136a532287a"},+ {file = "frozenlist-1.8.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:974b28cf63cc99dfb2188d8d222bc6843656188164848c4f679e63dae4b0708e"},+ {file = "frozenlist-1.8.0-cp314-cp314t-win32.whl", hash = "sha256:342c97bf697ac5480c0a7ec73cd700ecfa5a8a40ac923bd035484616efecc2df"},+ {file = "frozenlist-1.8.0-cp314-cp314t-win_amd64.whl", hash = "sha256:06be8f67f39c8b1dc671f5d83aaefd3358ae5cdcf8314552c57e7ed3e6475bdd"},+ {file = "frozenlist-1.8.0-cp314-cp314t-win_arm64.whl", hash = "sha256:102e6314ca4da683dca92e3b1355490fed5f313b768500084fbe6371fddfdb79"},+ {file = "frozenlist-1.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d8b7138e5cd0647e4523d6685b0eac5d4be9a184ae9634492f25c6eb38c12a47"},+ {file = "frozenlist-1.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a6483e309ca809f1efd154b4d37dc6d9f61037d6c6a81c2dc7a15cb22c8c5dca"},+ {file = "frozenlist-1.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1b9290cf81e95e93fdf90548ce9d3c1211cf574b8e3f4b3b7cb0537cf2227068"},+ {file = "frozenlist-1.8.0-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:59a6a5876ca59d1b63af8cd5e7ffffb024c3dc1e9cf9301b21a2e76286505c95"},+ {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6dc4126390929823e2d2d9dc79ab4046ed74680360fc5f38b585c12c66cdf459"},+ {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:332db6b2563333c5671fecacd085141b5800cb866be16d5e3eb15a2086476675"},+ {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9ff15928d62a0b80bb875655c39bf517938c7d589554cbd2669be42d97c2cb61"},+ {file = "frozenlist-1.8.0-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7bf6cdf8e07c8151fba6fe85735441240ec7f619f935a5205953d58009aef8c6"},+ {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:48e6d3f4ec5c7273dfe83ff27c91083c6c9065af655dc2684d2c200c94308bb5"},+ {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:1a7607e17ad33361677adcd1443edf6f5da0ce5e5377b798fba20fae194825f3"},+ {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:5a3a935c3a4e89c733303a2d5a7c257ea44af3a56c8202df486b7f5de40f37e1"},+ {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:940d4a017dbfed9daf46a3b086e1d2167e7012ee297fef9e1c545c4d022f5178"},+ {file = "frozenlist-1.8.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:b9be22a69a014bc47e78072d0ecae716f5eb56c15238acca0f43d6eb8e4a5bda"},+ {file = "frozenlist-1.8.0-cp39-cp39-win32.whl", hash = "sha256:1aa77cb5697069af47472e39612976ed05343ff2e84a3dcf15437b232cbfd087"},+ {file = "frozenlist-1.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:7398c222d1d405e796970320036b1b563892b65809d9e5261487bb2c7f7b5c6a"},+ {file = "frozenlist-1.8.0-cp39-cp39-win_arm64.whl", hash = "sha256:b4f3b365f31c6cd4af24545ca0a244a53688cad8834e32f56831c4923b50a103"},+ {file = "frozenlist-1.8.0-py3-none-any.whl", hash = "sha256:0c18a16eab41e82c295618a77502e17b195883241c563b00f0aa5106fc4eaa0d"},+ {file = "frozenlist-1.8.0.tar.gz", hash = "sha256:3ede829ed8d842f6cd48fc7081d7a41001a56f1f38603f9d49bf3020d59a31ad"},+]++[[package]]+name = "h11"+version = "0.16.0"+description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"+optional = false+python-versions = ">=3.8"+groups = ["main", "dev"]+files = [+ {file = "h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"},+ {file = "h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1"},+]++[[package]]+name = "httpcore"+version = "1.0.9"+description = "A minimal low-level HTTP client."+optional = false+python-versions = ">=3.8"+groups = ["main", "dev"]+files = [+ {file = "httpcore-1.0.9-py3-none-any.whl", hash = "sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"},+ {file = "httpcore-1.0.9.tar.gz", hash = "sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8"},+]++[package.dependencies]+certifi = "*"+h11 = ">=0.16"++[package.extras]+asyncio = ["anyio (>=4.0,<5.0)"]+http2 = ["h2 (>=3,<5)"]+socks = ["socksio (==1.*)"]+trio = ["trio (>=0.22.0,<1.0)"]++[[package]]+name = "httptools"+version = "0.7.1"+description = "A collection of framework independent HTTP protocol utils."+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "httptools-0.7.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:11d01b0ff1fe02c4c32d60af61a4d613b74fad069e47e06e9067758c01e9ac78"},+ {file = "httptools-0.7.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:84d86c1e5afdc479a6fdabf570be0d3eb791df0ae727e8dbc0259ed1249998d4"},+ {file = "httptools-0.7.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:c8c751014e13d88d2be5f5f14fc8b89612fcfa92a9cc480f2bc1598357a23a05"},+ {file = "httptools-0.7.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:654968cb6b6c77e37b832a9be3d3ecabb243bbe7a0b8f65fbc5b6b04c8fcabed"},+ {file = "httptools-0.7.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:b580968316348b474b020edf3988eecd5d6eec4634ee6561e72ae3a2a0e00a8a"},+ {file = "httptools-0.7.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:d496e2f5245319da9d764296e86c5bb6fcf0cf7a8806d3d000717a889c8c0b7b"},+ {file = "httptools-0.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:cbf8317bfccf0fed3b5680c559d3459cccf1abe9039bfa159e62e391c7270568"},+ {file = "httptools-0.7.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:474d3b7ab469fefcca3697a10d11a32ee2b9573250206ba1e50d5980910da657"},+ {file = "httptools-0.7.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:a3c3b7366bb6c7b96bd72d0dbe7f7d5eead261361f013be5f6d9590465ea1c70"},+ {file = "httptools-0.7.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:379b479408b8747f47f3b253326183d7c009a3936518cdb70db58cffd369d9df"},+ {file = "httptools-0.7.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cad6b591a682dcc6cf1397c3900527f9affef1e55a06c4547264796bbd17cf5e"},+ {file = "httptools-0.7.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:eb844698d11433d2139bbeeb56499102143beb582bd6c194e3ba69c22f25c274"},+ {file = "httptools-0.7.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f65744d7a8bdb4bda5e1fa23e4ba16832860606fcc09d674d56e425e991539ec"},+ {file = "httptools-0.7.1-cp311-cp311-win_amd64.whl", hash = "sha256:135fbe974b3718eada677229312e97f3b31f8a9c8ffa3ae6f565bf808d5b6bcb"},+ {file = "httptools-0.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:38e0c83a2ea9746ebbd643bdfb521b9aa4a91703e2cd705c20443405d2fd16a5"},+ {file = "httptools-0.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f25bbaf1235e27704f1a7b86cd3304eabc04f569c828101d94a0e605ef7205a5"},+ {file = "httptools-0.7.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:2c15f37ef679ab9ecc06bfc4e6e8628c32a8e4b305459de7cf6785acd57e4d03"},+ {file = "httptools-0.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7fe6e96090df46b36ccfaf746f03034e5ab723162bc51b0a4cf58305324036f2"},+ {file = "httptools-0.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:f72fdbae2dbc6e68b8239defb48e6a5937b12218e6ffc2c7846cc37befa84362"},+ {file = "httptools-0.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e99c7b90a29fd82fea9ef57943d501a16f3404d7b9ee81799d41639bdaae412c"},+ {file = "httptools-0.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:3e14f530fefa7499334a79b0cf7e7cd2992870eb893526fb097d51b4f2d0f321"},+ {file = "httptools-0.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:6babce6cfa2a99545c60bfef8bee0cc0545413cb0018f617c8059a30ad985de3"},+ {file = "httptools-0.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:601b7628de7504077dd3dcb3791c6b8694bbd967148a6d1f01806509254fb1ca"},+ {file = "httptools-0.7.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:04c6c0e6c5fb0739c5b8a9eb046d298650a0ff38cf42537fc372b28dc7e4472c"},+ {file = "httptools-0.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:69d4f9705c405ae3ee83d6a12283dc9feba8cc6aaec671b412917e644ab4fa66"},+ {file = "httptools-0.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:44c8f4347d4b31269c8a9205d8a5ee2df5322b09bbbd30f8f862185bb6b05346"},+ {file = "httptools-0.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:465275d76db4d554918aba40bf1cbebe324670f3dfc979eaffaa5d108e2ed650"},+ {file = "httptools-0.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:322d00c2068d125bd570f7bf78b2d367dad02b919d8581d7476d8b75b294e3e6"},+ {file = "httptools-0.7.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:c08fe65728b8d70b6923ce31e3956f859d5e1e8548e6f22ec520a962c6757270"},+ {file = "httptools-0.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:7aea2e3c3953521c3c51106ee11487a910d45586e351202474d45472db7d72d3"},+ {file = "httptools-0.7.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0e68b8582f4ea9166be62926077a3334064d422cf08ab87d8b74664f8e9058e1"},+ {file = "httptools-0.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df091cf961a3be783d6aebae963cc9b71e00d57fa6f149025075217bc6a55a7b"},+ {file = "httptools-0.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:f084813239e1eb403ddacd06a30de3d3e09a9b76e7894dcda2b22f8a726e9c60"},+ {file = "httptools-0.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:7347714368fb2b335e9063bc2b96f2f87a9ceffcd9758ac295f8bbcd3ffbc0ca"},+ {file = "httptools-0.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:cfabda2a5bb85aa2a904ce06d974a3f30fb36cc63d7feaddec05d2050acede96"},+ {file = "httptools-0.7.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:ac50afa68945df63ec7a2707c506bd02239272288add34539a2ef527254626a4"},+ {file = "httptools-0.7.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:de987bb4e7ac95b99b805b99e0aae0ad51ae61df4263459d36e07cf4052d8b3a"},+ {file = "httptools-0.7.1-cp39-cp39-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:d169162803a24425eb5e4d51d79cbf429fd7a491b9e570a55f495ea55b26f0bf"},+ {file = "httptools-0.7.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:49794f9250188a57fa73c706b46cb21a313edb00d337ca4ce1a011fe3c760b28"},+ {file = "httptools-0.7.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:aeefa0648362bb97a7d6b5ff770bfb774930a327d7f65f8208394856862de517"},+ {file = "httptools-0.7.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:0d92b10dbf0b3da4823cde6a96d18e6ae358a9daa741c71448975f6a2c339cad"},+ {file = "httptools-0.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:5ddbd045cfcb073db2449563dd479057f2c2b681ebc232380e63ef15edc9c023"},+ {file = "httptools-0.7.1.tar.gz", hash = "sha256:abd72556974f8e7c74a259655924a717a2365b236c882c3f6f8a45fe94703ac9"},+]++[[package]]+name = "httpx"+version = "0.28.1"+description = "The next generation HTTP client."+optional = false+python-versions = ">=3.8"+groups = ["main", "dev"]+files = [+ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"},+ {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"},+]++[package.dependencies]+anyio = "*"+certifi = "*"+httpcore = "==1.*"+idna = "*"++[package.extras]+brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""]+cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]+http2 = ["h2 (>=3,<5)"]+socks = ["socksio (==1.*)"]+zstd = ["zstandard (>=0.18.0)"]++[[package]]+name = "idna"+version = "3.13"+description = "Internationalized Domain Names in Applications (IDNA)"+optional = false+python-versions = ">=3.8"+groups = ["main", "dev"]+files = [+ {file = "idna-3.13-py3-none-any.whl", hash = "sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3"},+ {file = "idna-3.13.tar.gz", hash = "sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242"},+]++[package.extras]+all = ["mypy (>=1.11.2)", "pytest (>=8.3.2)", "ruff (>=0.6.2)"]++[[package]]+name = "iniconfig"+version = "2.3.0"+description = "brain-dead simple config-ini parsing"+optional = false+python-versions = ">=3.10"+groups = ["dev"]+files = [+ {file = "iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12"},+ {file = "iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730"},+]++[[package]]+name = "multidict"+version = "6.7.1"+description = "multidict implementation"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "multidict-6.7.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:c93c3db7ea657dd4637d57e74ab73de31bccefe144d3d4ce370052035bc85fb5"},+ {file = "multidict-6.7.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:974e72a2474600827abaeda71af0c53d9ebbc3c2eb7da37b37d7829ae31232d8"},+ {file = "multidict-6.7.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:cdea2e7b2456cfb6694fb113066fd0ec7ea4d67e3a35e1f4cbeea0b448bf5872"},+ {file = "multidict-6.7.1-cp310-cp310-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17207077e29342fdc2c9a82e4b306f1127bf1ea91f8b71e02d4798a70bb99991"},+ {file = "multidict-6.7.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d4f49cb5661344764e4c7c7973e92a47a59b8fc19b6523649ec9dc4960e58a03"},+ {file = "multidict-6.7.1-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a9fc4caa29e2e6ae408d1c450ac8bf19892c5fca83ee634ecd88a53332c59981"},+ {file = "multidict-6.7.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:c5f0c21549ab432b57dcc82130f388d84ad8179824cc3f223d5e7cfbfd4143f6"},+ {file = "multidict-6.7.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7dfb78d966b2c906ae1d28ccf6e6712a3cd04407ee5088cd276fe8cb42186190"},+ {file = "multidict-6.7.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9b0d9b91d1aa44db9c1f1ecd0d9d2ae610b2f4f856448664e01a3b35899f3f92"},+ {file = "multidict-6.7.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dd96c01a9dcd4889dcfcf9eb5544ca0c77603f239e3ffab0524ec17aea9a93ee"},+ {file = "multidict-6.7.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:067343c68cd6612d375710f895337b3a98a033c94f14b9a99eff902f205424e2"},+ {file = "multidict-6.7.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:5884a04f4ff56c6120f6ccf703bdeb8b5079d808ba604d4d53aec0d55dc33568"},+ {file = "multidict-6.7.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:8affcf1c98b82bc901702eb73b6947a1bfa170823c153fe8a47b5f5f02e48e40"},+ {file = "multidict-6.7.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:0d17522c37d03e85c8098ec8431636309b2682cf12e58f4dbc76121fb50e4962"},+ {file = "multidict-6.7.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:24c0cf81544ca5e17cfcb6e482e7a82cd475925242b308b890c9452a074d4505"},+ {file = "multidict-6.7.1-cp310-cp310-win32.whl", hash = "sha256:d82dd730a95e6643802f4454b8fdecdf08667881a9c5670db85bc5a56693f122"},+ {file = "multidict-6.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:cf37cbe5ced48d417ba045aca1b21bafca67489452debcde94778a576666a1df"},+ {file = "multidict-6.7.1-cp310-cp310-win_arm64.whl", hash = "sha256:59bc83d3f66b41dac1e7460aac1d196edc70c9ba3094965c467715a70ecb46db"},+ {file = "multidict-6.7.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:7ff981b266af91d7b4b3793ca3382e53229088d193a85dfad6f5f4c27fc73e5d"},+ {file = "multidict-6.7.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:844c5bca0b5444adb44a623fb0a1310c2f4cd41f402126bb269cd44c9b3f3e1e"},+ {file = "multidict-6.7.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f2a0a924d4c2e9afcd7ec64f9de35fcd96915149b2216e1cb2c10a56df483855"},+ {file = "multidict-6.7.1-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8be1802715a8e892c784c0197c2ace276ea52702a0ede98b6310c8f255a5afb3"},+ {file = "multidict-6.7.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2e2d2ed645ea29f31c4c7ea1552fcfd7cb7ba656e1eafd4134a6620c9f5fdd9e"},+ {file = "multidict-6.7.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:95922cee9a778659e91db6497596435777bd25ed116701a4c034f8e46544955a"},+ {file = "multidict-6.7.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6b83cabdc375ffaaa15edd97eb7c0c672ad788e2687004990074d7d6c9b140c8"},+ {file = "multidict-6.7.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:38fb49540705369bab8484db0689d86c0a33a0a9f2c1b197f506b71b4b6c19b0"},+ {file = "multidict-6.7.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:439cbebd499f92e9aa6793016a8acaa161dfa749ae86d20960189f5398a19144"},+ {file = "multidict-6.7.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6d3bc717b6fe763b8be3f2bee2701d3c8eb1b2a8ae9f60910f1b2860c82b6c49"},+ {file = "multidict-6.7.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:619e5a1ac57986dbfec9f0b301d865dddf763696435e2962f6d9cf2fdff2bb71"},+ {file = "multidict-6.7.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0b38ebffd9be37c1170d33bc0f36f4f262e0a09bc1aac1c34c7aa51a7293f0b3"},+ {file = "multidict-6.7.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:10ae39c9cfe6adedcdb764f5e8411d4a92b055e35573a2eaa88d3323289ef93c"},+ {file = "multidict-6.7.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:25167cc263257660290fba06b9318d2026e3c910be240a146e1f66dd114af2b0"},+ {file = "multidict-6.7.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:128441d052254f42989ef98b7b6a6ecb1e6f708aa962c7984235316db59f50fa"},+ {file = "multidict-6.7.1-cp311-cp311-win32.whl", hash = "sha256:d62b7f64ffde3b99d06b707a280db04fb3855b55f5a06df387236051d0668f4a"},+ {file = "multidict-6.7.1-cp311-cp311-win_amd64.whl", hash = "sha256:bdbf9f3b332abd0cdb306e7c2113818ab1e922dc84b8f8fd06ec89ed2a19ab8b"},+ {file = "multidict-6.7.1-cp311-cp311-win_arm64.whl", hash = "sha256:b8c990b037d2fff2f4e33d3f21b9b531c5745b33a49a7d6dbe7a177266af44f6"},+ {file = "multidict-6.7.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:a90f75c956e32891a4eda3639ce6dd86e87105271f43d43442a3aedf3cddf172"},+ {file = "multidict-6.7.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:3fccb473e87eaa1382689053e4a4618e7ba7b9b9b8d6adf2027ee474597128cd"},+ {file = "multidict-6.7.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:b0fa96985700739c4c7853a43c0b3e169360d6855780021bfc6d0f1ce7c123e7"},+ {file = "multidict-6.7.1-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cb2a55f408c3043e42b40cc8eecd575afa27b7e0b956dfb190de0f8499a57a53"},+ {file = "multidict-6.7.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:eb0ce7b2a32d09892b3dd6cc44877a0d02a33241fafca5f25c8b6b62374f8b75"},+ {file = "multidict-6.7.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c3a32d23520ee37bf327d1e1a656fec76a2edd5c038bf43eddfa0572ec49c60b"},+ {file = "multidict-6.7.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c90fed18bffc0189ba814749fdcc102b536e83a9f738a9003e569acd540a733"},+ {file = "multidict-6.7.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:da62917e6076f512daccfbbde27f46fed1c98fee202f0559adec8ee0de67f71a"},+ {file = "multidict-6.7.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bfde23ef6ed9db7eaee6c37dcec08524cb43903c60b285b172b6c094711b3961"},+ {file = "multidict-6.7.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3758692429e4e32f1ba0df23219cd0b4fc0a52f476726fff9337d1a57676a582"},+ {file = "multidict-6.7.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:398c1478926eca669f2fd6a5856b6de9c0acf23a2cb59a14c0ba5844fa38077e"},+ {file = "multidict-6.7.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:c102791b1c4f3ab36ce4101154549105a53dc828f016356b3e3bcae2e3a039d3"},+ {file = "multidict-6.7.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:a088b62bd733e2ad12c50dad01b7d0166c30287c166e137433d3b410add807a6"},+ {file = "multidict-6.7.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:3d51ff4785d58d3f6c91bdbffcb5e1f7ddfda557727043aa20d20ec4f65e324a"},+ {file = "multidict-6.7.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:fc5907494fccf3e7d3f94f95c91d6336b092b5fc83811720fae5e2765890dfba"},+ {file = "multidict-6.7.1-cp312-cp312-win32.whl", hash = "sha256:28ca5ce2fd9716631133d0e9a9b9a745ad7f60bac2bccafb56aa380fc0b6c511"},+ {file = "multidict-6.7.1-cp312-cp312-win_amd64.whl", hash = "sha256:fcee94dfbd638784645b066074b338bc9cc155d4b4bffa4adce1615c5a426c19"},+ {file = "multidict-6.7.1-cp312-cp312-win_arm64.whl", hash = "sha256:ba0a9fb644d0c1a2194cf7ffb043bd852cea63a57f66fbd33959f7dae18517bf"},+ {file = "multidict-6.7.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:2b41f5fed0ed563624f1c17630cb9941cf2309d4df00e494b551b5f3e3d67a23"},+ {file = "multidict-6.7.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:84e61e3af5463c19b67ced91f6c634effb89ef8bfc5ca0267f954451ed4bb6a2"},+ {file = "multidict-6.7.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:935434b9853c7c112eee7ac891bc4cb86455aa631269ae35442cb316790c1445"},+ {file = "multidict-6.7.1-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:432feb25a1cb67fe82a9680b4d65fb542e4635cb3166cd9c01560651ad60f177"},+ {file = "multidict-6.7.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e82d14e3c948952a1a85503817e038cba5905a3352de76b9a465075d072fba23"},+ {file = "multidict-6.7.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:4cfb48c6ea66c83bcaaf7e4dfa7ec1b6bbcf751b7db85a328902796dfde4c060"},+ {file = "multidict-6.7.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1d540e51b7e8e170174555edecddbd5538105443754539193e3e1061864d444d"},+ {file = "multidict-6.7.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:273d23f4b40f3dce4d6c8a821c741a86dec62cded82e1175ba3d99be128147ed"},+ {file = "multidict-6.7.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9d624335fd4fa1c08a53f8b4be7676ebde19cd092b3895c421045ca87895b429"},+ {file = "multidict-6.7.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:12fad252f8b267cc75b66e8fc51b3079604e8d43a75428ffe193cd9e2195dfd6"},+ {file = "multidict-6.7.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:03ede2a6ffbe8ef936b92cb4529f27f42be7f56afcdab5ab739cd5f27fb1cbf9"},+ {file = "multidict-6.7.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:90efbcf47dbe33dcf643a1e400d67d59abeac5db07dc3f27d6bdeae497a2198c"},+ {file = "multidict-6.7.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5c4b9bfc148f5a91be9244d6264c53035c8a0dcd2f51f1c3c6e30e30ebaa1c84"},+ {file = "multidict-6.7.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:401c5a650f3add2472d1d288c26deebc540f99e2fb83e9525007a74cd2116f1d"},+ {file = "multidict-6.7.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:97891f3b1b3ffbded884e2916cacf3c6fc87b66bb0dde46f7357404750559f33"},+ {file = "multidict-6.7.1-cp313-cp313-win32.whl", hash = "sha256:e1c5988359516095535c4301af38d8a8838534158f649c05dd1050222321bcb3"},+ {file = "multidict-6.7.1-cp313-cp313-win_amd64.whl", hash = "sha256:960c83bf01a95b12b08fd54324a4eb1d5b52c88932b5cba5d6e712bb3ed12eb5"},+ {file = "multidict-6.7.1-cp313-cp313-win_arm64.whl", hash = "sha256:563fe25c678aaba333d5399408f5ec3c383ca5b663e7f774dd179a520b8144df"},+ {file = "multidict-6.7.1-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:c76c4bec1538375dad9d452d246ca5368ad6e1c9039dadcf007ae59c70619ea1"},+ {file = "multidict-6.7.1-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:57b46b24b5d5ebcc978da4ec23a819a9402b4228b8a90d9c656422b4bdd8a963"},+ {file = "multidict-6.7.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:e954b24433c768ce78ab7929e84ccf3422e46deb45a4dc9f93438f8217fa2d34"},+ {file = "multidict-6.7.1-cp313-cp313t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3bd231490fa7217cc832528e1cd8752a96f0125ddd2b5749390f7c3ec8721b65"},+ {file = "multidict-6.7.1-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:253282d70d67885a15c8a7716f3a73edf2d635793ceda8173b9ecc21f2fb8292"},+ {file = "multidict-6.7.1-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b4c48648d7649c9335cf1927a8b87fa692de3dcb15faa676c6a6f1f1aabda43"},+ {file = "multidict-6.7.1-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:98bc624954ec4d2c7cb074b8eefc2b5d0ce7d482e410df446414355d158fe4ca"},+ {file = "multidict-6.7.1-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:1b99af4d9eec0b49927b4402bcbb58dea89d3e0db8806a4086117019939ad3dd"},+ {file = "multidict-6.7.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6aac4f16b472d5b7dc6f66a0d49dd57b0e0902090be16594dc9ebfd3d17c47e7"},+ {file = "multidict-6.7.1-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:21f830fe223215dffd51f538e78c172ed7c7f60c9b96a2bf05c4848ad49921c3"},+ {file = "multidict-6.7.1-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:f5dd81c45b05518b9aa4da4aa74e1c93d715efa234fd3e8a179df611cc85e5f4"},+ {file = "multidict-6.7.1-cp313-cp313t-musllinux_1_2_i686.whl", hash = "sha256:eb304767bca2bb92fb9c5bd33cedc95baee5bb5f6c88e63706533a1c06ad08c8"},+ {file = "multidict-6.7.1-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:c9035dde0f916702850ef66460bc4239d89d08df4d02023a5926e7446724212c"},+ {file = "multidict-6.7.1-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:af959b9beeb66c822380f222f0e0a1889331597e81f1ded7f374f3ecb0fd6c52"},+ {file = "multidict-6.7.1-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:41f2952231456154ee479651491e94118229844dd7226541788be783be2b5108"},+ {file = "multidict-6.7.1-cp313-cp313t-win32.whl", hash = "sha256:df9f19c28adcb40b6aae30bbaa1478c389efd50c28d541d76760199fc1037c32"},+ {file = "multidict-6.7.1-cp313-cp313t-win_amd64.whl", hash = "sha256:d54ecf9f301853f2c5e802da559604b3e95bb7a3b01a9c295c6ee591b9882de8"},+ {file = "multidict-6.7.1-cp313-cp313t-win_arm64.whl", hash = "sha256:5a37ca18e360377cfda1d62f5f382ff41f2b8c4ccb329ed974cc2e1643440118"},+ {file = "multidict-6.7.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8f333ec9c5eb1b7105e3b84b53141e66ca05a19a605368c55450b6ba208cb9ee"},+ {file = "multidict-6.7.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:a407f13c188f804c759fc6a9f88286a565c242a76b27626594c133b82883b5c2"},+ {file = "multidict-6.7.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0e161ddf326db5577c3a4cc2d8648f81456e8a20d40415541587a71620d7a7d1"},+ {file = "multidict-6.7.1-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:1e3a8bb24342a8201d178c3b4984c26ba81a577c80d4d525727427460a50c22d"},+ {file = "multidict-6.7.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:97231140a50f5d447d3164f994b86a0bed7cd016e2682f8650d6a9158e14fd31"},+ {file = "multidict-6.7.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6b10359683bd8806a200fd2909e7c8ca3a7b24ec1d8132e483d58e791d881048"},+ {file = "multidict-6.7.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:283ddac99f7ac25a4acadbf004cb5ae34480bbeb063520f70ce397b281859362"},+ {file = "multidict-6.7.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:538cec1e18c067d0e6103aa9a74f9e832904c957adc260e61cd9d8cf0c3b3d37"},+ {file = "multidict-6.7.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7eee46ccb30ff48a1e35bb818cc90846c6be2b68240e42a78599166722cea709"},+ {file = "multidict-6.7.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:fa263a02f4f2dd2d11a7b1bb4362aa7cb1049f84a9235d31adf63f30143469a0"},+ {file = "multidict-6.7.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:2e1425e2f99ec5bd36c15a01b690a1a2456209c5deed58f95469ffb46039ccbb"},+ {file = "multidict-6.7.1-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:497394b3239fc6f0e13a78a3e1b61296e72bf1c5f94b4c4eb80b265c37a131cd"},+ {file = "multidict-6.7.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:233b398c29d3f1b9676b4b6f75c518a06fcb2ea0b925119fb2c1bc35c05e1601"},+ {file = "multidict-6.7.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:93b1818e4a6e0930454f0f2af7dfce69307ca03cdcfb3739bf4d91241967b6c1"},+ {file = "multidict-6.7.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f33dc2a3abe9249ea5d8360f969ec7f4142e7ac45ee7014d8f8d5acddf178b7b"},+ {file = "multidict-6.7.1-cp314-cp314-win32.whl", hash = "sha256:3ab8b9d8b75aef9df299595d5388b14530839f6422333357af1339443cff777d"},+ {file = "multidict-6.7.1-cp314-cp314-win_amd64.whl", hash = "sha256:5e01429a929600e7dab7b166062d9bb54a5eed752384c7384c968c2afab8f50f"},+ {file = "multidict-6.7.1-cp314-cp314-win_arm64.whl", hash = "sha256:4885cb0e817aef5d00a2e8451d4665c1808378dc27c2705f1bf4ef8505c0d2e5"},+ {file = "multidict-6.7.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0458c978acd8e6ea53c81eefaddbbee9c6c5e591f41b3f5e8e194780fe026581"},+ {file = "multidict-6.7.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c0abd12629b0af3cf590982c0b413b1e7395cd4ec026f30986818ab95bfaa94a"},+ {file = "multidict-6.7.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:14525a5f61d7d0c94b368a42cff4c9a4e7ba2d52e2672a7b23d84dc86fb02b0c"},+ {file = "multidict-6.7.1-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:17307b22c217b4cf05033dabefe68255a534d637c6c9b0cc8382718f87be4262"},+ {file = "multidict-6.7.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7a7e590ff876a3eaf1c02a4dfe0724b6e69a9e9de6d8f556816f29c496046e59"},+ {file = "multidict-6.7.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:5fa6a95dfee63893d80a34758cd0e0c118a30b8dcb46372bf75106c591b77889"},+ {file = "multidict-6.7.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a0543217a6a017692aa6ae5cc39adb75e587af0f3a82288b1492eb73dd6cc2a4"},+ {file = "multidict-6.7.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f99fe611c312b3c1c0ace793f92464d8cd263cc3b26b5721950d977b006b6c4d"},+ {file = "multidict-6.7.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9004d8386d133b7e6135679424c91b0b854d2d164af6ea3f289f8f2761064609"},+ {file = "multidict-6.7.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e628ef0e6859ffd8273c69412a2465c4be4a9517d07261b33334b5ec6f3c7489"},+ {file = "multidict-6.7.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:841189848ba629c3552035a6a7f5bf3b02eb304e9fea7492ca220a8eda6b0e5c"},+ {file = "multidict-6.7.1-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:ce1bbd7d780bb5a0da032e095c951f7014d6b0a205f8318308140f1a6aba159e"},+ {file = "multidict-6.7.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:b26684587228afed0d50cf804cc71062cc9c1cdf55051c4c6345d372947b268c"},+ {file = "multidict-6.7.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9f9af11306994335398293f9958071019e3ab95e9a707dc1383a35613f6abcb9"},+ {file = "multidict-6.7.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:b4938326284c4f1224178a560987b6cf8b4d38458b113d9b8c1db1a836e640a2"},+ {file = "multidict-6.7.1-cp314-cp314t-win32.whl", hash = "sha256:98655c737850c064a65e006a3df7c997cd3b220be4ec8fe26215760b9697d4d7"},+ {file = "multidict-6.7.1-cp314-cp314t-win_amd64.whl", hash = "sha256:497bde6223c212ba11d462853cfa4f0ae6ef97465033e7dc9940cdb3ab5b48e5"},+ {file = "multidict-6.7.1-cp314-cp314t-win_arm64.whl", hash = "sha256:2bbd113e0d4af5db41d5ebfe9ccaff89de2120578164f86a5d17d5a576d1e5b2"},+ {file = "multidict-6.7.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:65573858d27cdeaca41893185677dc82395159aa28875a8867af66532d413a8f"},+ {file = "multidict-6.7.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c524c6fb8fc342793708ab111c4dbc90ff9abd568de220432500e47e990c0358"},+ {file = "multidict-6.7.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:aa23b001d968faef416ff70dc0f1ab045517b9b42a90edd3e9bcdb06479e31d5"},+ {file = "multidict-6.7.1-cp39-cp39-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:6704fa2b7453b2fb121740555fa1ee20cd98c4d011120caf4d2b8d4e7c76eec0"},+ {file = "multidict-6.7.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:121a34e5bfa410cdf2c8c49716de160de3b1dbcd86b49656f5681e4543bcd1a8"},+ {file = "multidict-6.7.1-cp39-cp39-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:026d264228bcd637d4e060844e39cdc60f86c479e463d49075dedc21b18fbbe0"},+ {file = "multidict-6.7.1-cp39-cp39-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0e697826df7eb63418ee190fd06ce9f1803593bb4b9517d08c60d9b9a7f69d8f"},+ {file = "multidict-6.7.1-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:bb08271280173720e9fea9ede98e5231defcbad90f1624bea26f32ec8a956e2f"},+ {file = "multidict-6.7.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c6b3228e1d80af737b72925ce5fb4daf5a335e49cd7ab77ed7b9fdfbf58c526e"},+ {file = "multidict-6.7.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:3943debf0fbb57bdde5901695c11094a9a36723e5c03875f87718ee15ca2f4d2"},+ {file = "multidict-6.7.1-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:98c5787b0a0d9a41d9311eae44c3b76e6753def8d8870ab501320efe75a6a5f8"},+ {file = "multidict-6.7.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:08ccb2a6dc72009093ebe7f3f073e5ec5964cba9a706fa94b1a1484039b87941"},+ {file = "multidict-6.7.1-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:eb351f72c26dc9abe338ca7294661aa22969ad8ffe7ef7d5541d19f368dc854a"},+ {file = "multidict-6.7.1-cp39-cp39-musllinux_1_2_s390x.whl", hash = "sha256:ac1c665bad8b5d762f5f85ebe4d94130c26965f11de70c708c75671297c776de"},+ {file = "multidict-6.7.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:1fa6609d0364f4f6f58351b4659a1f3e0e898ba2a8c5cac04cb2c7bc556b0bc5"},+ {file = "multidict-6.7.1-cp39-cp39-win32.whl", hash = "sha256:6f77ce314a29263e67adadc7e7c1bc699fcb3a305059ab973d038f87caa42ed0"},+ {file = "multidict-6.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:f537b55778cd3cbee430abe3131255d3a78202e0f9ea7ffc6ada893a4bcaeea4"},+ {file = "multidict-6.7.1-cp39-cp39-win_arm64.whl", hash = "sha256:749aa54f578f2e5f439538706a475aa844bfa8ef75854b1401e6e528e4937cf9"},+ {file = "multidict-6.7.1-py3-none-any.whl", hash = "sha256:55d97cc6dae627efa6a6e548885712d4864b81110ac76fa4e534c03819fa4a56"},+ {file = "multidict-6.7.1.tar.gz", hash = "sha256:ec6652a1bee61c53a3e5776b6049172c53b6aaba34f18c9ad04f82712bac623d"},+]++[[package]]+name = "packaging"+version = "26.2"+description = "Core utilities for Python packages"+optional = false+python-versions = ">=3.8"+groups = ["dev"]+files = [+ {file = "packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"},+ {file = "packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"},+]++[[package]]+name = "pluggy"+version = "1.6.0"+description = "plugin and hook calling mechanisms for python"+optional = false+python-versions = ">=3.9"+groups = ["dev"]+files = [+ {file = "pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746"},+ {file = "pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3"},+]++[package.extras]+dev = ["pre-commit", "tox"]+testing = ["coverage", "pytest", "pytest-benchmark"]++[[package]]+name = "propcache"+version = "0.5.2"+description = "Accelerated property cache"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "propcache-0.5.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d5a81be28596d6559f6131ef33e10200de6e17643b3c74ce03f9eb103be6ae8b"},+ {file = "propcache-0.5.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29cbaac5ea0212663e6845e04b5e188d5a6ae6dd919810ac835bf1d3b42c3f4c"},+ {file = "propcache-0.5.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6bf3be92233808fcd338eba0fb4d0b59ec5772af4f4ecfcec450d1bfc0f8b5eb"},+ {file = "propcache-0.5.2-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2f8ea531c794b9d6274acd4e8d2c2ebcac590a4361d27482edd3010b79f1325e"},+ {file = "propcache-0.5.2-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:decfca4c79dd53ebab484b00cc4b6717d8c369f86e74aa4ca395a64ac651495e"},+ {file = "propcache-0.5.2-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4621064bbf28fa77ff64dd5d94367c04684c67d3a5bf1dff25f0cd0d98a38f3b"},+ {file = "propcache-0.5.2-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b96db7141a592cbc968daf1feea83a118e6ab378af4abbc72b248c895414c22d"},+ {file = "propcache-0.5.2-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1ca071adabaab6e9219924bbe00af821f1ee7de113a9eca1cdc292de3d120f4d"},+ {file = "propcache-0.5.2-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:e4294d04a94dcab1b3bccd8b66d962dcad411a1d19414b2a41d1445f1de32ad0"},+ {file = "propcache-0.5.2-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:a0e399a2eccb91ed18721f86aa85757727400b6865c89e88934781deb9c8498b"},+ {file = "propcache-0.5.2-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:823581fd5cb08b12a48bfa11fe962a7916766b6170c17b028fbdf762b85eb9bf"},+ {file = "propcache-0.5.2-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:949c91d1a990cf3b2e8188dfcfb25005e0b834a06c63fa4ef9f360878ce21ecf"},+ {file = "propcache-0.5.2-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:cc1177027eda740fdb152706bd215a3f124e3eea15afc39f2cb9fe351b50619e"},+ {file = "propcache-0.5.2-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:b05d643f944a8c3c4bd86d65ffd87bf3264b617f87791940302bc474d2ff5274"},+ {file = "propcache-0.5.2-cp310-cp310-win32.whl", hash = "sha256:8114f28879e0904748e831c3a7774261bd9e75f49be089f389a76f959dcd13fe"},+ {file = "propcache-0.5.2-cp310-cp310-win_amd64.whl", hash = "sha256:5fcb98e7598b1ee0addab320d90f65b530297a867dbfe9de52ea838077e16e3d"},+ {file = "propcache-0.5.2-cp310-cp310-win_arm64.whl", hash = "sha256:04dc2390d9edbbaef7461f33322555976ffddf0b650a038649d026358714e6c5"},+ {file = "propcache-0.5.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:74b70780220e2dd89175ca24b81b68b67c83db499ae611e7f2313cb329801c78"},+ {file = "propcache-0.5.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a4840ab0ae0216d952f4b53dc6d0b992bfc2bedbfe360bdd9b548bc184c08959"},+ {file = "propcache-0.5.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c6844ba6364fb12f403928a82cfd295ab103a2b315c77c747b2dbe4a41894ea7"},+ {file = "propcache-0.5.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2293949b855ce597f2826452d17c2d545fb5622379c4ea6fdf525e9b8e8a2511"},+ {file = "propcache-0.5.2-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0fd59b5af35f74da48d905dcbad55449ba13be91823cb05a9bd590bbf5b61660"},+ {file = "propcache-0.5.2-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29f9309a2e42b0d273be006fdb4be2d6c39a47f6f57d8fb1cf9f81481df81b66"},+ {file = "propcache-0.5.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5aaa2b923c1944ac8febd6609cb373540a5563e7cbcb0fd770f75dace2eb817b"},+ {file = "propcache-0.5.2-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:66ea454f095ddf5b6b14f56c064c0941c4788be11e18d2464cf643bf7203ff67"},+ {file = "propcache-0.5.2-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:95f1e3f4760d404b13c9976c0229b2b49a3c8e2c62a9ce92efdd2b11ada75e3f"},+ {file = "propcache-0.5.2-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:85341b12b9d55bad0bded24cac341bb34289469e03a11f3f583ea1cc1db0326c"},+ {file = "propcache-0.5.2-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:26a4dca084132874e639895c3135dfad5eb20bae209f62d1aeb31b03e601c3c0"},+ {file = "propcache-0.5.2-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:3b199b9b2b3d6a7edf3183ba8a9a137a22b97f7df525feb5ae1eccf026d2a9c6"},+ {file = "propcache-0.5.2-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:e59bc9e66329185b93dab73f210f1a37f81cb40f321501db8017c9aea15dba27"},+ {file = "propcache-0.5.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:552ffadf6ad409844bc5919c42a0a83d88314cedddaea0e41e80a8b8fffe881f"},+ {file = "propcache-0.5.2-cp311-cp311-win32.whl", hash = "sha256:cd416c1de191973c52ff1a12a57446bfc7642797b282d7caf2162d7d1b8aa9a0"},+ {file = "propcache-0.5.2-cp311-cp311-win_amd64.whl", hash = "sha256:44e488ef40dbb452700b2b1f8188934121f6648f52c295055662d2191959ff82"},+ {file = "propcache-0.5.2-cp311-cp311-win_arm64.whl", hash = "sha256:54adaa85a22078d1e306304a40984dc5be99d599bf3dc0a24dc98f7daeab89ab"},+ {file = "propcache-0.5.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:806719138ecd720339a12410fb9614ac9b2b2d3a5fdf8235d56981c36f4039ba"},+ {file = "propcache-0.5.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:db2b80ea58eab4f86b2beec3cc8b39e8ff9276ac20e96b7cce43c8ae84cd6b5a"},+ {file = "propcache-0.5.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:e5cbfac9f61484f7e9f3597775500cd3ebe8274e9b050c38f9525c77c97520bf"},+ {file = "propcache-0.5.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbc581d2814337da56222fab8dc5f161cd798a434e49bac27930aaef798e144"},+ {file = "propcache-0.5.2-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:857187f381f88c8e2fa2fe56ab94879d011b883d5a2ee5a1b60a8cd2a06846d9"},+ {file = "propcache-0.5.2-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:178b4a2cdaac1818e2bf1c5a99b94383fa73ea5382e032a48dec07dc5668dc42"},+ {file = "propcache-0.5.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6f328175a2cde1f0ff2c4ed8ce968b9dcfb55f3a7153f39e2957ed994da13476"},+ {file = "propcache-0.5.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5671d09a36b06d0fd4a3da0fccbcae360e9b1570924171a15e9e0997f0249fba"},+ {file = "propcache-0.5.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:80168e2ebe4d3ec6599d10ad8f520304ae1cad9b6c5a95372aef1b66b7bfb53a"},+ {file = "propcache-0.5.2-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:45f11346f884bc47444f6e6647131055844134c3175b629f84952e2b5cd62b64"},+ {file = "propcache-0.5.2-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8e778ebd44ef4f66ed60a0416b06b489687db264a9c0b3620362f26489492913"},+ {file = "propcache-0.5.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c0cb9ed24c8964e172768d455a38254c2dd8a552905729ce006cad3d3dda59b1"},+ {file = "propcache-0.5.2-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:1d1ad32d9d4355e2be65574fd0bfd3677e7066b009cd5b9b2dee8aa6a6393b33"},+ {file = "propcache-0.5.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c80f4ba3e8f00189165999a742ee526ebeccedf6c3f7beb0c7df821e9772435a"},+ {file = "propcache-0.5.2-cp312-cp312-win32.whl", hash = "sha256:8c7972d8f193740d9175f0998ab38717e6cd322d5935c5b0fef8c0d323fd9031"},+ {file = "propcache-0.5.2-cp312-cp312-win_amd64.whl", hash = "sha256:d9ee8826a7d47863a08ac44e1a5f611a462eefc3a194b492da242128bec75b42"},+ {file = "propcache-0.5.2-cp312-cp312-win_arm64.whl", hash = "sha256:2800a4a8ead6b28cccd1ec54b59346f0def7922ee1c7598e8499c733cfbb7c84"},+ {file = "propcache-0.5.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:099aaf4b4d1a02265b92a977edf00b5c4f63b3b17ac6de39b0d637c9cac0188a"},+ {file = "propcache-0.5.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:68ce1c44c7a813a7f71ea04315a8c7b330b63db99d059a797a4651bb6f69f117"},+ {file = "propcache-0.5.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:fc299c129490f55f254cd90be0deca4764e36e9a7c08b4aa588479a3bbed3098"},+ {file = "propcache-0.5.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:a6ae2198be502c10f09b2516e7b5d019816924bc3183a43ce792a7bd6625e6f4"},+ {file = "propcache-0.5.2-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6041d31504dc1779d700e1edcfb08eea334b357620b06681a4eabb57a74e574e"},+ {file = "propcache-0.5.2-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f7eabc04151c78a9f4d5bbb5f1faf571e4defeb4b585e0fe95b60ff2dbe4d3d7"},+ {file = "propcache-0.5.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:4db0ba63d693afd40d249bd93f842b5f144f8fcbb83de05660373bcf30517b1d"},+ {file = "propcache-0.5.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:1dbcf7675229b35d31abb6547d8ebc8c27a830ac3f9a794edff6254873ec7c0a"},+ {file = "propcache-0.5.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:d310c013aad2c72f1c3f2f8dd3279d460a858c551f97aeb8c63e4693cca7b4d2"},+ {file = "propcache-0.5.2-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:06187263ddad280d05b4d8a8b3bb7d164cbebd469236544a42e6d9b28ac6a4fa"},+ {file = "propcache-0.5.2-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:3115559b8effafd63b142ea5ed53d63a16ea6469cbc63dce4ee194b42db5d853"},+ {file = "propcache-0.5.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c60462af8e6dc30c35407c7237ea908d777b22862bbee27bc4699c0d8bcdc45a"},+ {file = "propcache-0.5.2-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:40314bca9ac559716fe374094fc81c11dcc34b64fd6c585360f5775690505704"},+ {file = "propcache-0.5.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:cfa21e036ce1e1db2be04ba3b85d2df1bb1702fa01932d984c5464c665228ff4"},+ {file = "propcache-0.5.2-cp313-cp313-win32.whl", hash = "sha256:f156a3529f38063b6dbaf356e15602a7f95f8055b1295a438433a6386f10463d"},+ {file = "propcache-0.5.2-cp313-cp313-win_amd64.whl", hash = "sha256:dfed59d0a5aeb01e242e66ff0300bc4a265a7c05f612d30016f0b60b1017d757"},+ {file = "propcache-0.5.2-cp313-cp313-win_arm64.whl", hash = "sha256:ba338430e87ceb9c8f0cf754de38a9860560261e56c00376debd628698a7364f"},+ {file = "propcache-0.5.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:a592f5f3da71c8691c788c13cb6734b6d17663d2e1cb8caddf0673d01ef8847d"},+ {file = "propcache-0.5.2-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:6a997d0489e9668a384fcfd5061b857aa5361de73191cac204d04b889cfbbafa"},+ {file = "propcache-0.5.2-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:10734b5484ea113152ee25a91dccedf81631791805d2c9ccb054958e51842c94"},+ {file = "propcache-0.5.2-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cafca7e56c12bb02ae16d283742bef25a61122e9dab2b5b3f2ccbe589ce32164"},+ {file = "propcache-0.5.2-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f064f8d2b59177878b7615df1735cd8fe3462ed6be8c7b217d17a276489c2b7f"},+ {file = "propcache-0.5.2-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f78abfa8dfc32376fd1aacf597b2f2fbbe0ea751419aee718af5d4f82537ef8c"},+ {file = "propcache-0.5.2-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:f7467da8a9822bf1a55336f877340c5bcbd3c482afc43a99771169f74a26dedc"},+ {file = "propcache-0.5.2-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a6ddc6ac9e25de626c1f129c1b467d7ecd33ce2237d3fd0c4e429feef0a7ee1f"},+ {file = "propcache-0.5.2-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:2f22cbbac9e26a8e864c0985ff1268d5d939d53d9d9411a9824279097e03a2cb"},+ {file = "propcache-0.5.2-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:fc76378c62a0f04d0cd82fbb1a2cd2d7e28fcb40d5873f28a6c44e388aaa2751"},+ {file = "propcache-0.5.2-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:acd2c8edba48e31e58a363b8cf4e5c7db3b04b3f9e371f601df30d9b0d244836"},+ {file = "propcache-0.5.2-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:452b5065457eb9991ec5eb38ff41d6cd4c991c9ac7c531c4d5849ae473a9a13f"},+ {file = "propcache-0.5.2-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:3430bb2bfe1331885c427745a751e774ee679fd4344f80b97bf879815fe8fa55"},+ {file = "propcache-0.5.2-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:cef6cea3922890dd6c9654971001fa797b526c16ab5e1e46c05fd6f877be7568"},+ {file = "propcache-0.5.2-cp313-cp313t-win32.whl", hash = "sha256:72d61e16dd78228b58c5d47be830ff3da7e5f139abdf0aef9d86cde1c5cf2191"},+ {file = "propcache-0.5.2-cp313-cp313t-win_amd64.whl", hash = "sha256:0958834041a0166d343b8d2cedcd8bcbaeb4fdbe0cf08320c5379f143c3be6e7"},+ {file = "propcache-0.5.2-cp313-cp313t-win_arm64.whl", hash = "sha256:6de8bd93ddde9b992cf2b2e0d796d501a19026b5b9fd87356d7d0779531a8d96"},+ {file = "propcache-0.5.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:46088abff4cba581dea21ae0467a480526cb25aa5f3c269e909f800328bc3999"},+ {file = "propcache-0.5.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:fc88b26f08d634f7bc819a7852e5214f5802641ab8d9fd5326892292eee1993e"},+ {file = "propcache-0.5.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:97797ebb098e670a2f92dd66f32897e30d7615b14e7f59711de23e30a9072539"},+ {file = "propcache-0.5.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ba57fffe4ac99c5d30076161b5866336d97600769bad35cc68f7774b15298a4e"},+ {file = "propcache-0.5.2-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:583c19759d9eec1e5b69e2fbef36a7d9c326041be9746cb822d335c8cedc2979"},+ {file = "propcache-0.5.2-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d0326e2e5e1f3163fa306c834e48e8d490e5fae607a097a40c0648109b47ba80"},+ {file = "propcache-0.5.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e00820e192c8dbebcafb383ebbf99030895f09905e7a0eb2e0340a0bcc2bc825"},+ {file = "propcache-0.5.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c66afea89b1e43725731d2004732a046fe6fe955d51f952c3e95a7314a284a39"},+ {file = "propcache-0.5.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:d4dc37dec6c6cdad0b57881a5658fd14fbf53e333b1a86cf86559f190e1d9ec4"},+ {file = "propcache-0.5.2-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:5570dbcc97571c15f68068e529c92715a12f8d54030e272d264b377e22bd17a5"},+ {file = "propcache-0.5.2-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:f814362777a9f841adddb200ecdf8f5cb1e5a3c4b7a86378edbd6ccb26edd702"},+ {file = "propcache-0.5.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:196913dea116aeb5a2ba95af4ddcb7ea85559ae07d8eee8751688310d09168c3"},+ {file = "propcache-0.5.2-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:6e7b8719005dd1175be4ab1cd25e9b98659a5e0347331506ec6760d2773a7fb5"},+ {file = "propcache-0.5.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:51f96d685ab16e88cab128cd37a52c5da540809c8b879fa047731bfcb4ad35a4"},+ {file = "propcache-0.5.2-cp314-cp314-win32.whl", hash = "sha256:cc6fc3cc62e8501d3ed62894425040d2728ecddb1ed072737a5c70bd537aa9f0"},+ {file = "propcache-0.5.2-cp314-cp314-win_amd64.whl", hash = "sha256:81e3a30b0bb60caa22033dd0f8a3618d1d67356212514f62c57db75cb0ef410c"},+ {file = "propcache-0.5.2-cp314-cp314-win_arm64.whl", hash = "sha256:0d2c9bf8528f135dbb805ce027567e09164f7efa51a2be07458a2c0420f292d0"},+ {file = "propcache-0.5.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:4bc8ff1feffc6a61c7002ffe84634c41b822e104990ae009f44a0834430070bb"},+ {file = "propcache-0.5.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:79aa3ff0a9b566633b642fa9caf7e21ed1c13d6feca718187873f199e1514078"},+ {file = "propcache-0.5.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1b31822f4474c4036bae62de9402710051d431a606d6a0f907fec79935a071aa"},+ {file = "propcache-0.5.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:13fef48778b5a2a756523fdb781326b028ca75e32858b04f2cdd19f394564917"},+ {file = "propcache-0.5.2-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8b73ab70f1a3351fbc71f663b3e645af6dd0329100c353081cf69c37433fc6fe"},+ {file = "propcache-0.5.2-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5538d2c13d93e4698af7e092b57bc7298fd35d1d58e656ae18f23ee0d0378e03"},+ {file = "propcache-0.5.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cd645f03898405cabe694fb8bc35241e3a9c332ec85627584fe3de201452b335"},+ {file = "propcache-0.5.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a473b3440261e0c60706e732b2ed2f517857344fc21bf48fdfe211e2d98eb285"},+ {file = "propcache-0.5.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:7afa37062e6650640e932e4cc9297d81f9f42d9944029cc386b8247dea4da837"},+ {file = "propcache-0.5.2-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:8a90efd5777e996e42d568db9ac740b944d691e565cbfd31b2f7832f9184b2b8"},+ {file = "propcache-0.5.2-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:f19bb891234d72535764d703bfed1153cc34f4214d5bd7150aee1eec9e8f4366"},+ {file = "propcache-0.5.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:32775082acd2d807ee3db715c7770d38767b817870acfa08c29e057f3c4d5b56"},+ {file = "propcache-0.5.2-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:9282fb1a3bccd038da9f768b927b24a0c753e466c086b7c4f3c6982851eefb2d"},+ {file = "propcache-0.5.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cc49723e2f60d6b32a0f0b08a3fd6d13203c07f1cd9566cfce0f12a917c967a2"},+ {file = "propcache-0.5.2-cp314-cp314t-win32.whl", hash = "sha256:2d7aa89ebca5acc98cba9d1472d976e394782f587bad6661003602a619fd1821"},+ {file = "propcache-0.5.2-cp314-cp314t-win_amd64.whl", hash = "sha256:d447bb0b3054be5818458fbb171208b1d9ff11eba14e18ca18b90cbb45767370"},+ {file = "propcache-0.5.2-cp314-cp314t-win_arm64.whl", hash = "sha256:fe67a3d11cd9b4efabfa45c3d00ffba2b26811442a73a581a94b67c2b5faccf6"},+ {file = "propcache-0.5.2-py3-none-any.whl", hash = "sha256:be1ddfcbb376e3de5d2e2db1d58d6d67463e6b4f9f040c000de8e300295465fe"},+ {file = "propcache-0.5.2.tar.gz", hash = "sha256:01c4fc7480cd0598bb4b57022df55b9ca296da7fc5a8760bd8451a7e63a7d427"},+]++[[package]]+name = "pydantic"+version = "2.13.4"+description = "Data validation using Python type hints"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "pydantic-2.13.4-py3-none-any.whl", hash = "sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba"},+ {file = "pydantic-2.13.4.tar.gz", hash = "sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6"},+]++[package.dependencies]+annotated-types = ">=0.6.0"+pydantic-core = "2.46.4"+typing-extensions = ">=4.14.1"+typing-inspection = ">=0.4.2"++[package.extras]+email = ["email-validator (>=2.0.0)"]+timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""]++[[package]]+name = "pydantic-core"+version = "2.46.4"+description = "Core functionality for Pydantic validation and serialization"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "pydantic_core-2.46.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:a396dcc17e5a0b164dbe026896245a4fa9ff402edca1dff0be3d53a517f74de4"},+ {file = "pydantic_core-2.46.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:da4b951fe36dc7c3a1ccb4e3cd1747c3542b8c9ceede8fc86cae054e764485f5"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb63e0198ca18aad131c089b9204c23079c3afa95487e561f4c522d519e55aba"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f47286a97f0bc9b8859519809077b91b2cefe4ae47fcbf5e466a009c1c5d742b"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:905a0ed8ea6f2d61c1738835f99b699348d7857379083e5fc497fa0c967a407c"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ea793e075b70290d89d8142074262885d3f7da19634845135751bd6344f73b50"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:395aebd9183f9d112f569aeb5b2214d1a10a33bec8456447f7fbdfa51d38d4cd"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:b078afbc25f3a1436c7a1d2cd3e322497ee99615ba97c563566fdf46aff1ee01"},+ {file = "pydantic_core-2.46.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f747929cf940cddb5b3668a390056ddd5ba2e5010615ea2dcf4f9c4f3ab8791d"},+ {file = "pydantic_core-2.46.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:daa27d92c36f24388fe3ad306b174781c747627f134452e4f128ea00ce1fe8c4"},+ {file = "pydantic_core-2.46.4-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:19e51f073cd3df251856a8a4189fbdf1de4012c3ebacfb1884f94f1eb406079f"},+ {file = "pydantic_core-2.46.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c1747f85cee84c26985853c6f3d9bd3e75da5212912443fa111c113b9c246f39"},+ {file = "pydantic_core-2.46.4-cp310-cp310-win32.whl", hash = "sha256:2f84c03c8607173d16b5a854ec68a2f9079ae03237a54fb506d13af47e1d018d"},+ {file = "pydantic_core-2.46.4-cp310-cp310-win_amd64.whl", hash = "sha256:8358a950c8909158e3df31538a7e4edc2d7265a7c54b47f0864d9e5bae9dcebf"},+ {file = "pydantic_core-2.46.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:0e96592440881c74a213e5ad528e2b24d3d4f940de2766bed9010ab1d9e51594"},+ {file = "pydantic_core-2.46.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e0d65b8c354be7fb5f720c3caa8bc940bc2d20ce749c8e06135f07f8ed95dd7c"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bfb192b3f4b9e8a89b6277b6ce787564f62cfd272055f6e685726b111dc7826"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9037063db01f09b09e237c282b6792bd4da634b5402c4e7f0c61effed7701a04"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fc010ab034c8c7452522748bf937df58020d256ccae0874463d1f4d01758af8e"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8c5dac79fa1614d1e06ca695109c6105923bd9c7d1d6c918d4e637b7e6b32fd3"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f9fa868638bf362d3d138ea55829cefb3d5f4b0d7f142234382a15e2485dbec4"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:17299feefe090f2caa5b8e37222bb5f663e4935a8bfa6931d4102e5df1a9f398"},+ {file = "pydantic_core-2.46.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4c63ebc82684aa89d9a3bcbd13d515b3be44250dc68dd3bd81526c1cb31286c3"},+ {file = "pydantic_core-2.46.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:aaa2a54443eff1950ba5ddc6b6ccda0d9c84a364276a62f969bdf2a390650848"},+ {file = "pydantic_core-2.46.4-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:18e5ceec2ab67e6d5f1a9085e5a24c9c4e2ac4545730bfe668680bca05e555f3"},+ {file = "pydantic_core-2.46.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a0f62d0a58f4e7da165457e995725421e0064f2255d8eccebc49f41bbc23b109"},+ {file = "pydantic_core-2.46.4-cp311-cp311-win32.whl", hash = "sha256:041bde0a48fd37cf71cab1c9d56d3e8625a3793fef1f7dd232b3ff37e978ecda"},+ {file = "pydantic_core-2.46.4-cp311-cp311-win_amd64.whl", hash = "sha256:6f2eeda33a839975441c86a4119e1383c50b47faf0cbb5176985565c6bb02c33"},+ {file = "pydantic_core-2.46.4-cp311-cp311-win_arm64.whl", hash = "sha256:14f4c5d6db102bd796a627bbb3a17b4cf4574b9ae861d8b7c9a9661c6dd3362d"},+ {file = "pydantic_core-2.46.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:3245406455a5d98187ec35530fd772b1d799b26667980872c8d4614991e2c4a2"},+ {file = "pydantic_core-2.46.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:962ccbab7b642487b1d8b7df90ef677e03134cf1fd8880bf698649b22a69371f"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8233f2947cf85404441fd7e0085f53b10c93e0ee78611099b5c7237e36aacbf7"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3a233125ac121aa3ffba9a2b59edfc4a985a76092dc8279586ab4b71390875e7"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b712b53160b79a5850310b912a5ef8e57e56947c8ad690c227f5c9d7e561712"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9401557acd873c3a7f3eb9383edef8ac4968f9510e340f4808d427e75667e7b4"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:926c9541b14b12b1681dca8a0b75feb510b06c6341b70a8e500c2fdcff837cce"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:56cb4851bcaf3d117eddcef4fe66afd750a50274b0da8e22be256d10e5611987"},+ {file = "pydantic_core-2.46.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c68fcd102d71ea85c5b2dfac3f4f8476eff42a9e078fd5faefff6d145063536b"},+ {file = "pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:b2f69dec1725e79a012d920df1707de5caf7ed5e08f3be4435e25803efc47458"},+ {file = "pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:8d0820e8192167f80d88d64038e609c31452eeca865b4e1d9950a27a4609b00b"},+ {file = "pydantic_core-2.46.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:fbdb89b3e1c94a30cc5edfce477c6e6a5dc4d8f84665b455c27582f211a1c72c"},+ {file = "pydantic_core-2.46.4-cp312-cp312-win32.whl", hash = "sha256:9aa768456404a8bf48a4406685ac2bec8e72b62c69313734fa3b73cf33b3a894"},+ {file = "pydantic_core-2.46.4-cp312-cp312-win_amd64.whl", hash = "sha256:e9c26f834c65f5752f3f06cb08cb86a913ceb7274d0db6e267808a708b46bc89"},+ {file = "pydantic_core-2.46.4-cp312-cp312-win_arm64.whl", hash = "sha256:4fc73cb559bdb54b1134a706a2802a4cddd27a0633f5abb7e53056268751ac6a"},+ {file = "pydantic_core-2.46.4-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008"},+ {file = "pydantic_core-2.46.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262"},+ {file = "pydantic_core-2.46.4-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e"},+ {file = "pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd"},+ {file = "pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be"},+ {file = "pydantic_core-2.46.4-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d"},+ {file = "pydantic_core-2.46.4-cp313-cp313-win32.whl", hash = "sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb"},+ {file = "pydantic_core-2.46.4-cp313-cp313-win_amd64.whl", hash = "sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292"},+ {file = "pydantic_core-2.46.4-cp313-cp313-win_arm64.whl", hash = "sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d"},+ {file = "pydantic_core-2.46.4-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:428e04521a40150c85216fc8b85e8d39fece235a9cf5e383761238c7fa9b96fb"},+ {file = "pydantic_core-2.46.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23ace664830ee0bfe014a0c7bc248b1f7f25ed7ad103852c317624a1083af462"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce5c1d2a8b27468f433ca974829c44060b8097eedc39933e3c206a90ee49c4a9"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7283d57845ecf5a163403eb0702dfc220cc4fbdd18919cb5ccea4f95ee1cdab4"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8daafc69c93ee8a0204506a3b6b30f586ef54028f52aeeeb5c4cfc5184fd5914"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd2213145bcc2ba85884d0ac63d222fece9209678f77b9b4d76f054c561adb28"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a5f930472650a82629163023e630d160863fce524c616f4e5186e5de9d9a49b"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:c1b3f518abeca3aa13c712fd202306e145abf59a18b094a6bafb2d2bbf59192c"},+ {file = "pydantic_core-2.46.4-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1a7dd0b3ee80d90150e3495a3a13ac34dbcbfd4f012996a6a1d8900e91b5c0fb"},+ {file = "pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:3fb702cd90b0446a3a1c5e470bfa0dd23c0233b676a9099ddcc964fa6ca13898"},+ {file = "pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b8458003118a712e66286df6a707db01c52c0f52f7db8e4a38f0da1d3b94fc4e"},+ {file = "pydantic_core-2.46.4-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:372429a130e469c9cd698925ce5fc50940b7a1336b0d82038e63d5bbc4edc519"},+ {file = "pydantic_core-2.46.4-cp314-cp314-win32.whl", hash = "sha256:85bb3611ff1802f3ee7fdd7dbff26b56f343fb432d57a4728fdd49b6ef35e2f4"},+ {file = "pydantic_core-2.46.4-cp314-cp314-win_amd64.whl", hash = "sha256:811ff8e9c313ab425368bcbb36e5c4ebd7108c2bbf4e4089cfbb0b01eff63fac"},+ {file = "pydantic_core-2.46.4-cp314-cp314-win_arm64.whl", hash = "sha256:bfec22eab3c8cc2ceec0248aec886624116dc079afa027ecc8ad4a7e62010f8a"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:af8244b2bef6aaad6d92cda81372de7f8c8d36c9f0c3ea36e827c60e7d9467a0"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:5a4330cdbc57162e4b3aa303f588ba752257694c9c9be3e7ebb11b4aca659b5d"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:29c61fc04a3d840155ff08e475a04809278972fe6aef51e2720554e96367e34b"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c50f2528cf200c5eed56faf3f4e22fcd5f38c157a8b78576e6ba3168ec35f000"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0cbe8b01f948de4286c74cdd6c667aceb38f5c1e26f0693b3983d9d74887c65e"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:617d7e2ca7dcb8c5cf6bcb8c59b8832c94b36196bbf1cbd1bfb56ed341905edd"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7027560ee92211647d0d34e3f7cd6f50da56399d26a9c8ad0da286d3869a53f3"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:f99626688942fb746e545232e7726926f3be91b5975f8b55327665fafda991c7"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fc3e9034a63de20e15e8ade85358bc6efc614008cab72898b4b4952bea0509ff"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:97e7cf2be5c77b7d1a9713a05605d49460d02c6078d38d8bef3cbe323c548424"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:3bf92c5d0e00fefaab325a4d27828fe6b6e2a21848686b5b60d2d9eeb09d76c6"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:3ecbc122d18468d06ca279dc26a8c2e2d5acb10943bb35e36ae92096dc3b5565"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-win32.whl", hash = "sha256:e846ae7835bf0703ae43f534ab79a867146dadd59dc9ca5c8b53d5c8f7c9ef02"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-win_amd64.whl", hash = "sha256:2108ba5c1c1eca18030634489dc544844144ee36357f2f9f780b93e7ddbb44b5"},+ {file = "pydantic_core-2.46.4-cp314-cp314t-win_arm64.whl", hash = "sha256:4fcbe087dbc2068af7eda3aa87634eba216dbda64d1ae73c8684b621d33f6596"},+ {file = "pydantic_core-2.46.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:fd8b3d9fd264be37976686c7f65cd52a83f5e84f4bfd2adf9c1d469676bbb6ae"},+ {file = "pydantic_core-2.46.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9f444c499b3eefd3a92e348059471ea0c3a6e303d9c1cec09fa748fd9f895201"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3447661d99f75a3683a4cf5c87da72f2161964611864dbbeac7fbb118bb4bfc0"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:8b9bab013d1c7a79d3501ff86d0bc9c31bf587db4551677b96bec07df78c6b15"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d995260fdf4e1db774581b4900e0f832abe3c7c84996726bbc161b19c8f29e76"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f13a646d65d09fbf1bc6b3a9635d30095c8e7e5cc419ff35ecc563c5fd04cd49"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432c179df7874eeb73307aad2df0755e1ae0efa61ff0ea89b93e194411ae3928"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_31_riscv64.whl", hash = "sha256:e68b7a074f65a2fd746c52a7ce6142ab7006074ac269ace0c25cd8ba171f8066"},+ {file = "pydantic_core-2.46.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4a05d69cba51d852c5c3e92758653245a50c0b646ced0cf05bd793ed592839d6"},+ {file = "pydantic_core-2.46.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:228ee9bae8bef5b1e97ec58302f80357c37199e0d0a99174e138d28e6957b9d9"},+ {file = "pydantic_core-2.46.4-cp39-cp39-musllinux_1_1_armv7l.whl", hash = "sha256:10e17cbb10a330363733efc4d7c4d0dd827ac0909b8f6a6542298fed1ea62f29"},+ {file = "pydantic_core-2.46.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:91a06d2e259ecfbd8c901d70c3c507900458498142b3026a296b7de4d1322cc9"},+ {file = "pydantic_core-2.46.4-cp39-cp39-win32.whl", hash = "sha256:d80ee3d731373b24cebbc10d689ca4ee1875caf0d5703a245db18efd4dd37fc1"},+ {file = "pydantic_core-2.46.4-cp39-cp39-win_amd64.whl", hash = "sha256:3be77f45df024d789a672ae34f8b06fb346c4f9f46ea714956660ea4862e89ac"},+ {file = "pydantic_core-2.46.4-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:14d4edf427bdcf950a8a02d7cb44a08614388dd6e1bdcbf4f67504fa7887da9c"},+ {file = "pydantic_core-2.46.4-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0ce40cd7b21210e99342afafbd4d0f76d784eb5b1d60f3bdc566be4983c6c73b"},+ {file = "pydantic_core-2.46.4-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:90884113d8b48f760e9587002789ddd741e76ab9f89518cd1e43b1f1a52ec44b"},+ {file = "pydantic_core-2.46.4-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:66ce7632c22d837c95301830e111ad0128a32b8207533b60896a96c4915192ea"},+ {file = "pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:1d8ba486450b14f3b1d63bc521d410ec7565e52f887b9fb671791886436a42f7"},+ {file = "pydantic_core-2.46.4-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:3009f12e4e90b7f88b4f9adb1b0c4a3d58fe7820f3238c190047209d148026df"},+ {file = "pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad785e92e6dc634c21555edc8bd6b64957ab844541bcb96a1366c202951ae526"},+ {file = "pydantic_core-2.46.4-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:00c603d540afdd6b80eb39f078f33ebd46211f02f33e34a32d9f053bba711de0"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:0c563b08bca408dc7f65f700633d8442fffb2421fc47b8101377e9fd65051ff0"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:db06ffe51636ffe9ca531fe9023dd64bdd794be8754cb5df57c5498ae5b518a7"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:133878133d271ade3d41d1bfb2a45ec38dbdbda40bc065921c6b04e4630127e2"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9bc519fbf2b7578398853d815009ae5e4d4603d12f4e3f91da8c06852d3da3e9"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:c7a7bd4e39e8e4c12c39cd480356842b6a8a06e41b23a55a5e3e191718838ddf"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:d396ec2b979760aaf3218e76c24e65bd0aca24983298653b3a9d7a45f9e47b30"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:86e1a4418c6cd97d60c95c71164158eaf7324fae7b0923264016baa993eba6fc"},+ {file = "pydantic_core-2.46.4-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d51026d73fcfd93610abc7b27789c26b313920fcfb20e27462d74a7f8b06e983"},+ {file = "pydantic_core-2.46.4.tar.gz", hash = "sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1"},+]++[package.dependencies]+typing-extensions = ">=4.14.1"++[[package]]+name = "pydantic-settings"+version = "2.14.1"+description = "Settings management using Pydantic"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "pydantic_settings-2.14.1-py3-none-any.whl", hash = "sha256:6e3c7edfd8277687cdc598f56e5cff0e9bfff0910a3749deaa8d4401c3a2b9de"},+ {file = "pydantic_settings-2.14.1.tar.gz", hash = "sha256:e874d3bec7e787b0c9958277956ed9b4dd5de6a80e162188fdaff7c5e26fd5fa"},+]++[package.dependencies]+pydantic = ">=2.7.0"+python-dotenv = ">=0.21.0"+typing-inspection = ">=0.4.0"++[package.extras]+aws-secrets-manager = ["boto3 (>=1.35.0)", "types-boto3[secretsmanager]"]+azure-key-vault = ["azure-identity (>=1.16.0)", "azure-keyvault-secrets (>=4.8.0)"]+gcp-secret-manager = ["google-cloud-secret-manager (>=2.23.1)"]+toml = ["tomli (>=2.0.1)"]+yaml = ["pyyaml (>=6.0.1)"]++[[package]]+name = "pytest"+version = "7.4.4"+description = "pytest: simple powerful testing with Python"+optional = false+python-versions = ">=3.7"+groups = ["dev"]+files = [+ {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},+ {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},+]++[package.dependencies]+colorama = {version = "*", markers = "sys_platform == \"win32\""}+iniconfig = "*"+packaging = "*"+pluggy = ">=0.12,<2.0"++[package.extras]+testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]++[[package]]+name = "pytest-asyncio"+version = "0.23.8"+description = "Pytest support for asyncio"+optional = false+python-versions = ">=3.8"+groups = ["dev"]+files = [+ {file = "pytest_asyncio-0.23.8-py3-none-any.whl", hash = "sha256:50265d892689a5faefb84df80819d1ecef566eb3549cf915dfb33569359d1ce2"},+ {file = "pytest_asyncio-0.23.8.tar.gz", hash = "sha256:759b10b33a6dc61cce40a8bd5205e302978bbbcc00e279a8b61d9a6a3c82e4d3"},+]++[package.dependencies]+pytest = ">=7.0.0,<9"++[package.extras]+docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"]+testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"]++[[package]]+name = "python-dotenv"+version = "1.2.2"+description = "Read key-value pairs from a .env file and set them as environment variables"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a"},+ {file = "python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3"},+]++[package.extras]+cli = ["click (>=5.0)"]++[[package]]+name = "pyyaml"+version = "6.0.3"+description = "YAML parser and emitter for Python"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "PyYAML-6.0.3-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:c2514fceb77bc5e7a2f7adfaa1feb2fb311607c9cb518dbc378688ec73d8292f"},+ {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c57bb8c96f6d1808c030b1687b9b5fb476abaa47f0db9c0101f5e9f394e97f4"},+ {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:efd7b85f94a6f21e4932043973a7ba2613b059c4a000551892ac9f1d11f5baf3"},+ {file = "PyYAML-6.0.3-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:22ba7cfcad58ef3ecddc7ed1db3409af68d023b7f940da23c6c2a1890976eda6"},+ {file = "PyYAML-6.0.3-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6344df0d5755a2c9a276d4473ae6b90647e216ab4757f8426893b5dd2ac3f369"},+ {file = "PyYAML-6.0.3-cp38-cp38-win32.whl", hash = "sha256:3ff07ec89bae51176c0549bc4c63aa6202991da2d9a6129d7aef7f1407d3f295"},+ {file = "PyYAML-6.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:5cf4e27da7e3fbed4d6c3d8e797387aaad68102272f8f9752883bc32d61cb87b"},+ {file = "pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b"},+ {file = "pyyaml-6.0.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956"},+ {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8"},+ {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198"},+ {file = "pyyaml-6.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b"},+ {file = "pyyaml-6.0.3-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0"},+ {file = "pyyaml-6.0.3-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69"},+ {file = "pyyaml-6.0.3-cp310-cp310-win32.whl", hash = "sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e"},+ {file = "pyyaml-6.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c"},+ {file = "pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e"},+ {file = "pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824"},+ {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c"},+ {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00"},+ {file = "pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d"},+ {file = "pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a"},+ {file = "pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4"},+ {file = "pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b"},+ {file = "pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf"},+ {file = "pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196"},+ {file = "pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0"},+ {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28"},+ {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c"},+ {file = "pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc"},+ {file = "pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e"},+ {file = "pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea"},+ {file = "pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5"},+ {file = "pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b"},+ {file = "pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd"},+ {file = "pyyaml-6.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8"},+ {file = "pyyaml-6.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1"},+ {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c"},+ {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5"},+ {file = "pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6"},+ {file = "pyyaml-6.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6"},+ {file = "pyyaml-6.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be"},+ {file = "pyyaml-6.0.3-cp313-cp313-win32.whl", hash = "sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26"},+ {file = "pyyaml-6.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c"},+ {file = "pyyaml-6.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb"},+ {file = "pyyaml-6.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac"},+ {file = "pyyaml-6.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310"},+ {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7"},+ {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788"},+ {file = "pyyaml-6.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5"},+ {file = "pyyaml-6.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764"},+ {file = "pyyaml-6.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35"},+ {file = "pyyaml-6.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac"},+ {file = "pyyaml-6.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3"},+ {file = "pyyaml-6.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3"},+ {file = "pyyaml-6.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba"},+ {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c"},+ {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702"},+ {file = "pyyaml-6.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c"},+ {file = "pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065"},+ {file = "pyyaml-6.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65"},+ {file = "pyyaml-6.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9"},+ {file = "pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b"},+ {file = "pyyaml-6.0.3-cp39-cp39-macosx_10_13_x86_64.whl", hash = "sha256:b865addae83924361678b652338317d1bd7e79b1f4596f96b96c77a5a34b34da"},+ {file = "pyyaml-6.0.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c3355370a2c156cffb25e876646f149d5d68f5e0a3ce86a5084dd0b64a994917"},+ {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3c5677e12444c15717b902a5798264fa7909e41153cdf9ef7ad571b704a63dd9"},+ {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5ed875a24292240029e4483f9d4a4b8a1ae08843b9c54f43fcc11e404532a8a5"},+ {file = "pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a"},+ {file = "pyyaml-6.0.3-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926"},+ {file = "pyyaml-6.0.3-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:27c0abcb4a5dac13684a37f76e701e054692a9b2d3064b70f5e4eb54810553d7"},+ {file = "pyyaml-6.0.3-cp39-cp39-win32.whl", hash = "sha256:1ebe39cb5fc479422b83de611d14e2c0d3bb2a18bbcb01f229ab3cfbd8fee7a0"},+ {file = "pyyaml-6.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:2e71d11abed7344e42a8849600193d15b6def118602c4c176f748e4583246007"},+ {file = "pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f"},+]++[[package]]+name = "respx"+version = "0.21.1"+description = "A utility for mocking out the Python HTTPX and HTTP Core libraries."+optional = false+python-versions = ">=3.7"+groups = ["dev"]+files = [+ {file = "respx-0.21.1-py2.py3-none-any.whl", hash = "sha256:05f45de23f0c785862a2c92a3e173916e8ca88e4caad715dd5f68584d6053c20"},+ {file = "respx-0.21.1.tar.gz", hash = "sha256:0bd7fe21bfaa52106caa1223ce61224cf30786985f17c63c5d71eff0307ee8af"},+]++[package.dependencies]+httpx = ">=0.21.0"++[[package]]+name = "slack-bolt"+version = "1.28.0"+description = "The Bolt Framework for Python"+optional = false+python-versions = ">=3.7"+groups = ["main"]+files = [+ {file = "slack_bolt-1.28.0-py2.py3-none-any.whl", hash = "sha256:738d1ca5e7c7039b6e18103d29267ced6e18c2517053eff18991fdd593acce5c"},+ {file = "slack_bolt-1.28.0.tar.gz", hash = "sha256:bfe367d867e8fb157a057248ebd4ac2d7f43acac6d0700fa31381db1e10f3b0f"},+]++[package.dependencies]+slack_sdk = ">=3.38.0,<4"++[[package]]+name = "slack-sdk"+version = "3.41.0"+description = "The Slack API Platform SDK for Python"+optional = false+python-versions = ">=3.7"+groups = ["main"]+files = [+ {file = "slack_sdk-3.41.0-py2.py3-none-any.whl", hash = "sha256:bb18dcdfff1413ec448e759cf807ec3324090993d8ab9111c74081623b692a89"},+ {file = "slack_sdk-3.41.0.tar.gz", hash = "sha256:eb61eb12a65bebeca9cb5d36b3f799e836ed2be21b456d15df2627cfe34076ca"},+]++[package.extras]+optional = ["SQLAlchemy (>=1.4,<3)", "aiodns (>1.0)", "aiohttp (>=3.7.3,<4)", "boto3 (<=2)", "websocket-client (>=1,<2)", "websockets (>=9.1,<16)"]++[[package]]+name = "starlette"+version = "1.0.0"+description = "The little ASGI library that shines."+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "starlette-1.0.0-py3-none-any.whl", hash = "sha256:d3ec55e0bb321692d275455ddfd3df75fff145d009685eb40dc91fc66b03d38b"},+ {file = "starlette-1.0.0.tar.gz", hash = "sha256:6a4beaf1f81bb472fd19ea9b918b50dc3a77a6f2e190a12954b25e6ed5eea149"},+]++[package.dependencies]+anyio = ">=3.6.2,<5"+typing-extensions = {version = ">=4.10.0", markers = "python_version < \"3.13\""}++[package.extras]+full = ["httpx (>=0.27.0,<0.29.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.18)", "pyyaml"]++[[package]]+name = "structlog"+version = "25.5.0"+description = "Structured Logging for Python"+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "structlog-25.5.0-py3-none-any.whl", hash = "sha256:a8453e9b9e636ec59bd9e79bbd4a72f025981b3ba0f5837aebf48f02f37a7f9f"},+ {file = "structlog-25.5.0.tar.gz", hash = "sha256:098522a3bebed9153d4570c6d0288abf80a031dfdb2048d59a49e9dc2190fc98"},+]++[[package]]+name = "typing-extensions"+version = "4.15.0"+description = "Backported and Experimental Type Hints for Python 3.9+"+optional = false+python-versions = ">=3.9"+groups = ["main", "dev"]+files = [+ {file = "typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548"},+ {file = "typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466"},+]+markers = {dev = "python_version < \"3.13\""}++[[package]]+name = "typing-inspection"+version = "0.4.2"+description = "Runtime typing introspection tools"+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7"},+ {file = "typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464"},+]++[package.dependencies]+typing-extensions = ">=4.12.0"++[[package]]+name = "uvicorn"+version = "0.27.1"+description = "The lightning-fast ASGI server."+optional = false+python-versions = ">=3.8"+groups = ["main"]+files = [+ {file = "uvicorn-0.27.1-py3-none-any.whl", hash = "sha256:5c89da2f3895767472a35556e539fd59f7edbe9b1e9c0e1c99eebeadc61838e4"},+ {file = "uvicorn-0.27.1.tar.gz", hash = "sha256:3d9a267296243532db80c83a959a3400502165ade2c1338dea4e67915fd4745a"},+]++[package.dependencies]+click = ">=7.0"+colorama = {version = ">=0.4", optional = true, markers = "sys_platform == \"win32\" and extra == \"standard\""}+h11 = ">=0.8"+httptools = {version = ">=0.5.0", optional = true, markers = "extra == \"standard\""}+python-dotenv = {version = ">=0.13", optional = true, markers = "extra == \"standard\""}+pyyaml = {version = ">=5.1", optional = true, markers = "extra == \"standard\""}+uvloop = {version = ">=0.14.0,<0.15.0 || >0.15.0,<0.15.1 || >0.15.1", optional = true, markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\" and extra == \"standard\""}+watchfiles = {version = ">=0.13", optional = true, markers = "extra == \"standard\""}+websockets = {version = ">=10.4", optional = true, markers = "extra == \"standard\""}++[package.extras]+standard = ["colorama (>=0.4) ; sys_platform == \"win32\"", "httptools (>=0.5.0)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1) ; sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\"", "watchfiles (>=0.13)", "websockets (>=10.4)"]++[[package]]+name = "uvloop"+version = "0.22.1"+description = "Fast implementation of asyncio event loop on top of libuv"+optional = false+python-versions = ">=3.8.1"+groups = ["main"]+markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\""+files = [+ {file = "uvloop-0.22.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ef6f0d4cc8a9fa1f6a910230cd53545d9a14479311e87e3cb225495952eb672c"},+ {file = "uvloop-0.22.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:7cd375a12b71d33d46af85a3343b35d98e8116134ba404bd657b3b1d15988792"},+ {file = "uvloop-0.22.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ac33ed96229b7790eb729702751c0e93ac5bc3bcf52ae9eccbff30da09194b86"},+ {file = "uvloop-0.22.1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:481c990a7abe2c6f4fc3d98781cc9426ebd7f03a9aaa7eb03d3bfc68ac2a46bd"},+ {file = "uvloop-0.22.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:a592b043a47ad17911add5fbd087c76716d7c9ccc1d64ec9249ceafd735f03c2"},+ {file = "uvloop-0.22.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:1489cf791aa7b6e8c8be1c5a080bae3a672791fcb4e9e12249b05862a2ca9cec"},+ {file = "uvloop-0.22.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:c60ebcd36f7b240b30788554b6f0782454826a0ed765d8430652621b5de674b9"},+ {file = "uvloop-0.22.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3b7f102bf3cb1995cfeaee9321105e8f5da76fdb104cdad8986f85461a1b7b77"},+ {file = "uvloop-0.22.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:53c85520781d84a4b8b230e24a5af5b0778efdb39142b424990ff1ef7c48ba21"},+ {file = "uvloop-0.22.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:56a2d1fae65fd82197cb8c53c367310b3eabe1bbb9fb5a04d28e3e3520e4f702"},+ {file = "uvloop-0.22.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:40631b049d5972c6755b06d0bfe8233b1bd9a8a6392d9d1c45c10b6f9e9b2733"},+ {file = "uvloop-0.22.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:535cc37b3a04f6cd2c1ef65fa1d370c9a35b6695df735fcff5427323f2cd5473"},+ {file = "uvloop-0.22.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:fe94b4564e865d968414598eea1a6de60adba0c040ba4ed05ac1300de402cd42"},+ {file = "uvloop-0.22.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:51eb9bd88391483410daad430813d982010f9c9c89512321f5b60e2cddbdddd6"},+ {file = "uvloop-0.22.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:700e674a166ca5778255e0e1dc4e9d79ab2acc57b9171b79e65feba7184b3370"},+ {file = "uvloop-0.22.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b5b1ac819a3f946d3b2ee07f09149578ae76066d70b44df3fa990add49a82e4"},+ {file = "uvloop-0.22.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e047cc068570bac9866237739607d1313b9253c3051ad84738cbb095be0537b2"},+ {file = "uvloop-0.22.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:512fec6815e2dd45161054592441ef76c830eddaad55c8aa30952e6fe1ed07c0"},+ {file = "uvloop-0.22.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:561577354eb94200d75aca23fbde86ee11be36b00e52a4eaf8f50fb0c86b7705"},+ {file = "uvloop-0.22.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:1cdf5192ab3e674ca26da2eada35b288d2fa49fdd0f357a19f0e7c4e7d5077c8"},+ {file = "uvloop-0.22.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6e2ea3d6190a2968f4a14a23019d3b16870dd2190cd69c8180f7c632d21de68d"},+ {file = "uvloop-0.22.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:0530a5fbad9c9e4ee3f2b33b148c6a64d47bbad8000ea63704fa8260f4cf728e"},+ {file = "uvloop-0.22.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:bc5ef13bbc10b5335792360623cc378d52d7e62c2de64660616478c32cd0598e"},+ {file = "uvloop-0.22.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:1f38ec5e3f18c8a10ded09742f7fb8de0108796eb673f30ce7762ce1b8550cad"},+ {file = "uvloop-0.22.1-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:3879b88423ec7e97cd4eba2a443aa26ed4e59b45e6b76aabf13fe2f27023a142"},+ {file = "uvloop-0.22.1-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:4baa86acedf1d62115c1dc6ad1e17134476688f08c6efd8a2ab076e815665c74"},+ {file = "uvloop-0.22.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:297c27d8003520596236bdb2335e6b3f649480bd09e00d1e3a99144b691d2a35"},+ {file = "uvloop-0.22.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c1955d5a1dd43198244d47664a5858082a3239766a839b2102a269aaff7a4e25"},+ {file = "uvloop-0.22.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:b31dc2fccbd42adc73bc4e7cdbae4fc5086cf378979e53ca5d0301838c5682c6"},+ {file = "uvloop-0.22.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:93f617675b2d03af4e72a5333ef89450dfaa5321303ede6e67ba9c9d26878079"},+ {file = "uvloop-0.22.1-cp314-cp314t-macosx_10_13_universal2.whl", hash = "sha256:37554f70528f60cad66945b885eb01f1bb514f132d92b6eeed1c90fd54ed6289"},+ {file = "uvloop-0.22.1-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:b76324e2dc033a0b2f435f33eb88ff9913c156ef78e153fb210e03c13da746b3"},+ {file = "uvloop-0.22.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:badb4d8e58ee08dad957002027830d5c3b06aea446a6a3744483c2b3b745345c"},+ {file = "uvloop-0.22.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b91328c72635f6f9e0282e4a57da7470c7350ab1c9f48546c0f2866205349d21"},+ {file = "uvloop-0.22.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:daf620c2995d193449393d6c62131b3fbd40a63bf7b307a1527856ace637fe88"},+ {file = "uvloop-0.22.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:6cde23eeda1a25c75b2e07d39970f3374105d5eafbaab2a4482be82f272d5a5e"},+ {file = "uvloop-0.22.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:80eee091fe128e425177fbd82f8635769e2f32ec9daf6468286ec57ec0313efa"},+ {file = "uvloop-0.22.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:017bd46f9e7b78e81606329d07141d3da446f8798c6baeec124260e22c262772"},+ {file = "uvloop-0.22.1-cp38-cp38-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c3e5c6727a57cb6558592a95019e504f605d1c54eb86463ee9f7a2dbd411c820"},+ {file = "uvloop-0.22.1-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:57df59d8b48feb0e613d9b1f5e57b7532e97cbaf0d61f7aa9aa32221e84bc4b6"},+ {file = "uvloop-0.22.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:55502bc2c653ed2e9692e8c55cb95b397d33f9f2911e929dc97c4d6b26d04242"},+ {file = "uvloop-0.22.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:4a968a72422a097b09042d5fa2c5c590251ad484acf910a651b4b620acd7f193"},+ {file = "uvloop-0.22.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:b45649628d816c030dba3c80f8e2689bab1c89518ed10d426036cdc47874dfc4"},+ {file = "uvloop-0.22.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ea721dd3203b809039fcc2983f14608dae82b212288b346e0bfe46ec2fab0b7c"},+ {file = "uvloop-0.22.1-cp39-cp39-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ae676de143db2b2f60a9696d7eca5bb9d0dd6cc3ac3dad59a8ae7e95f9e1b54"},+ {file = "uvloop-0.22.1-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:17d4e97258b0172dfa107b89aa1eeba3016f4b1974ce85ca3ef6a66b35cbf659"},+ {file = "uvloop-0.22.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:05e4b5f86e621cf3927631789999e697e58f0d2d32675b67d9ca9eb0bca55743"},+ {file = "uvloop-0.22.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:286322a90bea1f9422a470d5d2ad82d38080be0a29c4dd9b3e6384320a4d11e7"},+ {file = "uvloop-0.22.1.tar.gz", hash = "sha256:6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f"},+]++[package.extras]+dev = ["Cython (>=3.0,<4.0)", "setuptools (>=60)"]+docs = ["Sphinx (>=4.1.2,<4.2.0)", "sphinx_rtd_theme (>=0.5.2,<0.6.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)"]+test = ["aiohttp (>=3.10.5)", "flake8 (>=6.1,<7.0)", "mypy (>=0.800)", "psutil", "pyOpenSSL (>=25.3.0,<25.4.0)", "pycodestyle (>=2.11.0,<2.12.0)"]++[[package]]+name = "watchfiles"+version = "1.1.1"+description = "Simple, modern and high performance file watching and code reload in python."+optional = false+python-versions = ">=3.9"+groups = ["main"]+files = [+ {file = "watchfiles-1.1.1-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:eef58232d32daf2ac67f42dea51a2c80f0d03379075d44a587051e63cc2e368c"},+ {file = "watchfiles-1.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:03fa0f5237118a0c5e496185cafa92878568b652a2e9a9382a5151b1a0380a43"},+ {file = "watchfiles-1.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8ca65483439f9c791897f7db49202301deb6e15fe9f8fe2fed555bf986d10c31"},+ {file = "watchfiles-1.1.1-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f0ab1c1af0cb38e3f598244c17919fb1a84d1629cc08355b0074b6d7f53138ac"},+ {file = "watchfiles-1.1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3bc570d6c01c206c46deb6e935a260be44f186a2f05179f52f7fcd2be086a94d"},+ {file = "watchfiles-1.1.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e84087b432b6ac94778de547e08611266f1f8ffad28c0ee4c82e028b0fc5966d"},+ {file = "watchfiles-1.1.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:620bae625f4cb18427b1bb1a2d9426dc0dd5a5ba74c7c2cdb9de405f7b129863"},+ {file = "watchfiles-1.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:544364b2b51a9b0c7000a4b4b02f90e9423d97fbbf7e06689236443ebcad81ab"},+ {file = "watchfiles-1.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:bbe1ef33d45bc71cf21364df962af171f96ecaeca06bd9e3d0b583efb12aec82"},+ {file = "watchfiles-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:1a0bb430adb19ef49389e1ad368450193a90038b5b752f4ac089ec6942c4dff4"},+ {file = "watchfiles-1.1.1-cp310-cp310-win32.whl", hash = "sha256:3f6d37644155fb5beca5378feb8c1708d5783145f2a0f1c4d5a061a210254844"},+ {file = "watchfiles-1.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:a36d8efe0f290835fd0f33da35042a1bb5dc0e83cbc092dcf69bce442579e88e"},+ {file = "watchfiles-1.1.1-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:f57b396167a2565a4e8b5e56a5a1c537571733992b226f4f1197d79e94cf0ae5"},+ {file = "watchfiles-1.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:421e29339983e1bebc281fab40d812742268ad057db4aee8c4d2bce0af43b741"},+ {file = "watchfiles-1.1.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6e43d39a741e972bab5d8100b5cdacf69db64e34eb19b6e9af162bccf63c5cc6"},+ {file = "watchfiles-1.1.1-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f537afb3276d12814082a2e9b242bdcf416c2e8fd9f799a737990a1dbe906e5b"},+ {file = "watchfiles-1.1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b2cd9e04277e756a2e2d2543d65d1e2166d6fd4c9b183f8808634fda23f17b14"},+ {file = "watchfiles-1.1.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5f3f58818dc0b07f7d9aa7fe9eb1037aecb9700e63e1f6acfed13e9fef648f5d"},+ {file = "watchfiles-1.1.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9bb9f66367023ae783551042d31b1d7fd422e8289eedd91f26754a66f44d5cff"},+ {file = "watchfiles-1.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aebfd0861a83e6c3d1110b78ad54704486555246e542be3e2bb94195eabb2606"},+ {file = "watchfiles-1.1.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5fac835b4ab3c6487b5dbad78c4b3724e26bcc468e886f8ba8cc4306f68f6701"},+ {file = "watchfiles-1.1.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:399600947b170270e80134ac854e21b3ccdefa11a9529a3decc1327088180f10"},+ {file = "watchfiles-1.1.1-cp311-cp311-win32.whl", hash = "sha256:de6da501c883f58ad50db3a32ad397b09ad29865b5f26f64c24d3e3281685849"},+ {file = "watchfiles-1.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:35c53bd62a0b885bf653ebf6b700d1bf05debb78ad9292cf2a942b23513dc4c4"},+ {file = "watchfiles-1.1.1-cp311-cp311-win_arm64.whl", hash = "sha256:57ca5281a8b5e27593cb7d82c2ac927ad88a96ed406aa446f6344e4328208e9e"},+ {file = "watchfiles-1.1.1-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:8c89f9f2f740a6b7dcc753140dd5e1ab9215966f7a3530d0c0705c83b401bd7d"},+ {file = "watchfiles-1.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bd404be08018c37350f0d6e34676bd1e2889990117a2b90070b3007f172d0610"},+ {file = "watchfiles-1.1.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8526e8f916bb5b9a0a777c8317c23ce65de259422bba5b31325a6fa6029d33af"},+ {file = "watchfiles-1.1.1-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2edc3553362b1c38d9f06242416a5d8e9fe235c204a4072e988ce2e5bb1f69f6"},+ {file = "watchfiles-1.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:30f7da3fb3f2844259cba4720c3fc7138eb0f7b659c38f3bfa65084c7fc7abce"},+ {file = "watchfiles-1.1.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f8979280bdafff686ba5e4d8f97840f929a87ed9cdf133cbbd42f7766774d2aa"},+ {file = "watchfiles-1.1.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dcc5c24523771db3a294c77d94771abcfcb82a0e0ee8efd910c37c59ec1b31bb"},+ {file = "watchfiles-1.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1db5d7ae38ff20153d542460752ff397fcf5c96090c1230803713cf3147a6803"},+ {file = "watchfiles-1.1.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:28475ddbde92df1874b6c5c8aaeb24ad5be47a11f87cde5a28ef3835932e3e94"},+ {file = "watchfiles-1.1.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:36193ed342f5b9842edd3532729a2ad55c4160ffcfa3700e0d54be496b70dd43"},+ {file = "watchfiles-1.1.1-cp312-cp312-win32.whl", hash = "sha256:859e43a1951717cc8de7f4c77674a6d389b106361585951d9e69572823f311d9"},+ {file = "watchfiles-1.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:91d4c9a823a8c987cce8fa2690923b069966dabb196dd8d137ea2cede885fde9"},+ {file = "watchfiles-1.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:a625815d4a2bdca61953dbba5a39d60164451ef34c88d751f6c368c3ea73d404"},+ {file = "watchfiles-1.1.1-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:130e4876309e8686a5e37dba7d5e9bc77e6ed908266996ca26572437a5271e18"},+ {file = "watchfiles-1.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5f3bde70f157f84ece3765b42b4a52c6ac1a50334903c6eaf765362f6ccca88a"},+ {file = "watchfiles-1.1.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:14e0b1fe858430fc0251737ef3824c54027bedb8c37c38114488b8e131cf8219"},+ {file = "watchfiles-1.1.1-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f27db948078f3823a6bb3b465180db8ebecf26dd5dae6f6180bd87383b6b4428"},+ {file = "watchfiles-1.1.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:059098c3a429f62fc98e8ec62b982230ef2c8df68c79e826e37b895bc359a9c0"},+ {file = "watchfiles-1.1.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bfb5862016acc9b869bb57284e6cb35fdf8e22fe59f7548858e2f971d045f150"},+ {file = "watchfiles-1.1.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:319b27255aacd9923b8a276bb14d21a5f7ff82564c744235fc5eae58d95422ae"},+ {file = "watchfiles-1.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c755367e51db90e75b19454b680903631d41f9e3607fbd941d296a020c2d752d"},+ {file = "watchfiles-1.1.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:c22c776292a23bfc7237a98f791b9ad3144b02116ff10d820829ce62dff46d0b"},+ {file = "watchfiles-1.1.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:3a476189be23c3686bc2f4321dd501cb329c0a0469e77b7b534ee10129ae6374"},+ {file = "watchfiles-1.1.1-cp313-cp313-win32.whl", hash = "sha256:bf0a91bfb5574a2f7fc223cf95eeea79abfefa404bf1ea5e339c0c1560ae99a0"},+ {file = "watchfiles-1.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:52e06553899e11e8074503c8e716d574adeeb7e68913115c4b3653c53f9bae42"},+ {file = "watchfiles-1.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:ac3cc5759570cd02662b15fbcd9d917f7ecd47efe0d6b40474eafd246f91ea18"},+ {file = "watchfiles-1.1.1-cp313-cp313t-macosx_10_12_x86_64.whl", hash = "sha256:563b116874a9a7ce6f96f87cd0b94f7faf92d08d0021e837796f0a14318ef8da"},+ {file = "watchfiles-1.1.1-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3ad9fe1dae4ab4212d8c91e80b832425e24f421703b5a42ef2e4a1e215aff051"},+ {file = "watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce70f96a46b894b36eba678f153f052967a0d06d5b5a19b336ab0dbbd029f73e"},+ {file = "watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:cb467c999c2eff23a6417e58d75e5828716f42ed8289fe6b77a7e5a91036ca70"},+ {file = "watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:836398932192dae4146c8f6f737d74baeac8b70ce14831a239bdb1ca882fc261"},+ {file = "watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:743185e7372b7bc7c389e1badcc606931a827112fbbd37f14c537320fca08620"},+ {file = "watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:afaeff7696e0ad9f02cbb8f56365ff4686ab205fcf9c4c5b6fdfaaa16549dd04"},+ {file = "watchfiles-1.1.1-cp313-cp313t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3f7eb7da0eb23aa2ba036d4f616d46906013a68caf61b7fdbe42fc8b25132e77"},+ {file = "watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_aarch64.whl", hash = "sha256:831a62658609f0e5c64178211c942ace999517f5770fe9436be4c2faeba0c0ef"},+ {file = "watchfiles-1.1.1-cp313-cp313t-musllinux_1_1_x86_64.whl", hash = "sha256:f9a2ae5c91cecc9edd47e041a930490c31c3afb1f5e6d71de3dc671bfaca02bf"},+ {file = "watchfiles-1.1.1-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:d1715143123baeeaeadec0528bb7441103979a1d5f6fd0e1f915383fea7ea6d5"},+ {file = "watchfiles-1.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:39574d6370c4579d7f5d0ad940ce5b20db0e4117444e39b6d8f99db5676c52fd"},+ {file = "watchfiles-1.1.1-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7365b92c2e69ee952902e8f70f3ba6360d0d596d9299d55d7d386df84b6941fb"},+ {file = "watchfiles-1.1.1-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bfff9740c69c0e4ed32416f013f3c45e2ae42ccedd1167ef2d805c000b6c71a5"},+ {file = "watchfiles-1.1.1-cp314-cp314-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b27cf2eb1dda37b2089e3907d8ea92922b673c0c427886d4edc6b94d8dfe5db3"},+ {file = "watchfiles-1.1.1-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:526e86aced14a65a5b0ec50827c745597c782ff46b571dbfe46192ab9e0b3c33"},+ {file = "watchfiles-1.1.1-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04e78dd0b6352db95507fd8cb46f39d185cf8c74e4cf1e4fbad1d3df96faf510"},+ {file = "watchfiles-1.1.1-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5c85794a4cfa094714fb9c08d4a218375b2b95b8ed1666e8677c349906246c05"},+ {file = "watchfiles-1.1.1-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:74d5012b7630714b66be7b7b7a78855ef7ad58e8650c73afc4c076a1f480a8d6"},+ {file = "watchfiles-1.1.1-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:8fbe85cb3201c7d380d3d0b90e63d520f15d6afe217165d7f98c9c649654db81"},+ {file = "watchfiles-1.1.1-cp314-cp314-win32.whl", hash = "sha256:3fa0b59c92278b5a7800d3ee7733da9d096d4aabcfabb9a928918bd276ef9b9b"},+ {file = "watchfiles-1.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:c2047d0b6cea13b3316bdbafbfa0c4228ae593d995030fda39089d36e64fc03a"},+ {file = "watchfiles-1.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:842178b126593addc05acf6fce960d28bc5fae7afbaa2c6c1b3a7b9460e5be02"},+ {file = "watchfiles-1.1.1-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:88863fbbc1a7312972f1c511f202eb30866370ebb8493aef2812b9ff28156a21"},+ {file = "watchfiles-1.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:55c7475190662e202c08c6c0f4d9e345a29367438cf8e8037f3155e10a88d5a5"},+ {file = "watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f53fa183d53a1d7a8852277c92b967ae99c2d4dcee2bfacff8868e6e30b15f7"},+ {file = "watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:6aae418a8b323732fa89721d86f39ec8f092fc2af67f4217a2b07fd3e93c6101"},+ {file = "watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f096076119da54a6080e8920cbdaac3dbee667eb91dcc5e5b78840b87415bd44"},+ {file = "watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00485f441d183717038ed2e887a7c868154f216877653121068107b227a2f64c"},+ {file = "watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a55f3e9e493158d7bfdb60a1165035f1cf7d320914e7b7ea83fe22c6023b58fc"},+ {file = "watchfiles-1.1.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c91ed27800188c2ae96d16e3149f199d62f86c7af5f5f4d2c61a3ed8cd3666c"},+ {file = "watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:311ff15a0bae3714ffb603e6ba6dbfba4065ab60865d15a6ec544133bdb21099"},+ {file = "watchfiles-1.1.1-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:a916a2932da8f8ab582f242c065f5c81bed3462849ca79ee357dd9551b0e9b01"},+ {file = "watchfiles-1.1.1-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:c882d69f6903ef6092bedfb7be973d9319940d56b8427ab9187d1ecd73438a70"},+ {file = "watchfiles-1.1.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d6ff426a7cb54f310d51bfe83fe9f2bbe40d540c741dc974ebc30e6aa238f52e"},+ {file = "watchfiles-1.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:79ff6c6eadf2e3fc0d7786331362e6ef1e51125892c75f1004bd6b52155fb956"},+ {file = "watchfiles-1.1.1-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:c1f5210f1b8fc91ead1283c6fd89f70e76fb07283ec738056cf34d51e9c1d62c"},+ {file = "watchfiles-1.1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b9c4702f29ca48e023ffd9b7ff6b822acdf47cb1ff44cb490a3f1d5ec8987e9c"},+ {file = "watchfiles-1.1.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:acb08650863767cbc58bca4813b92df4d6c648459dcaa3d4155681962b2aa2d3"},+ {file = "watchfiles-1.1.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:08af70fd77eee58549cd69c25055dc344f918d992ff626068242259f98d598a2"},+ {file = "watchfiles-1.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c3631058c37e4a0ec440bf583bc53cdbd13e5661bb6f465bc1d88ee9a0a4d02"},+ {file = "watchfiles-1.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:cf57a27fb986c6243d2ee78392c503826056ffe0287e8794503b10fb51b881be"},+ {file = "watchfiles-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d7e7067c98040d646982daa1f37a33d3544138ea155536c2e0e63e07ff8a7e0f"},+ {file = "watchfiles-1.1.1-cp39-cp39-win32.whl", hash = "sha256:6c9c9262f454d1c4d8aaa7050121eb4f3aea197360553699520767daebf2180b"},+ {file = "watchfiles-1.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:74472234c8370669850e1c312490f6026d132ca2d396abfad8830b4f1c096957"},+ {file = "watchfiles-1.1.1-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:17ef139237dfced9da49fb7f2232c86ca9421f666d78c264c7ffca6601d154c3"},+ {file = "watchfiles-1.1.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:672b8adf25b1a0d35c96b5888b7b18699d27d4194bac8beeae75be4b7a3fc9b2"},+ {file = "watchfiles-1.1.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77a13aea58bc2b90173bc69f2a90de8e282648939a00a602e1dc4ee23e26b66d"},+ {file = "watchfiles-1.1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b495de0bb386df6a12b18335a0285dda90260f51bdb505503c02bcd1ce27a8b"},+ {file = "watchfiles-1.1.1-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:db476ab59b6765134de1d4fe96a1a9c96ddf091683599be0f26147ea1b2e4b88"},+ {file = "watchfiles-1.1.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:89eef07eee5e9d1fda06e38822ad167a044153457e6fd997f8a858ab7564a336"},+ {file = "watchfiles-1.1.1-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce19e06cbda693e9e7686358af9cd6f5d61312ab8b00488bc36f5aabbaf77e24"},+ {file = "watchfiles-1.1.1-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e6f39af2eab0118338902798b5aa6664f46ff66bc0280de76fca67a7f262a49"},+ {file = "watchfiles-1.1.1-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:cdab464fee731e0884c35ae3588514a9bcf718d0e2c82169c1c4a85cc19c3c7f"},+ {file = "watchfiles-1.1.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:3dbd8cbadd46984f802f6d479b7e3afa86c42d13e8f0f322d669d79722c8ec34"},+ {file = "watchfiles-1.1.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5524298e3827105b61951a29c3512deb9578586abf3a7c5da4a8069df247cccc"},+ {file = "watchfiles-1.1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b943d3668d61cfa528eb949577479d3b077fd25fb83c641235437bc0b5bc60e"},+ {file = "watchfiles-1.1.1.tar.gz", hash = "sha256:a173cb5c16c4f40ab19cecf48a534c409f7ea983ab8fed0741304a1c0a31b3f2"},+]++[package.dependencies]+anyio = ">=3.0.0"++[[package]]+name = "websockets"+version = "16.0"+description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "websockets-16.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:04cdd5d2d1dacbad0a7bf36ccbcd3ccd5a30ee188f2560b7a62a30d14107b31a"},+ {file = "websockets-16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8ff32bb86522a9e5e31439a58addbb0166f0204d64066fb955265c4e214160f0"},+ {file = "websockets-16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:583b7c42688636f930688d712885cf1531326ee05effd982028212ccc13e5957"},+ {file = "websockets-16.0-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7d837379b647c0c4c2355c2499723f82f1635fd2c26510e1f587d89bc2199e72"},+ {file = "websockets-16.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:df57afc692e517a85e65b72e165356ed1df12386ecb879ad5693be08fac65dde"},+ {file = "websockets-16.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:2b9f1e0d69bc60a4a87349d50c09a037a2607918746f07de04df9e43252c77a3"},+ {file = "websockets-16.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:335c23addf3d5e6a8633f9f8eda77efad001671e80b95c491dd0924587ece0b3"},+ {file = "websockets-16.0-cp310-cp310-win32.whl", hash = "sha256:37b31c1623c6605e4c00d466c9d633f9b812ea430c11c8a278774a1fde1acfa9"},+ {file = "websockets-16.0-cp310-cp310-win_amd64.whl", hash = "sha256:8e1dab317b6e77424356e11e99a432b7cb2f3ec8c5ab4dabbcee6add48f72b35"},+ {file = "websockets-16.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:31a52addea25187bde0797a97d6fc3d2f92b6f72a9370792d65a6e84615ac8a8"},+ {file = "websockets-16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:417b28978cdccab24f46400586d128366313e8a96312e4b9362a4af504f3bbad"},+ {file = "websockets-16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:af80d74d4edfa3cb9ed973a0a5ba2b2a549371f8a741e0800cb07becdd20f23d"},+ {file = "websockets-16.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:08d7af67b64d29823fed316505a89b86705f2b7981c07848fb5e3ea3020c1abe"},+ {file = "websockets-16.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7be95cfb0a4dae143eaed2bcba8ac23f4892d8971311f1b06f3c6b78952ee70b"},+ {file = "websockets-16.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d6297ce39ce5c2e6feb13c1a996a2ded3b6832155fcfc920265c76f24c7cceb5"},+ {file = "websockets-16.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1c1b30e4f497b0b354057f3467f56244c603a79c0d1dafce1d16c283c25f6e64"},+ {file = "websockets-16.0-cp311-cp311-win32.whl", hash = "sha256:5f451484aeb5cafee1ccf789b1b66f535409d038c56966d6101740c1614b86c6"},+ {file = "websockets-16.0-cp311-cp311-win_amd64.whl", hash = "sha256:8d7f0659570eefb578dacde98e24fb60af35350193e4f56e11190787bee77dac"},+ {file = "websockets-16.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:71c989cbf3254fbd5e84d3bff31e4da39c43f884e64f2551d14bb3c186230f00"},+ {file = "websockets-16.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:8b6e209ffee39ff1b6d0fa7bfef6de950c60dfb91b8fcead17da4ee539121a79"},+ {file = "websockets-16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:86890e837d61574c92a97496d590968b23c2ef0aeb8a9bc9421d174cd378ae39"},+ {file = "websockets-16.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9b5aca38b67492ef518a8ab76851862488a478602229112c4b0d58d63a7a4d5c"},+ {file = "websockets-16.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e0334872c0a37b606418ac52f6ab9cfd17317ac26365f7f65e203e2d0d0d359f"},+ {file = "websockets-16.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:a0b31e0b424cc6b5a04b8838bbaec1688834b2383256688cf47eb97412531da1"},+ {file = "websockets-16.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:485c49116d0af10ac698623c513c1cc01c9446c058a4e61e3bf6c19dff7335a2"},+ {file = "websockets-16.0-cp312-cp312-win32.whl", hash = "sha256:eaded469f5e5b7294e2bdca0ab06becb6756ea86894a47806456089298813c89"},+ {file = "websockets-16.0-cp312-cp312-win_amd64.whl", hash = "sha256:5569417dc80977fc8c2d43a86f78e0a5a22fee17565d78621b6bb264a115d4ea"},+ {file = "websockets-16.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:878b336ac47938b474c8f982ac2f7266a540adc3fa4ad74ae96fea9823a02cc9"},+ {file = "websockets-16.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:52a0fec0e6c8d9a784c2c78276a48a2bdf099e4ccc2a4cad53b27718dbfd0230"},+ {file = "websockets-16.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:e6578ed5b6981005df1860a56e3617f14a6c307e6a71b4fff8c48fdc50f3ed2c"},+ {file = "websockets-16.0-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:95724e638f0f9c350bb1c2b0a7ad0e83d9cc0c9259f3ea94e40d7b02a2179ae5"},+ {file = "websockets-16.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c0204dc62a89dc9d50d682412c10b3542d748260d743500a85c13cd1ee4bde82"},+ {file = "websockets-16.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:52ac480f44d32970d66763115edea932f1c5b1312de36df06d6b219f6741eed8"},+ {file = "websockets-16.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:6e5a82b677f8f6f59e8dfc34ec06ca6b5b48bc4fcda346acd093694cc2c24d8f"},+ {file = "websockets-16.0-cp313-cp313-win32.whl", hash = "sha256:abf050a199613f64c886ea10f38b47770a65154dc37181bfaff70c160f45315a"},+ {file = "websockets-16.0-cp313-cp313-win_amd64.whl", hash = "sha256:3425ac5cf448801335d6fdc7ae1eb22072055417a96cc6b31b3861f455fbc156"},+ {file = "websockets-16.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:8cc451a50f2aee53042ac52d2d053d08bf89bcb31ae799cb4487587661c038a0"},+ {file = "websockets-16.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:daa3b6ff70a9241cf6c7fc9e949d41232d9d7d26fd3522b1ad2b4d62487e9904"},+ {file = "websockets-16.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4"},+ {file = "websockets-16.0-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:781caf5e8eee67f663126490c2f96f40906594cb86b408a703630f95550a8c3e"},+ {file = "websockets-16.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:caab51a72c51973ca21fa8a18bd8165e1a0183f1ac7066a182ff27107b71e1a4"},+ {file = "websockets-16.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:19c4dc84098e523fd63711e563077d39e90ec6702aff4b5d9e344a60cb3c0cb1"},+ {file = "websockets-16.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a5e18a238a2b2249c9a9235466b90e96ae4795672598a58772dd806edc7ac6d3"},+ {file = "websockets-16.0-cp314-cp314-win32.whl", hash = "sha256:a069d734c4a043182729edd3e9f247c3b2a4035415a9172fd0f1b71658a320a8"},+ {file = "websockets-16.0-cp314-cp314-win_amd64.whl", hash = "sha256:c0ee0e63f23914732c6d7e0cce24915c48f3f1512ec1d079ed01fc629dab269d"},+ {file = "websockets-16.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:a35539cacc3febb22b8f4d4a99cc79b104226a756aa7400adc722e83b0d03244"},+ {file = "websockets-16.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:b784ca5de850f4ce93ec85d3269d24d4c82f22b7212023c974c401d4980ebc5e"},+ {file = "websockets-16.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:569d01a4e7fba956c5ae4fc988f0d4e187900f5497ce46339c996dbf24f17641"},+ {file = "websockets-16.0-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:50f23cdd8343b984957e4077839841146f67a3d31ab0d00e6b824e74c5b2f6e8"},+ {file = "websockets-16.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:152284a83a00c59b759697b7f9e9cddf4e3c7861dd0d964b472b70f78f89e80e"},+ {file = "websockets-16.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:bc59589ab64b0022385f429b94697348a6a234e8ce22544e3681b2e9331b5944"},+ {file = "websockets-16.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:32da954ffa2814258030e5a57bc73a3635463238e797c7375dc8091327434206"},+ {file = "websockets-16.0-cp314-cp314t-win32.whl", hash = "sha256:5a4b4cc550cb665dd8a47f868c8d04c8230f857363ad3c9caf7a0c3bf8c61ca6"},+ {file = "websockets-16.0-cp314-cp314t-win_amd64.whl", hash = "sha256:b14dc141ed6d2dde437cddb216004bcac6a1df0935d79656387bd41632ba0bbd"},+ {file = "websockets-16.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:349f83cd6c9a415428ee1005cadb5c2c56f4389bc06a9af16103c3bc3dcc8b7d"},+ {file = "websockets-16.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:4a1aba3340a8dca8db6eb5a7986157f52eb9e436b74813764241981ca4888f03"},+ {file = "websockets-16.0-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f4a32d1bd841d4bcbffdcb3d2ce50c09c3909fbead375ab28d0181af89fd04da"},+ {file = "websockets-16.0-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0298d07ee155e2e9fda5be8a9042200dd2e3bb0b8a38482156576f863a9d457c"},+ {file = "websockets-16.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:a653aea902e0324b52f1613332ddf50b00c06fdaf7e92624fbf8c77c78fa5767"},+ {file = "websockets-16.0-py3-none-any.whl", hash = "sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec"},+ {file = "websockets-16.0.tar.gz", hash = "sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5"},+]++[[package]]+name = "yarl"+version = "1.23.0"+description = "Yet another URL library"+optional = false+python-versions = ">=3.10"+groups = ["main"]+files = [+ {file = "yarl-1.23.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cff6d44cb13d39db2663a22b22305d10855efa0fa8015ddeacc40bc59b9d8107"},+ {file = "yarl-1.23.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e4c53f8347cd4200f0d70a48ad059cabaf24f5adc6ba08622a23423bc7efa10d"},+ {file = "yarl-1.23.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2a6940a074fb3c48356ed0158a3ca5699c955ee4185b4d7d619be3c327143e05"},+ {file = "yarl-1.23.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:ed5f69ce7be7902e5c70ea19eb72d20abf7d725ab5d49777d696e32d4fc1811d"},+ {file = "yarl-1.23.0-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:389871e65468400d6283c0308e791a640b5ab5c83bcee02a2f51295f95e09748"},+ {file = "yarl-1.23.0-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:dda608c88cf709b1d406bdfcd84d8d63cff7c9e577a403c6108ce8ce9dcc8764"},+ {file = "yarl-1.23.0-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:8c4fe09e0780c6c3bf2b7d4af02ee2394439d11a523bbcf095cf4747c2932007"},+ {file = "yarl-1.23.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:31c9921eb8bd12633b41ad27686bbb0b1a2a9b8452bfdf221e34f311e9942ed4"},+ {file = "yarl-1.23.0-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5f10fd85e4b75967468af655228fbfd212bdf66db1c0d135065ce288982eda26"},+ {file = "yarl-1.23.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dbf507e9ef5688bada447a24d68b4b58dd389ba93b7afc065a2ba892bea54769"},+ {file = "yarl-1.23.0-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:85e9beda1f591bc73e77ea1c51965c68e98dafd0fec72cdd745f77d727466716"},+ {file = "yarl-1.23.0-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:0e1fdaa14ef51366d7757b45bde294e95f6c8c049194e793eedb8387c86d5993"},+ {file = "yarl-1.23.0-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:75e3026ab649bf48f9a10c0134512638725b521340293f202a69b567518d94e0"},+ {file = "yarl-1.23.0-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:80e6d33a3d42a7549b409f199857b4fb54e2103fc44fb87605b6663b7a7ff750"},+ {file = "yarl-1.23.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:5ec2f42d41ccbd5df0270d7df31618a8ee267bfa50997f5d720ddba86c4a83a6"},+ {file = "yarl-1.23.0-cp310-cp310-win32.whl", hash = "sha256:debe9c4f41c32990771be5c22b56f810659f9ddf3d63f67abfdcaa2c6c9c5c1d"},+ {file = "yarl-1.23.0-cp310-cp310-win_amd64.whl", hash = "sha256:ab5f043cb8a2d71c981c09c510da013bc79fd661f5c60139f00dd3c3cc4f2ffb"},+ {file = "yarl-1.23.0-cp310-cp310-win_arm64.whl", hash = "sha256:263cd4f47159c09b8b685890af949195b51d1aa82ba451c5847ca9bc6413c220"},+ {file = "yarl-1.23.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b35d13d549077713e4414f927cdc388d62e543987c572baee613bf82f11a4b99"},+ {file = "yarl-1.23.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:cbb0fef01f0c6b38cb0f39b1f78fc90b807e0e3c86a7ff3ce74ad77ce5c7880c"},+ {file = "yarl-1.23.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dc52310451fc7c629e13c4e061cbe2dd01684d91f2f8ee2821b083c58bd72432"},+ {file = "yarl-1.23.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b2c6b50c7b0464165472b56b42d4c76a7b864597007d9c085e8b63e185cf4a7a"},+ {file = "yarl-1.23.0-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:aafe5dcfda86c8af00386d7781d4c2181b5011b7be3f2add5e99899ea925df05"},+ {file = "yarl-1.23.0-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9ee33b875f0b390564c1fb7bc528abf18c8ee6073b201c6ae8524aca778e2d83"},+ {file = "yarl-1.23.0-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4c41e021bc6d7affb3364dc1e1e5fa9582b470f283748784bd6ea0558f87f42c"},+ {file = "yarl-1.23.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:99c8a9ed30f4164bc4c14b37a90208836cbf50d4ce2a57c71d0f52c7fb4f7598"},+ {file = "yarl-1.23.0-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f2af5c81a1f124609d5f33507082fc3f739959d4719b56877ab1ee7e7b3d602b"},+ {file = "yarl-1.23.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6b41389c19b07c760c7e427a3462e8ab83c4bb087d127f0e854c706ce1b9215c"},+ {file = "yarl-1.23.0-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:1dc702e42d0684f42d6519c8d581e49c96cefaaab16691f03566d30658ee8788"},+ {file = "yarl-1.23.0-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:0e40111274f340d32ebcc0a5668d54d2b552a6cca84c9475859d364b380e3222"},+ {file = "yarl-1.23.0-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:4764a6a7588561a9aef92f65bda2c4fb58fe7c675c0883862e6df97559de0bfb"},+ {file = "yarl-1.23.0-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:03214408cfa590df47728b84c679ae4ef00be2428e11630277be0727eba2d7cc"},+ {file = "yarl-1.23.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:170e26584b060879e29fac213e4228ef063f39128723807a312e5c7fec28eff2"},+ {file = "yarl-1.23.0-cp311-cp311-win32.whl", hash = "sha256:51430653db848d258336cfa0244427b17d12db63d42603a55f0d4546f50f25b5"},+ {file = "yarl-1.23.0-cp311-cp311-win_amd64.whl", hash = "sha256:bf49a3ae946a87083ef3a34c8f677ae4243f5b824bfc4c69672e72b3d6719d46"},+ {file = "yarl-1.23.0-cp311-cp311-win_arm64.whl", hash = "sha256:b39cb32a6582750b6cc77bfb3c49c0f8760dc18dc96ec9fb55fbb0f04e08b928"},+ {file = "yarl-1.23.0-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:1932b6b8bba8d0160a9d1078aae5838a66039e8832d41d2992daa9a3a08f7860"},+ {file = "yarl-1.23.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:411225bae281f114067578891bc75534cfb3d92a3b4dfef7a6ca78ba354e6069"},+ {file = "yarl-1.23.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:13a563739ae600a631c36ce096615fe307f131344588b0bc0daec108cdb47b25"},+ {file = "yarl-1.23.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9cbf44c5cb4a7633d078788e1b56387e3d3cf2b8139a3be38040b22d6c3221c8"},+ {file = "yarl-1.23.0-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:53ad387048f6f09a8969631e4de3f1bf70c50e93545d64af4f751b2498755072"},+ {file = "yarl-1.23.0-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4a59ba56f340334766f3a4442e0efd0af895fae9e2b204741ef885c446b3a1a8"},+ {file = "yarl-1.23.0-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:803a3c3ce4acc62eaf01eaca1208dcf0783025ef27572c3336502b9c232005e7"},+ {file = "yarl-1.23.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a3d2bff8f37f8d0f96c7ec554d16945050d54462d6e95414babaa18bfafc7f51"},+ {file = "yarl-1.23.0-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c75eb09e8d55bceb4367e83496ff8ef2bc7ea6960efb38e978e8073ea59ecb67"},+ {file = "yarl-1.23.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:877b0738624280e34c55680d6054a307aa94f7d52fa0e3034a9cc6e790871da7"},+ {file = "yarl-1.23.0-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:b5405bb8f0e783a988172993cfc627e4d9d00432d6bbac65a923041edacf997d"},+ {file = "yarl-1.23.0-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:1c3a3598a832590c5a3ce56ab5576361b5688c12cb1d39429cf5dba30b510760"},+ {file = "yarl-1.23.0-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:8419ebd326430d1cbb7efb5292330a2cf39114e82df5cc3d83c9a0d5ebeaf2f2"},+ {file = "yarl-1.23.0-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:be61f6fff406ca40e3b1d84716fde398fc08bc63dd96d15f3a14230a0973ed86"},+ {file = "yarl-1.23.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:3ceb13c5c858d01321b5d9bb65e4cf37a92169ea470b70fec6f236b2c9dd7e34"},+ {file = "yarl-1.23.0-cp312-cp312-win32.whl", hash = "sha256:fffc45637bcd6538de8b85f51e3df3223e4ad89bccbfca0481c08c7fc8b7ed7d"},+ {file = "yarl-1.23.0-cp312-cp312-win_amd64.whl", hash = "sha256:f69f57305656a4852f2a7203efc661d8c042e6cc67f7acd97d8667fb448a426e"},+ {file = "yarl-1.23.0-cp312-cp312-win_arm64.whl", hash = "sha256:6e87a6e8735b44816e7db0b2fbc9686932df473c826b0d9743148432e10bb9b9"},+ {file = "yarl-1.23.0-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:16c6994ac35c3e74fb0ae93323bf8b9c2a9088d55946109489667c510a7d010e"},+ {file = "yarl-1.23.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:4a42e651629dafb64fd5b0286a3580613702b5809ad3f24934ea87595804f2c5"},+ {file = "yarl-1.23.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:7c6b9461a2a8b47c65eef63bb1c76a4f1c119618ffa99ea79bc5bb1e46c5821b"},+ {file = "yarl-1.23.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2569b67d616eab450d262ca7cb9f9e19d2f718c70a8b88712859359d0ab17035"},+ {file = "yarl-1.23.0-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e9d9a4d06d3481eab79803beb4d9bd6f6a8e781ec078ac70d7ef2dcc29d1bea5"},+ {file = "yarl-1.23.0-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f514f6474e04179d3d33175ed3f3e31434d3130d42ec153540d5b157deefd735"},+ {file = "yarl-1.23.0-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fda207c815b253e34f7e1909840fd14299567b1c0eb4908f8c2ce01a41265401"},+ {file = "yarl-1.23.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:34b6cf500e61c90f305094911f9acc9c86da1a05a7a3f5be9f68817043f486e4"},+ {file = "yarl-1.23.0-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:d7504f2b476d21653e4d143f44a175f7f751cd41233525312696c76aa3dbb23f"},+ {file = "yarl-1.23.0-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:578110dd426f0d209d1509244e6d4a3f1a3e9077655d98c5f22583d63252a08a"},+ {file = "yarl-1.23.0-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:609d3614d78d74ebe35f54953c5bbd2ac647a7ddb9c30a5d877580f5e86b22f2"},+ {file = "yarl-1.23.0-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:4966242ec68afc74c122f8459abd597afd7d8a60dc93d695c1334c5fd25f762f"},+ {file = "yarl-1.23.0-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:e0fd068364a6759bc794459f0a735ab151d11304346332489c7972bacbe9e72b"},+ {file = "yarl-1.23.0-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:39004f0ad156da43e86aa71f44e033de68a44e5a31fc53507b36dd253970054a"},+ {file = "yarl-1.23.0-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:e5723c01a56c5028c807c701aa66722916d2747ad737a046853f6c46f4875543"},+ {file = "yarl-1.23.0-cp313-cp313-win32.whl", hash = "sha256:1b6b572edd95b4fa8df75de10b04bc81acc87c1c7d16bcdd2035b09d30acc957"},+ {file = "yarl-1.23.0-cp313-cp313-win_amd64.whl", hash = "sha256:baaf55442359053c7d62f6f8413a62adba3205119bcb6f49594894d8be47e5e3"},+ {file = "yarl-1.23.0-cp313-cp313-win_arm64.whl", hash = "sha256:fb4948814a2a98e3912505f09c9e7493b1506226afb1f881825368d6fb776ee3"},+ {file = "yarl-1.23.0-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:aecfed0b41aa72b7881712c65cf764e39ce2ec352324f5e0837c7048d9e6daaa"},+ {file = "yarl-1.23.0-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:a41bcf68efd19073376eb8cf948b8d9be0af26256403e512bb18f3966f1f9120"},+ {file = "yarl-1.23.0-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:cde9a2ecd91668bcb7f077c4966d8ceddb60af01b52e6e3e2680e4cf00ad1a59"},+ {file = "yarl-1.23.0-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5023346c4ee7992febc0068e7593de5fa2bf611848c08404b35ebbb76b1b0512"},+ {file = "yarl-1.23.0-cp313-cp313t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:d1009abedb49ae95b136a8904a3f71b342f849ffeced2d3747bf29caeda218c4"},+ {file = "yarl-1.23.0-cp313-cp313t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a8d00f29b42f534cc8aa3931cfe773b13b23e561e10d2b26f27a8d309b0e82a1"},+ {file = "yarl-1.23.0-cp313-cp313t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:95451e6ce06c3e104556d73b559f5da6c34a069b6b62946d3ad66afcd51642ea"},+ {file = "yarl-1.23.0-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:531ef597132086b6cf96faa7c6c1dcd0361dd5f1694e5cc30375907b9b7d3ea9"},+ {file = "yarl-1.23.0-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:88f9fb0116fbfcefcab70f85cf4b74a2b6ce5d199c41345296f49d974ddb4123"},+ {file = "yarl-1.23.0-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:e7b0460976dc75cb87ad9cc1f9899a4b97751e7d4e77ab840fc9b6d377b8fd24"},+ {file = "yarl-1.23.0-cp313-cp313t-musllinux_1_2_armv7l.whl", hash = "sha256:115136c4a426f9da976187d238e84139ff6b51a20839aa6e3720cd1026d768de"},+ {file = "yarl-1.23.0-cp313-cp313t-musllinux_1_2_ppc64le.whl", hash = "sha256:ead11956716a940c1abc816b7df3fa2b84d06eaed8832ca32f5c5e058c65506b"},+ {file = "yarl-1.23.0-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:fe8f8f5e70e6dbdfca9882cd9deaac058729bcf323cf7a58660901e55c9c94f6"},+ {file = "yarl-1.23.0-cp313-cp313t-musllinux_1_2_s390x.whl", hash = "sha256:a0e317df055958a0c1e79e5d2aa5a5eaa4a6d05a20d4b0c9c3f48918139c9fc6"},+ {file = "yarl-1.23.0-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:6f0fd84de0c957b2d280143522c4f91a73aada1923caee763e24a2b3fda9f8a5"},+ {file = "yarl-1.23.0-cp313-cp313t-win32.whl", hash = "sha256:93a784271881035ab4406a172edb0faecb6e7d00f4b53dc2f55919d6c9688595"},+ {file = "yarl-1.23.0-cp313-cp313t-win_amd64.whl", hash = "sha256:dd00607bffbf30250fe108065f07453ec124dbf223420f57f5e749b04295e090"},+ {file = "yarl-1.23.0-cp313-cp313t-win_arm64.whl", hash = "sha256:ac09d42f48f80c9ee1635b2fcaa819496a44502737660d3c0f2ade7526d29144"},+ {file = "yarl-1.23.0-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:21d1b7305a71a15b4794b5ff22e8eef96ff4a6d7f9657155e5aa419444b28912"},+ {file = "yarl-1.23.0-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:85610b4f27f69984932a7abbe52703688de3724d9f72bceb1cca667deff27474"},+ {file = "yarl-1.23.0-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:23f371bd662cf44a7630d4d113101eafc0cfa7518a2760d20760b26021454719"},+ {file = "yarl-1.23.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c4a80f77dc1acaaa61f0934176fccca7096d9b1ff08c8ba9cddf5ae034a24319"},+ {file = "yarl-1.23.0-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:bd654fad46d8d9e823afbb4f87c79160b5a374ed1ff5bde24e542e6ba8f41434"},+ {file = "yarl-1.23.0-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:682bae25f0a0dd23a056739f23a134db9f52a63e2afd6bfb37ddc76292bbd723"},+ {file = "yarl-1.23.0-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:a82836cab5f197a0514235aaf7ffccdc886ccdaa2324bc0aafdd4ae898103039"},+ {file = "yarl-1.23.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1c57676bdedc94cd3bc37724cf6f8cd2779f02f6aba48de45feca073e714fe52"},+ {file = "yarl-1.23.0-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c7f8dc16c498ff06497c015642333219871effba93e4a2e8604a06264aca5c5c"},+ {file = "yarl-1.23.0-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:5ee586fb17ff8f90c91cf73c6108a434b02d69925f44f5f8e0d7f2f260607eae"},+ {file = "yarl-1.23.0-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:17235362f580149742739cc3828b80e24029d08cbb9c4bda0242c7b5bc610a8e"},+ {file = "yarl-1.23.0-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:0793e2bd0cf14234983bbb371591e6bea9e876ddf6896cdcc93450996b0b5c85"},+ {file = "yarl-1.23.0-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:3650dc2480f94f7116c364096bc84b1d602f44224ef7d5c7208425915c0475dd"},+ {file = "yarl-1.23.0-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:f40e782d49630ad384db66d4d8b73ff4f1b8955dc12e26b09a3e3af064b3b9d6"},+ {file = "yarl-1.23.0-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:94f8575fbdf81749008d980c17796097e645574a3b8c28ee313931068dad14fe"},+ {file = "yarl-1.23.0-cp314-cp314-win32.whl", hash = "sha256:c8aa34a5c864db1087d911a0b902d60d203ea3607d91f615acd3f3108ac32169"},+ {file = "yarl-1.23.0-cp314-cp314-win_amd64.whl", hash = "sha256:63e92247f383c85ab00dd0091e8c3fa331a96e865459f5ee80353c70a4a42d70"},+ {file = "yarl-1.23.0-cp314-cp314-win_arm64.whl", hash = "sha256:70efd20be968c76ece7baa8dafe04c5be06abc57f754d6f36f3741f7aa7a208e"},+ {file = "yarl-1.23.0-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:9a18d6f9359e45722c064c97464ec883eb0e0366d33eda61cb19a244bf222679"},+ {file = "yarl-1.23.0-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:2803ed8b21ca47a43da80a6fd1ed3019d30061f7061daa35ac54f63933409412"},+ {file = "yarl-1.23.0-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:394906945aa8b19fc14a61cf69743a868bb8c465efe85eee687109cc540b98f4"},+ {file = "yarl-1.23.0-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:71d006bee8397a4a89f469b8deb22469fe7508132d3c17fa6ed871e79832691c"},+ {file = "yarl-1.23.0-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:62694e275c93d54f7ccedcfef57d42761b2aad5234b6be1f3e3026cae4001cd4"},+ {file = "yarl-1.23.0-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:a31de1613658308efdb21ada98cbc86a97c181aa050ba22a808120bb5be3ab94"},+ {file = "yarl-1.23.0-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:fb1e8b8d66c278b21d13b0a7ca22c41dd757a7c209c6b12c313e445c31dd3b28"},+ {file = "yarl-1.23.0-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:50f9d8d531dfb767c565f348f33dd5139a6c43f5cbdf3f67da40d54241df93f6"},+ {file = "yarl-1.23.0-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:575aa4405a656e61a540f4a80eaa5260f2a38fff7bfdc4b5f611840d76e9e277"},+ {file = "yarl-1.23.0-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:041b1a4cefacf65840b4e295c6985f334ba83c30607441ae3cf206a0eed1a2e4"},+ {file = "yarl-1.23.0-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:d38c1e8231722c4ce40d7593f28d92b5fc72f3e9774fe73d7e800ec32299f63a"},+ {file = "yarl-1.23.0-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:d53834e23c015ee83a99377db6e5e37d8484f333edb03bd15b4bc312cc7254fb"},+ {file = "yarl-1.23.0-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:2e27c8841126e017dd2a054a95771569e6070b9ee1b133366d8b31beb5018a41"},+ {file = "yarl-1.23.0-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:76855800ac56f878847a09ce6dba727c93ca2d89c9e9d63002d26b916810b0a2"},+ {file = "yarl-1.23.0-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:e09fd068c2e169a7070d83d3bde728a4d48de0549f975290be3c108c02e499b4"},+ {file = "yarl-1.23.0-cp314-cp314t-win32.whl", hash = "sha256:73309162a6a571d4cbd3b6a1dcc703c7311843ae0d1578df6f09be4e98df38d4"},+ {file = "yarl-1.23.0-cp314-cp314t-win_amd64.whl", hash = "sha256:4503053d296bc6e4cbd1fad61cf3b6e33b939886c4f249ba7c78b602214fabe2"},+ {file = "yarl-1.23.0-cp314-cp314t-win_arm64.whl", hash = "sha256:44bb7bef4ea409384e3f8bc36c063d77ea1b8d4a5b2706956c0d6695f07dcc25"},+ {file = "yarl-1.23.0-py3-none-any.whl", hash = "sha256:a2df6afe50dea8ae15fa34c9f824a3ee958d785fd5d089063d960bae1daa0a3f"},+ {file = "yarl-1.23.0.tar.gz", hash = "sha256:53b1ea6ca88ebd4420379c330aea57e258408dd0df9af0992e5de2078dc9f5d5"},+]++[package.dependencies]+idna = ">=2.0"+multidict = ">=4.0"+propcache = ">=0.2.1"++[metadata]+lock-version = "2.1"+python-versions = "^3.11"+content-hash = "1579432f31caee5f23aaf8361325a63b39787ad8ffcdffe0c6af64acec455615"diff --git a/services/slack-bot/pyproject.toml b/services/slack-bot/pyproject.tomlindex aa58bf49b..7a0571277 100644--- a/services/slack-bot/pyproject.toml+++ b/services/slack-bot/pyproject.toml@@ -22,7 +22,7 @@ structlog = ">=24.1,<26.0"[tool.poetry.group.dev.dependencies]pytest = "^7.4.0"pytest-asyncio = "^0.23.0"-respx = "^0.20.2"+respx = "^0.21.1"[build-system]requires = ["poetry-core"]diff --git a/services/slack-bot/tests/test_aisoc_clients.py b/services/slack-bot/tests/test_aisoc_clients.pyindex 2cc5e3d17..ef10fe27b 100644--- a/services/slack-bot/tests/test_aisoc_clients.py+++ b/services/slack-bot/tests/test_aisoc_clients.py@@ -56,9 +56,9 @@ async def test_list_open_cases_filters_closed_and_caps_to_limit():{"id": "c4", "title": "Triaged", "status": "triaged", "severity": "high"},]- with respx.mock(base_url=API_BASE) as router:- route = router.get("/api/v1/cases").mock(return_value=httpx.Response(200, json=sample))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ route = router.get(f"{API_BASE}/api/v1/cases").mock(return_value=httpx.Response(200, json=sample))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:cases = await client.list_open_cases(limit=2)finally:@@ -77,9 +77,9 @@ async def test_list_open_cases_filters_closed_and_caps_to_limit():@pytest.mark.asyncioasync def test_list_open_cases_propagates_severity_filter():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- route = router.get("/api/v1/cases").mock(return_value=httpx.Response(200, json=[]))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ route = router.get(f"{API_BASE}/api/v1/cases").mock(return_value=httpx.Response(200, json=[]))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:await client.list_open_cases(limit=5, severity="high")finally:@@ -91,11 +91,11 @@ async def test_list_open_cases_propagates_severity_filter():@pytest.mark.asyncioasync def test_get_case_url_encodes_identifier():settings = _settings()- with respx.mock(base_url=API_BASE) as router:+ with respx.mock() as router:# User passes a case-number that contains a slash; the client must# quote it so the path stays inside ``/api/v1/cases/…``.- route = router.get("/api/v1/cases/CASE%2F1").mock(return_value=httpx.Response(200, json={"id": "abc", "title": "ok"}))- client = AisocApiClient.from_settings(settings)+ route = router.get(f"{API_BASE}/api/v1/cases/CASE%2F1").mock(return_value=httpx.Response(200, json={"id": "abc", "title": "ok"}))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:case = await client.get_case("CASE/1")finally:@@ -108,9 +108,9 @@ async def test_get_case_url_encodes_identifier():@pytest.mark.asyncioasync def test_launch_investigation_posts_alert_summary():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- route = router.post("/api/v1/cases/abc/investigate").mock(return_value=httpx.Response(202, json={"run_id": "run-1"}))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ route = router.post(f"{API_BASE}/api/v1/cases/abc/investigate").mock(return_value=httpx.Response(202, json={"run_id": "run-1"}))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:result = await client.launch_investigation("abc", alert_summary="ransomware?")finally:@@ -128,9 +128,9 @@ async def test_launch_investigation_posts_alert_summary():@pytest.mark.asyncioasync def test_get_case_summary_requests_json_format():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- route = router.get("/api/v1/cases/abc/summary").mock(return_value=httpx.Response(200, json={"summary": "..."}))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ route = router.get(f"{API_BASE}/api/v1/cases/abc/summary").mock(return_value=httpx.Response(200, json={"summary": "..."}))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:await client.get_case_summary("abc")finally:@@ -142,9 +142,9 @@ async def test_get_case_summary_requests_json_format():@pytest.mark.asyncioasync def test_non_2xx_raises_aisoc_client_error_with_status():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- router.get("/api/v1/cases").mock(return_value=httpx.Response(503, text="upstream down"))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ router.get(f"{API_BASE}/api/v1/cases").mock(return_value=httpx.Response(503, text="upstream down"))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:with pytest.raises(AisocClientError) as exc:await client.list_open_cases()@@ -158,9 +158,9 @@ async def test_non_2xx_raises_aisoc_client_error_with_status():@pytest.mark.asyncioasync def test_transport_error_raises_without_status():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- router.get("/api/v1/cases").mock(side_effect=httpx.ConnectError("nope"))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ router.get(f"{API_BASE}/api/v1/cases").mock(side_effect=httpx.ConnectError("nope"))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:with pytest.raises(AisocClientError) as exc:await client.list_open_cases()@@ -173,9 +173,9 @@ async def test_transport_error_raises_without_status():@pytest.mark.asyncioasync def test_invalid_json_raises_client_error():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- router.get("/api/v1/cases/abc").mock(return_value=httpx.Response(200, text="not json", headers={"content-type": "text/plain"}))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ router.get(f"{API_BASE}/api/v1/cases/abc").mock(return_value=httpx.Response(200, text="not json", headers={"content-type": "text/plain"}))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:with pytest.raises(AisocClientError):await client.get_case("abc")@@ -186,9 +186,9 @@ async def test_invalid_json_raises_client_error():@pytest.mark.asyncioasync def test_list_open_cases_rejects_non_list_response():settings = _settings()- with respx.mock(base_url=API_BASE) as router:- router.get("/api/v1/cases").mock(return_value=httpx.Response(200, json={"oops": "object"}))- client = AisocApiClient.from_settings(settings)+ with respx.mock() as router:+ router.get(f"{API_BASE}/api/v1/cases").mock(return_value=httpx.Response(200, json={"oops": "object"}))+ client = AisocApiClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:with pytest.raises(AisocClientError):await client.list_open_cases()@@ -204,8 +204,8 @@ async def test_list_open_cases_rejects_non_list_response():@pytest.mark.asyncioasync def test_submit_action_posts_full_payload_with_tenant():settings = _settings()- with respx.mock(base_url=ACTIONS_BASE) as router:- route = router.post("/api/v1/actions").mock(+ with respx.mock() as router:+ route = router.post(f"{ACTIONS_BASE}/api/v1/actions").mock(return_value=httpx.Response(200,json={@@ -216,7 +216,7 @@ async def test_submit_action_posts_full_payload_with_tenant():},))- client = AisocActionsClient.from_settings(settings)+ client = AisocActionsClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:result = await client.submit_action(action_type="isolate_host",@@ -255,9 +255,9 @@ async def test_actions_client_falls_back_to_api_token_when_actions_token_missingAISOC_ACTIONS_SERVICE_TOKEN="",AISOC_DEFAULT_TENANT_ID=TENANT,)- with respx.mock(base_url=ACTIONS_BASE) as router:- route = router.post("/api/v1/actions/aaa/approve").mock(return_value=httpx.Response(200, json={"id": "aaa", "status": "completed"}))- client = AisocActionsClient.from_settings(settings)+ with respx.mock() as router:+ route = router.post(f"{ACTIONS_BASE}/api/v1/actions/aaa/approve").mock(return_value=httpx.Response(200, json={"id": "aaa", "status": "completed"}))+ client = AisocActionsClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:await client.approve_action("aaa")finally:@@ -269,14 +269,14 @@ async def test_actions_client_falls_back_to_api_token_when_actions_token_missing@pytest.mark.asyncioasync def test_approve_and_reject_url_encode_action_id():settings = _settings()- with respx.mock(base_url=ACTIONS_BASE) as router:- approve = router.post("/api/v1/actions/a%2F1/approve").mock(+ with respx.mock() as router:+ approve = router.post(f"{ACTIONS_BASE}/api/v1/actions/a%2F1/approve").mock(return_value=httpx.Response(200, json={"id": "a/1", "status": "approved"}))- reject = router.post("/api/v1/actions/a%2F1/reject").mock(+ reject = router.post(f"{ACTIONS_BASE}/api/v1/actions/a%2F1/reject").mock(return_value=httpx.Response(200, json={"id": "a/1", "status": "rejected"}))- client = AisocActionsClient.from_settings(settings)+ client = AisocActionsClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:await client.approve_action("a/1")await client.reject_action("a/1")@@ -289,11 +289,11 @@ async def test_approve_and_reject_url_encode_action_id():@pytest.mark.asyncioasync def test_actions_client_propagates_4xx_with_message_snippet():settings = _settings()- with respx.mock(base_url=ACTIONS_BASE) as router:- router.post("/api/v1/actions").mock(+ with respx.mock() as router:+ router.post(f"{ACTIONS_BASE}/api/v1/actions").mock(return_value=httpx.Response(400, text="invalid action_type"),)- client = AisocActionsClient.from_settings(settings)+ client = AisocActionsClient.from_settings(settings, transport=httpx.MockTransport(router.handler))try:with pytest.raises(AisocClientError) as exc:await client.submit_action(diff --git a/services/threatintel/app/actors/__init__.py b/services/threatintel/app/actors/__init__.pynew file mode 100644index 000000000..f34c186a4--- /dev/null+++ b/services/threatintel/app/actors/__init__.py@@ -0,0 +1,8 @@+"""+Threat actor attribution.++Provides multi-factor analysis of IOCs, TTPs, and target patterns to+attribute observed activity to known threat actor groups.++AiSOC — open-source AI Security Operations Center (MIT License)+"""diff --git a/services/threatintel/app/actors/attribution.py b/services/threatintel/app/actors/attribution.pynew file mode 100644index 000000000..def32da94--- /dev/null+++ b/services/threatintel/app/actors/attribution.py@@ -0,0 +1,368 @@+"""+Threat Actor Attribution Engine.++Scores observed indicators (IOCs), MITRE ATT&CK techniques, used tools, and+target sectors against a small in-memory catalog of well-documented threat+actors and returns the best match above a configurable confidence threshold.++This is a v0 attribution engine intended as a foundation. The actor catalog+is currently hardcoded with three high-profile public profiles (APT28,+APT29, Lazarus). Sourcing from STIX/TAXII or a curated YAML/JSON corpus is+the obvious next step.++The IOC component of the score is intentionally conservative: it only+contributes when an OpenSearch store is available and an exact-value match+is found in collected threat intel. There is no synthetic "every IOC counts+as a match" inflation.+"""++from __future__ import annotations++import os+import re+from datetime import UTC, datetime+from typing import Any++import structlog+from prometheus_client import Counter, Histogram+from pydantic import BaseModel, Field++logger = structlog.get_logger(__name__)++WEIGHT_TTP = 0.4+WEIGHT_TOOL = 0.3+WEIGHT_TARGET = 0.2+WEIGHT_IOC = 0.1+DEFAULT_CONFIDENCE_THRESHOLD = 0.3++# Prometheus metrics — exposed via the threatintel /metrics endpoint.+attribution_requests = Counter(+ "threatintel_attribution_requests_total",+ "Total threat actor attribution requests",+ ["result"], # "matched" | "unknown" | "error"+)+attribution_score = Histogram(+ "threatintel_attribution_score",+ "Confidence score of the best-matching actor (0.0 = no match)",+ buckets=(0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0),+)+++def _env_threshold() -> float:+ """Read confidence threshold from ``AISOC_ATTRIBUTION_THRESHOLD`` env var.++ Falls back to ``DEFAULT_CONFIDENCE_THRESHOLD`` for invalid or unset values+ so a typo in the operator's environment can never silently disable+ attribution.+ """+ raw = os.getenv("AISOC_ATTRIBUTION_THRESHOLD")+ if raw is None:+ return DEFAULT_CONFIDENCE_THRESHOLD+ try:+ value = float(raw)+ except ValueError:+ logger.warning(+ "Invalid AISOC_ATTRIBUTION_THRESHOLD; using default",+ raw=raw,+ default=DEFAULT_CONFIDENCE_THRESHOLD,+ )+ return DEFAULT_CONFIDENCE_THRESHOLD+ if not 0.0 <= value <= 1.0:+ logger.warning(+ "AISOC_ATTRIBUTION_THRESHOLD out of range [0.0, 1.0]; using default",+ value=value,+ default=DEFAULT_CONFIDENCE_THRESHOLD,+ )+ return DEFAULT_CONFIDENCE_THRESHOLD+ return value+++class ThreatActorProfile(BaseModel):+ """Profile of a threat actor with associated attributes."""++ id: str+ name: str+ aliases: list[str] = Field(default_factory=list)+ description: str = ""+ sophistication_level: str = "unknown" # novice | intermediate | advanced | expert+ primary_motivation: str = ""+ secondary_motivations: list[str] = Field(default_factory=list)+ ttps: list[str] = Field(default_factory=list)+ tools: list[str] = Field(default_factory=list)+ targets: list[str] = Field(default_factory=list)+ first_seen: datetime | None = None+ last_seen: datetime | None = None+ confidence_score: float = 0.5+++class AttributionResult(BaseModel):+ """Result of threat actor attribution analysis."""++ actor_id: str+ actor_name: str+ confidence_score: float+ matched_indicators: list[str] = Field(default_factory=list)+ reasoning: list[str] = Field(default_factory=list)+ timestamp: datetime+++def _seed_actor_catalog() -> dict[str, ThreatActorProfile]:+ """Return the v0 hardcoded actor catalog.++ Public-domain profiles based on MITRE ATT&CK Groups documentation.+ Confidence values reflect public-source data quality only; they are not+ a claim about real-world certainty in any particular incident.+ """+ return {+ "APT28": ThreatActorProfile(+ id="APT28",+ name="APT28 (Fancy Bear)",+ aliases=["Sofacy", "Pawn Storm", "Sednit", "Tsar Team"],+ description="Russian cyber espionage group; well-documented in MITRE ATT&CK Groups.",+ sophistication_level="advanced",+ primary_motivation="espionage",+ secondary_motivations=["disruption"],+ ttps=["T1566", "T1059", "T1071", "T1041"],+ tools=["x-agent", "sofacy"],+ targets=["government", "military", "political parties"],+ confidence_score=0.85,+ ),+ "APT29": ThreatActorProfile(+ id="APT29",+ name="APT29 (Cozy Bear)",+ aliases=["The Dukes", "Group 100", "CozyDuke"],+ description="Russian state-sponsored group with mature tradecraft.",+ sophistication_level="expert",+ primary_motivation="espionage",+ secondary_motivations=[],+ ttps=["T1059", "T1071", "T1041", "T1021"],+ tools=["miniduke", "cosmicduke"],+ targets=["government", "technology", "think tanks"],+ confidence_score=0.85,+ ),+ "Lazarus": ThreatActorProfile(+ id="Lazarus",+ name="Lazarus Group",+ aliases=["Hidden Cobra", "Guardians of Peace"],+ description="DPRK-aligned group active against finance, crypto, and entertainment.",+ sophistication_level="advanced",+ primary_motivation="financial gain",+ secondary_motivations=["espionage", "disruption"],+ ttps=["T1059", "T1071", "T1041", "T1036"],+ tools=["destover", "wannacry"],+ targets=["financial institutions", "entertainment", "cryptocurrency"],+ confidence_score=0.80,+ ),+ }+++class ThreatActorAttributionEngine:+ """Score observed indicators against a catalog of known threat actors.++ Args:+ catalog: Optional override for the actor catalog. If omitted, the v0+ hardcoded catalog is loaded.+ os_store: Optional OpenSearch store (the same instance used by the+ threat-intel feed pipeline) used to verify IOC values against+ collected intel. If ``None``, the IOC component of the score is+ zero and reasoning makes that explicit.+ confidence_threshold: Minimum total score required to return a named+ actor; below this, ``"unknown"`` is returned.+ """++ def __init__(+ self,+ catalog: dict[str, ThreatActorProfile] | None = None,+ os_store: Any = None,+ confidence_threshold: float | None = None,+ ) -> None:+ self._actor_profiles: dict[str, ThreatActorProfile] = catalog if catalog is not None else _seed_actor_catalog()+ self._os_store = os_store+ self._confidence_threshold = confidence_threshold if confidence_threshold is not None else _env_threshold()++ async def attribute_incident(+ self,+ iocs: list[dict[str, Any]],+ mitre_techniques: list[str],+ case_metadata: dict[str, Any],+ ) -> AttributionResult:+ """Attribute an incident to the highest-scoring known actor.++ Args:+ iocs: Observed indicators, each a dict with at least a ``value``+ field; ``type`` is optional but recommended.+ mitre_techniques: Observed MITRE ATT&CK technique IDs+ (e.g. ``["T1566", "T1059"]``).+ case_metadata: Free-form case metadata; ``targets`` (list of+ sector strings) is the only field consulted today.++ Returns:+ ``AttributionResult``. If no actor exceeds+ ``confidence_threshold``, ``actor_id`` is ``"unknown"``.+ """+ logger.info(+ "Starting threat actor attribution",+ ioc_count=len(iocs),+ technique_count=len(mitre_techniques),+ actor_count=len(self._actor_profiles),+ )++ if not self._actor_profiles:+ attribution_requests.labels(result="unknown").inc()+ attribution_score.observe(0.0)+ return AttributionResult(+ actor_id="unknown",+ actor_name="Unknown Actor",+ confidence_score=0.0,+ matched_indicators=[],+ reasoning=["Actor catalog is empty"],+ timestamp=datetime.now(UTC),+ )++ try:+ actor_scores: dict[str, dict[str, Any]] = {}+ for actor_id, profile in self._actor_profiles.items():+ actor_scores[actor_id] = await self._score_actor_match(profile, iocs, mitre_techniques, case_metadata)+ except Exception:+ attribution_requests.labels(result="error").inc()+ raise++ best_actor_id = max(actor_scores.keys(), key=lambda k: actor_scores[k]["total_score"])+ best = actor_scores[best_actor_id]+ best_score = round(best["total_score"], 4)++ if best["total_score"] < self._confidence_threshold:+ attribution_requests.labels(result="unknown").inc()+ attribution_score.observe(best_score)+ return AttributionResult(+ actor_id="unknown",+ actor_name="Unknown Actor",+ confidence_score=0.0,+ matched_indicators=[],+ reasoning=[f"No actor exceeded confidence threshold of {self._confidence_threshold}"],+ timestamp=datetime.now(UTC),+ )++ attribution_requests.labels(result="matched").inc()+ attribution_score.observe(best_score)+ return AttributionResult(+ actor_id=best_actor_id,+ actor_name=self._actor_profiles[best_actor_id].name,+ confidence_score=best_score,+ matched_indicators=best["matched_indicators"],+ reasoning=best["reasoning"],+ timestamp=datetime.now(UTC),+ )++ async def _score_actor_match(+ self,+ profile: ThreatActorProfile,+ iocs: list[dict[str, Any]],+ mitre_techniques: list[str],+ case_metadata: dict[str, Any],+ ) -> dict[str, Any]:+ """Score one actor profile against the observed indicators."""+ matched_indicators: list[str] = []+ reasoning: list[str] = []+ components = {"ttp": 0.0, "tool": 0.0, "target": 0.0, "ioc": 0.0}++ if profile.ttps:+ matched_techniques = sorted(set(profile.ttps) & set(mitre_techniques))+ if matched_techniques:+ ratio = len(matched_techniques) / len(profile.ttps)+ components["ttp"] = ratio * WEIGHT_TTP+ matched_indicators.extend(matched_techniques)+ reasoning.append(f"Matched {len(matched_techniques)}/{len(profile.ttps)} TTPs: " + ", ".join(matched_techniques))++ if profile.tools:+ # Match tool names with an alphanumeric-only boundary instead of+ # ``\b``. Python's ``\b`` treats ``_`` as a word character, so+ # ``\bminiduke\b`` would NOT match ``miniduke_v3.dll`` — exactly+ # the kind of malware-filename pattern we care about. Lookarounds+ # on ``[a-zA-Z0-9]`` correctly reject only true alphanumeric+ # neighbours (so ``x-agentic`` still doesn't match ``x-agent``).+ # Tools are matched against the IOC value plus any free-text+ # description/tags fields a caller may attach.+ actor_tools_lower = [t.lower() for t in profile.tools if t]+ tool_patterns = {+ tool: re.compile(+ rf"(?<![a-zA-Z0-9]){re.escape(tool)}(?![a-zA-Z0-9])",+ re.IGNORECASE,+ )+ for tool in actor_tools_lower+ }+ matched_tools: list[str] = []+ for ioc in iocs:+ haystack_parts = [+ str(ioc.get("value", "")),+ str(ioc.get("description", "")),+ ]+ tags = ioc.get("tags") or []+ if isinstance(tags, list):+ haystack_parts.extend(str(t) for t in tags)+ haystack = " ".join(haystack_parts).lower()+ if not haystack.strip():+ continue+ for tool, pattern in tool_patterns.items():+ if pattern.search(haystack):+ matched_tools.append(tool)+ unique_tools = sorted(set(matched_tools))+ if unique_tools:+ ratio = len(unique_tools) / len(profile.tools)+ components["tool"] = ratio * WEIGHT_TOOL+ matched_indicators.extend(unique_tools)+ reasoning.append("Matched tools: " + ", ".join(unique_tools))++ case_targets = case_metadata.get("targets", []) if case_metadata else []+ if profile.targets and case_targets:+ matched_targets = sorted({t.lower() for t in profile.targets} & {t.lower() for t in case_targets})+ if matched_targets:+ ratio = len(matched_targets) / len(profile.targets)+ components["target"] = ratio * WEIGHT_TARGET+ matched_indicators.extend(matched_targets)+ reasoning.append("Matched target sectors: " + ", ".join(matched_targets))++ if iocs and self._os_store is not None:+ try:+ hits = await self._lookup_iocs(iocs)+ if hits:+ matched_indicators.extend(hits)+ ratio = min(len(hits) / max(len(iocs), 1), 1.0)+ components["ioc"] = ratio * WEIGHT_IOC+ reasoning.append(f"Matched {len(hits)}/{len(iocs)} IOCs against collected threat intel")+ except Exception as exc: # pragma: no cover - defensive+ logger.warning("IOC lookup failed; ignoring IOC component", error=str(exc))+ elif iocs:+ reasoning.append("IOC component unavailable: no os_store wired (TTP/tool/target only)")++ total_score = sum(components.values()) * profile.confidence_score+ return {+ "total_score": total_score,+ "components": components,+ "matched_indicators": matched_indicators,+ "reasoning": reasoning,+ }++ async def _lookup_iocs(self, iocs: list[dict[str, Any]]) -> list[str]:+ """Return IOC values that exist in the ``threatintel-iocs`` index.++ Delegates to ``OpenSearchStore.match_ioc_values`` so callers don't+ reach into the private OpenSearch client.+ """+ values = [str(i.get("value", "")) for i in iocs if i.get("value")]+ if not values or self._os_store is None:+ return []+ return await self._os_store.match_ioc_values(values)++ async def get_actor_profile(self, actor_id: str) -> ThreatActorProfile | None:+ """Retrieve a threat actor profile by ID."""+ return self._actor_profiles.get(actor_id)++ async def list_actor_profiles(self) -> list[ThreatActorProfile]:+ """List all known threat actor profiles."""+ return list(self._actor_profiles.values())++ async def update_actor_profile(self, profile: ThreatActorProfile) -> None:+ """Add or replace a threat actor profile in the in-memory catalog."""+ self._actor_profiles[profile.id] = profile+ logger.info("Updated threat actor profile", actor_id=profile.id)diff --git a/services/threatintel/app/api/__init__.py b/services/threatintel/app/api/__init__.pynew file mode 100644index 000000000..5733379b4--- /dev/null+++ b/services/threatintel/app/api/__init__.py@@ -0,0 +1,5 @@+"""+HTTP API routers for the threat intelligence service.++AiSOC — open-source AI Security Operations Center (MIT License)+"""diff --git a/services/threatintel/app/api/actor_attribution.py b/services/threatintel/app/api/actor_attribution.pynew file mode 100644index 000000000..27e8297c5--- /dev/null+++ b/services/threatintel/app/api/actor_attribution.py@@ -0,0 +1,114 @@+"""HTTP API for threat actor attribution.++The attribution engine is held on ``app.state.attribution_engine`` so the+``os_store`` and any future shared dependencies can be injected at startup+(see ``services/threatintel/app/main.py``). FastAPI dependencies pull the+engine from the request, which keeps tests and per-request overrides+straightforward.+"""++from __future__ import annotations++from typing import Any++import structlog+from fastapi import APIRouter, Depends, HTTPException, Request+from pydantic import BaseModel, Field++from app.actors.attribution import (+ AttributionResult,+ ThreatActorAttributionEngine,+ ThreatActorProfile,+)++logger = structlog.get_logger(__name__)+router = APIRouter(prefix="/api/v1/actors", tags=["threat-actors"])+++def get_attribution_engine(request: Request) -> ThreatActorAttributionEngine:+ """FastAPI dependency that returns the engine bound at startup."""+ engine = getattr(request.app.state, "attribution_engine", None)+ if engine is None:+ raise HTTPException(+ status_code=503,+ detail="Attribution engine not initialized",+ )+ return engine+++class AttributionRequest(BaseModel):+ """Body for ``POST /attribute``.++ ``case_metadata`` is optional; when omitted the target-sector component+ of the score is skipped.+ """++ iocs: list[dict[str, Any]] = Field(+ default_factory=list,+ description=("Indicators of compromise. Each item should include 'value' and ideally 'type' (e.g. 'ipv4', 'domain', 'sha256')."),+ )+ mitre_techniques: list[str] = Field(+ default_factory=list,+ description="Observed MITRE ATT&CK technique IDs (e.g. ['T1566', 'T1059']).",+ )+ case_metadata: dict[str, Any] | None = Field(+ default=None,+ description=("Free-form case metadata. 'targets' (list of sector strings) is the only field consulted today."),+ )++[email protected]("/attribute", response_model=AttributionResult)+async def attribute_incident(+ body: AttributionRequest,+ engine: ThreatActorAttributionEngine = Depends(get_attribution_engine),+) -> AttributionResult:+ """Attribute an incident to the highest-scoring known actor.++ Returns ``actor_id="unknown"`` when no actor exceeds the engine's+ confidence threshold.+ """+ try:+ result = await engine.attribute_incident(+ iocs=body.iocs,+ mitre_techniques=body.mitre_techniques,+ case_metadata=body.case_metadata or {},+ )+ logger.info(+ "Incident attributed",+ actor=result.actor_name,+ confidence=result.confidence_score,+ )+ return result+ except Exception as exc:+ logger.error("Incident attribution failed", error=str(exc))+ raise HTTPException(status_code=500, detail=f"Attribution failed: {exc}") from exc++[email protected]("/profiles", response_model=list[ThreatActorProfile])+async def list_actor_profiles(+ engine: ThreatActorAttributionEngine = Depends(get_attribution_engine),+) -> list[ThreatActorProfile]:+ """List all known threat actor profiles in the catalog."""+ try:+ profiles = await engine.list_actor_profiles()+ logger.info("Retrieved threat actor profiles", count=len(profiles))+ return profiles+ except Exception as exc:+ logger.error("Failed to retrieve actor profiles", error=str(exc))+ raise HTTPException(status_code=500, detail=f"Failed to retrieve profiles: {exc}") from exc++[email protected]("/profiles/{actor_id}", response_model=ThreatActorProfile)+async def get_actor_profile(+ actor_id: str,+ engine: ThreatActorAttributionEngine = Depends(get_attribution_engine),+) -> ThreatActorProfile:+ """Retrieve a single threat actor profile by ID (404 if unknown)."""+ profile = await engine.get_actor_profile(actor_id)+ if profile is None:+ raise HTTPException(+ status_code=404,+ detail=f"Actor profile '{actor_id}' not found",+ )+ logger.info("Retrieved threat actor profile", actor_id=actor_id)+ return profilediff --git a/services/threatintel/app/main.py b/services/threatintel/app/main.pyindex 81716bb61..893b64b64 100644--- a/services/threatintel/app/main.py+++ b/services/threatintel/app/main.py@@ -23,7 +23,9 @@ from opensearchpy import AsyncOpenSearchfrom prometheus_client import Counter, make_asgi_appfrom qdrant_client import AsyncQdrantClient+from app.actors.attribution import ThreatActorAttributionEnginefrom app.airgap import airgap_status, is_host_allowed_for_airgap+from app.api.actor_attribution import router as actor_attribution_routerfrom app.clients.cisa_kev import CisaKevClientfrom app.clients.misp import MispClientfrom app.clients.otx import OtxClient@@ -190,11 +192,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:# Register TAXII feeds (skipped entirely if the configured TAXII server# is on the public Internet and AISOC_AIRGAPPED=1 — this prevents even# a single boot-time DNS lookup from leaking the deployment).- if (- settings.TAXII_URL- and settings.TAXII_COLLECTION_IDS- and _airgap_check_feed_url("taxii", settings.TAXII_URL)- ):+ if settings.TAXII_URL and settings.TAXII_COLLECTION_IDS and _airgap_check_feed_url("taxii", settings.TAXII_URL):for col_id in settings.TAXII_COLLECTION_IDS.split(","):col_id = col_id.strip()if col_id:@@ -243,6 +241,11 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:app.state.scheduler = schedulerapp.state.pipeline = pipelineapp.state.redis = redis+ app.state.os_store = os_store++ # Threat actor attribution engine — shares the os_store so the IOC+ # component of the score can match against collected threat intel.+ app.state.attribution_engine = ThreatActorAttributionEngine(os_store=os_store)yield@@ -268,6 +271,9 @@ app = FastAPI(metrics_app = make_asgi_app()app.mount("/metrics", metrics_app)+# Threat actor attribution router (v0)+app.include_router(actor_attribution_router)+@app.get("/health")async def health() -> dict:diff --git a/services/threatintel/app/storage/opensearch.py b/services/threatintel/app/storage/opensearch.pyindex 1686e8baf..7008c5fec 100644--- a/services/threatintel/app/storage/opensearch.py+++ b/services/threatintel/app/storage/opensearch.py@@ -145,6 +145,27 @@ class OpenSearchStore:)return [hit["_source"] for hit in resp["hits"]["hits"]]+ async def match_ioc_values(self, values: list[str]) -> list[str]:+ """Return the subset of ``values`` that exist in the IOC index.++ Public read-path consumed by callers that need to verify an arbitrary+ bag of indicator values (e.g. the threat actor attribution engine)+ against collected threat intel. Returns a deterministically sorted+ list of matched values; non-string and empty inputs are filtered.+ """+ cleaned = sorted({str(v) for v in values if v})+ if not cleaned:+ return []+ resp = await self._os.search(+ index=_IOC_INDEX,+ body={+ "query": {"terms": {"value": cleaned}},+ "size": min(len(cleaned), 100),+ "_source": ["value"],+ },+ )+ return sorted({hit["_source"]["value"] for hit in resp["hits"]["hits"]})+def _stable_id(type_: str, value: str, source: str) -> str:key = f"{type_}:{value}:{source}"diff --git a/services/threatintel/tests/test_actor_attribution.py b/services/threatintel/tests/test_actor_attribution.pynew file mode 100644index 000000000..d6482e344--- /dev/null+++ b/services/threatintel/tests/test_actor_attribution.py@@ -0,0 +1,289 @@+"""Tests for the threat actor attribution engine.++These tests exercise the v0 hardcoded actor catalog. They are pure unit+tests — no network, no OpenSearch — so they intentionally do not pass an+``os_store`` and the IOC component of the score stays at zero, which matches+what the production engine does when the dependency is missing.+"""++from __future__ import annotations++import pytest+from app.actors.attribution import (+ AttributionResult,+ ThreatActorAttributionEngine,+ ThreatActorProfile,+)+++def attribution_engine() -> ThreatActorAttributionEngine:+ """A fresh engine bound to the default v0 catalog and no os_store."""+ return ThreatActorAttributionEngine()+++def sample_iocs() -> list[dict]:+ return [+ {+ "value": "malicious-domain.com",+ "type": "domain",+ "source": "test-feed",+ "first_seen": "2023-01-01T00:00:00Z",+ "last_seen": "2023-01-01T00:00:00Z",+ },+ {+ "value": "192.168.1.100",+ "type": "ipv4",+ "source": "test-feed",+ "first_seen": "2023-01-01T00:00:00Z",+ "last_seen": "2023-01-01T00:00:00Z",+ },+ ]+++def sample_mitre_techniques() -> list[str]:+ # Three of these (T1566, T1059, T1071) overlap APT28's seeded TTP set.+ return ["T1566", "T1059", "T1071"]+++def sample_case_metadata() -> dict:+ return {+ "targets": ["government", "military"],+ "industry": "defense",+ "geography": "US",+ }+++async def test_initialize_known_actors(attribution_engine):+ """The default catalog contains at least the seeded actors."""+ profiles = await attribution_engine.list_actor_profiles()+ assert len(profiles) > 0+ actor_ids = [profile.id for profile in profiles]+ assert "APT28" in actor_ids+++async def test_get_actor_profile(attribution_engine):+ """Lookup hits a known actor and misses an unknown one."""+ profile = await attribution_engine.get_actor_profile("APT28")+ assert profile is not None+ assert profile.name == "APT28 (Fancy Bear)"++ missing = await attribution_engine.get_actor_profile("NONEXISTENT")+ assert missing is None+++async def test_attribute_incident_high_confidence(+ attribution_engine,+ sample_iocs,+ sample_mitre_techniques,+ sample_case_metadata,+):+ """A case overlapping APT28 across TTPs/tools/targets attributes to APT28."""+ sample_iocs.append(+ {+ "value": "x-agent-malware.exe",+ "type": "filename",+ "source": "test-analysis",+ "first_seen": "2023-01-01T00:00:00Z",+ "last_seen": "2023-01-01T00:00:00Z",+ }+ )++ result = await attribution_engine.attribute_incident(+ iocs=sample_iocs,+ mitre_techniques=sample_mitre_techniques,+ case_metadata=sample_case_metadata,+ )++ assert isinstance(result, AttributionResult)+ assert result.actor_id == "APT28"+ assert result.confidence_score > 0+ joined = " ".join(result.reasoning)+ assert "TTP" in joined+ assert "tools" in joined.lower()+++async def test_attribute_incident_no_match(attribution_engine):+ """Below-threshold matches return ``unknown``."""+ iocs = [{"value": "unknown-indicator", "type": "generic", "source": "test"}]+ techniques = ["T9999"] # not in any seeded actor's TTP list+ case_metadata = {"targets": ["unknown-sector"]}++ result = await attribution_engine.attribute_incident(+ iocs=iocs,+ mitre_techniques=techniques,+ case_metadata=case_metadata,+ )++ assert isinstance(result, AttributionResult)+ assert result.actor_id == "unknown"+ assert result.confidence_score == 0.0+++async def test_update_actor_profile(attribution_engine):+ """Adding a profile makes it visible to subsequent lookups."""+ new_profile = ThreatActorProfile(+ id="TEST_ACTOR",+ name="Test Actor",+ aliases=["Testy"],+ description="A test threat actor",+ sophistication_level="novice",+ primary_motivation="testing",+ secondary_motivations=["learning"],+ ttps=["T1000"],+ tools=["test-tool"],+ targets=["test-environment"],+ confidence_score=0.5,+ )++ await attribution_engine.update_actor_profile(new_profile)++ retrieved = await attribution_engine.get_actor_profile("TEST_ACTOR")+ assert retrieved is not None+ assert retrieved.name == "Test Actor"+ assert retrieved.description == "A test threat actor"+++async def test_ioc_component_skipped_without_os_store(attribution_engine, sample_iocs, sample_mitre_techniques, sample_case_metadata):+ """Without an os_store, reasoning explicitly notes IOC scoring is unavailable."""+ result = await attribution_engine.attribute_incident(+ iocs=sample_iocs,+ mitre_techniques=sample_mitre_techniques,+ case_metadata=sample_case_metadata,+ )+ joined = " ".join(result.reasoning)+ assert "no os_store wired" in joined+++async def test_tool_match_handles_underscore_filenames():+ """Tool matching survives underscore-separated malware filenames.++ Regression test for the regex boundary fix: Python's ``\\b`` treats ``_``+ as a word character, so ``\\bminiduke\\b`` would NOT match+ ``miniduke_v3.dll``. The engine uses an alphanumeric-only lookaround to+ fix this, and this test pins that behaviour.+ """+ engine = ThreatActorAttributionEngine()+ iocs = [+ {"value": "miniduke_v3.dll", "type": "filename", "source": "test"},+ {"value": "cosmicduke.exe", "type": "filename", "source": "test"},+ ]+ result = await engine.attribute_incident(+ iocs=iocs,+ # Pair with one APT29 TTP so total score crosses the default threshold.+ mitre_techniques=["T1059", "T1071", "T1041"],+ case_metadata={"targets": ["government"]},+ )+ assert result.actor_id == "APT29"+ joined = " ".join(result.reasoning).lower()+ assert "miniduke" in joined+ assert "cosmicduke" in joined+++async def test_tool_match_rejects_alphanumeric_neighbours():+ """``x-agent`` must not match ``x-agentic`` (alphanumeric neighbour)."""+ profile = ThreatActorProfile(+ id="TEST",+ name="Test",+ ttps=["T1000"],+ tools=["x-agent"],+ targets=["test"],+ confidence_score=0.8,+ )+ engine = ThreatActorAttributionEngine(catalog={"TEST": profile})+ iocs = [+ # "x-agentic-platform" should NOT match the tool "x-agent".+ {"value": "x-agentic-platform.com", "type": "domain", "source": "test"},+ ]+ result = await engine.attribute_incident(+ iocs=iocs,+ mitre_techniques=[],+ case_metadata={},+ )+ # No TTP, no tool, no target overlap → unknown.+ assert result.actor_id == "unknown"+++async def test_tool_match_uses_description_and_tags():+ """Tool matching scans description and tags, not just IOC value."""+ profile = ThreatActorProfile(+ id="TEST",+ name="Test",+ ttps=["T1059"],+ tools=["mimikatz"],+ targets=["lab"],+ confidence_score=0.9,+ )+ engine = ThreatActorAttributionEngine(catalog={"TEST": profile})+ iocs = [+ {+ "value": "evil.example",+ "type": "domain",+ "source": "test",+ "description": "drops mimikatz on host",+ "tags": ["credential-theft"],+ }+ ]+ result = await engine.attribute_incident(+ iocs=iocs,+ mitre_techniques=["T1059"],+ case_metadata={"targets": ["lab"]},+ )+ assert result.actor_id == "TEST"+ joined = " ".join(result.reasoning).lower()+ assert "mimikatz" in joined+++async def test_env_threshold_overrides_default(monkeypatch):+ """``AISOC_ATTRIBUTION_THRESHOLD`` is honoured when valid."""+ monkeypatch.setenv("AISOC_ATTRIBUTION_THRESHOLD", "0.95")+ engine = ThreatActorAttributionEngine()+ # A weak signal that would normally pass the default 0.3 threshold+ # should now fall under the 0.95 bar and resolve to "unknown".+ result = await engine.attribute_incident(+ iocs=[],+ mitre_techniques=["T1566"], # one APT28 TTP only+ case_metadata={},+ )+ assert result.actor_id == "unknown"+++async def test_env_threshold_invalid_falls_back_to_default(monkeypatch, caplog):+ """A garbage env value must not silently disable attribution."""+ monkeypatch.setenv("AISOC_ATTRIBUTION_THRESHOLD", "not-a-number")+ engine = ThreatActorAttributionEngine()+ # Default 0.3 threshold should still allow APT28 to attribute on a strong+ # multi-component signal.+ result = await engine.attribute_incident(+ iocs=[],+ mitre_techniques=["T1566", "T1059", "T1071", "T1041"],+ case_metadata={"targets": ["government", "military"]},+ )+ assert result.actor_id == "APT28"+++async def test_empty_catalog_returns_unknown():+ """An empty catalog cannot attribute anything."""+ engine = ThreatActorAttributionEngine(catalog={})+ result = await engine.attribute_incident(+ iocs=[{"value": "x", "type": "y", "source": "z"}],+ mitre_techniques=["T1059"],+ case_metadata={"targets": ["any"]},+ )+ assert result.actor_id == "unknown"+ assert "catalog is empty" in " ".join(result.reasoning).lower()