Skip to content

armgit / AiSOC

Public Imported from GitHub
0

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

fix(web,api): await App Router params and degrade MITRE coverage gracefully

Beenu Arora08633086b5d3
diff --git a/apps/web/src/app/(app)/alerts/[id]/page.tsx b/apps/web/src/app/(app)/alerts/[id]/page.tsx
index 68f2c82b6..3cb6f65ec 100644
--- a/apps/web/src/app/(app)/alerts/[id]/page.tsx
+++ b/apps/web/src/app/(app)/alerts/[id]/page.tsx
@@ -4,6 +4,11 @@ export const metadata = {
title: 'Alert Detail | AiSOC',
};
-export default function AlertDetailPage({ params }: { params: { id: string } }) {
- return <AlertDetailView alertId={params.id} />;
+export default async function AlertDetailPage({
+ params,
+}: {
+ params: Promise<{ id: string }>;
+}) {
+ const { id } = await params;
+ return <AlertDetailView alertId={id} />;
}
diff --git a/apps/web/src/app/(app)/cases/[id]/page.tsx b/apps/web/src/app/(app)/cases/[id]/page.tsx
index e3cfbd453..47ff3f990 100644
--- a/apps/web/src/app/(app)/cases/[id]/page.tsx
+++ b/apps/web/src/app/(app)/cases/[id]/page.tsx
@@ -1,13 +1,14 @@
import { CaseWorkspace } from '@/components/cases/CaseWorkspace';
interface CasePageProps {
- params: { id: string };
+ params: Promise<{ id: string }>;
}
export const metadata = {
title: 'Case workspace | AiSOC',
};
-export default function CaseDetailPage({ params }: CasePageProps) {
- return <CaseWorkspace caseId={params.id} />;
+export default async function CaseDetailPage({ params }: CasePageProps) {
+ const { id } = await params;
+ return <CaseWorkspace caseId={id} />;
}
diff --git a/apps/web/src/app/(app)/compliance/[framework]/page.tsx b/apps/web/src/app/(app)/compliance/[framework]/page.tsx
index c0dca63e8..4c52d8fa1 100644
--- a/apps/web/src/app/(app)/compliance/[framework]/page.tsx
+++ b/apps/web/src/app/(app)/compliance/[framework]/page.tsx
@@ -2,7 +2,7 @@ import { Metadata } from 'next';
import { FrameworkView } from '@/components/compliance/FrameworkView';
interface Props {
- params: { framework: string };
+ params: Promise<{ framework: string }>;
}
const FRAMEWORK_NAMES: Record<string, string> = {
@@ -15,14 +15,16 @@ const FRAMEWORK_NAMES: Record<string, string> = {
};
export async function generateMetadata({ params }: Props): Promise<Metadata> {
- const name = FRAMEWORK_NAMES[params.framework] ?? params.framework.toUpperCase();
+ const { framework } = await params;
+ const name = FRAMEWORK_NAMES[framework] ?? framework.toUpperCase();
return { title: `${name} Compliance — AiSOC` };
}
-export default function ComplianceFrameworkPage({ params }: Props) {
+export default async function ComplianceFrameworkPage({ params }: Props) {
+ const { framework } = await params;
return (
<div className="p-6">
- <FrameworkView framework={params.framework} />
+ <FrameworkView framework={framework} />
</div>
);
}
diff --git a/apps/web/src/app/(app)/detection/[id]/page.tsx b/apps/web/src/app/(app)/detection/[id]/page.tsx
index 7f2a381a2..99421b5bf 100644
--- a/apps/web/src/app/(app)/detection/[id]/page.tsx
+++ b/apps/web/src/app/(app)/detection/[id]/page.tsx
@@ -1,13 +1,16 @@
import { RuleEditor } from '@/components/detections/RuleEditor';
interface DetectionEditPageProps {
- params: { id: string };
+ params: Promise<{ id: string }>;
}
export const metadata = {
title: 'Detection rule | AiSOC',
};
-export default function DetectionEditPage({ params }: DetectionEditPageProps) {
- return <RuleEditor mode="edit" ruleId={params.id} />;
+export default async function DetectionEditPage({
+ params,
+}: DetectionEditPageProps) {
+ const { id } = await params;
+ return <RuleEditor mode="edit" ruleId={id} />;
}
diff --git a/apps/web/src/app/(app)/playbooks/[id]/page.tsx b/apps/web/src/app/(app)/playbooks/[id]/page.tsx
index bedc41635..46775d551 100644
--- a/apps/web/src/app/(app)/playbooks/[id]/page.tsx
+++ b/apps/web/src/app/(app)/playbooks/[id]/page.tsx
@@ -4,14 +4,15 @@ export const metadata = {
title: 'Playbook Editor | AiSOC',
};
-export default function PlaybookEditorPage({
+export default async function PlaybookEditorPage({
params,
}: {
- params: { id: string };
+ params: Promise<{ id: string }>;
}) {
+ const { id } = await params;
return (
<div className="h-full">
- <PlaybookEditor playbookId={params.id} />
+ <PlaybookEditor playbookId={id} />
</div>
);
}
diff --git a/services/api/app/api/v1/endpoints/graph.py b/services/api/app/api/v1/endpoints/graph.py
index 77f4d6d3e..04f6de42b 100644
--- a/services/api/app/api/v1/endpoints/graph.py
+++ b/services/api/app/api/v1/endpoints/graph.py
@@ -345,12 +345,23 @@ async def get_entity_neighbors(
async def get_mitre_coverage(
current_user: CurrentUser = Depends(get_current_user),
) -> list[MitreCoverageItem]:
- """Return MITRE ATT&CK technique coverage aggregated from all tenant alerts."""
+ """Return MITRE ATT&CK technique coverage aggregated from all tenant alerts.
+
+ When the Neo4j knowledge graph is unreachable (e.g. in the public demo),
+ this endpoint returns an empty list rather than 503-ing, so the Coverage
+ UI degrades gracefully instead of breaking the whole page.
+ """
try:
records = await graph_service.get_mitre_coverage(
tenant_id=str(current_user.tenant_id),
)
except Exception as exc:
+ if _is_graph_unavailable(exc):
+ logger.info(
+ "MITRE coverage: graph backend unavailable, returning empty set",
+ exc_info=False,
+ )
+ return []
raise HTTPException(
status_code=status.HTTP_503_SERVICE_UNAVAILABLE,
detail=f"Graph query failed: {exc}",