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(qa): ISSUE-002 — /detection 500 due to Temporal Dead Zone

Beenu Arorad99fa3df0f03
diff --git a/apps/web/src/components/detections/DetectionsView.tsx b/apps/web/src/components/detections/DetectionsView.tsx
index 4c5fda68c..7880f1bd4 100644
--- a/apps/web/src/components/detections/DetectionsView.tsx
+++ b/apps/web/src/components/detections/DetectionsView.tsx
@@ -20,6 +20,43 @@ import { EmptyState } from '@/components/ui/EmptyState';
const NOW = Date.now();
const ago = (mins: number) => new Date(NOW - mins * 60 * 1000).toISOString();
+const SAMPLE_SIGMA = `title: Suspicious PowerShell Encoded Command
+id: aisoc-rule-001
+status: experimental
+description: Flags powershell.exe spawning with -EncodedCommand
+logsource:
+ product: windows
+ category: process_creation
+detection:
+ selection:
+ Image|endswith: '\\powershell.exe'
+ CommandLine|contains: '-EncodedCommand'
+ condition: selection
+level: high
+tags:
+ - attack.execution
+ - attack.t1059.001
+`;
+
+const SAMPLE_KQL = `// Impossible travel
+SigninLogs
+| where ResultType == 0
+| extend lat = todouble(LocationDetails.geoCoordinates.latitude),
+ lon = todouble(LocationDetails.geoCoordinates.longitude)
+| order by UserPrincipalName, TimeGenerated asc
+| serialize
+| extend prevLat = prev(lat), prevLon = prev(lon), prevTime = prev(TimeGenerated)
+| where (datetime_diff('minute', TimeGenerated, prevTime)) between (1 .. 240)
+| extend km = geo_distance_2points(prevLon, prevLat, lon, lat) / 1000
+| where km / (datetime_diff('minute', TimeGenerated, prevTime) / 60.0) > 900
+| project TimeGenerated, UserPrincipalName, km, IPAddress
+`;
+
+const SAMPLE_EQL = `sequence by aws.account.id with maxspan=1h
+ [iam where event.action == "CreateAccessKey"]
+ [aws where event.module == "guardduty" and event.severity >= 7]
+`;
+
const DEMO_RULES: DetectionRule[] = [
{
id: 'rule-001',
@@ -460,41 +497,3 @@ function Toggle({ enabled, onChange }: ToggleProps) {
);
}
-// ─── Sample bodies ────────────────────────────────────────────────────────────
-
-const SAMPLE_SIGMA = `title: Suspicious PowerShell Encoded Command
-id: aisoc-rule-001
-status: experimental
-description: Flags powershell.exe spawning with -EncodedCommand
-logsource:
- product: windows
- category: process_creation
-detection:
- selection:
- Image|endswith: '\\powershell.exe'
- CommandLine|contains: '-EncodedCommand'
- condition: selection
-level: high
-tags:
- - attack.execution
- - attack.t1059.001
-`;
-
-const SAMPLE_KQL = `// Impossible travel
-SigninLogs
-| where ResultType == 0
-| extend lat = todouble(LocationDetails.geoCoordinates.latitude),
- lon = todouble(LocationDetails.geoCoordinates.longitude)
-| order by UserPrincipalName, TimeGenerated asc
-| serialize
-| extend prevLat = prev(lat), prevLon = prev(lon), prevTime = prev(TimeGenerated)
-| where (datetime_diff('minute', TimeGenerated, prevTime)) between (1 .. 240)
-| extend km = geo_distance_2points(prevLon, prevLat, lon, lat) / 1000
-| where km / (datetime_diff('minute', TimeGenerated, prevTime) / 60.0) > 900
-| project TimeGenerated, UserPrincipalName, km, IPAddress
-`;
-
-const SAMPLE_EQL = `sequence by aws.account.id with maxspan=1h
- [iam where event.action == "CreateAccessKey"]
- [aws where event.module == "guardduty" and event.severity >= 7]
-`;