Files
Aegis/frontend/src/api/system.ts
T
kitos c172a8af00 fix(qa): 5 bug fixes — audit dates, CSP, template modal, MITRE sync timeout, data source auto-sync
- audit_service: set timestamp=datetime.now(utc) explicitly so DB never stores NULL
- AuditLogPage: formatDate handles null/undefined timestamps (was showing Jan 1 1970)
- nginx.conf: add CSP script-src hash for inline script (sha256-31OgE8E9...)
- system.py: MITRE sync now runs in BackgroundTasks — returns immediately, no more 120s timeout
- mitre_sync_job.py: add _run_data_sources_sync job (every 6h) that checks sync_frequency
  and auto-syncs overdue enabled data sources
- SystemPage: MITRE sync result shows "started" vs "complete" message
- test-templates.ts: add updateTemplate() API function
- SystemPage: template name cell is now clickable — opens TemplateDetailModal with
  full edit form (name, description, procedure, detection, platform, severity, tool)
  and Save / Activate / Deactivate / Close buttons
2026-05-19 12:05:35 +02:00

43 lines
1.0 KiB
TypeScript

import client from "./client";
export interface SyncMitreResponse {
message: string;
status?: string;
new?: number;
updated?: number;
}
export interface IntelScanResponse {
message: string;
new_items: number;
}
export interface SchedulerJob {
id: string;
name: string;
next_run_time: string | null;
}
export interface SchedulerStatusResponse {
running: boolean;
jobs: SchedulerJob[];
}
/** Manually trigger MITRE ATT&CK sync. */
export async function triggerMitreSync(): Promise<SyncMitreResponse> {
const { data } = await client.post<SyncMitreResponse>("/system/sync-mitre");
return data;
}
/** Manually trigger threat intelligence scan. */
export async function triggerIntelScan(): Promise<IntelScanResponse> {
const { data } = await client.post<IntelScanResponse>("/system/run-intel-scan");
return data;
}
/** Get scheduler status. */
export async function getSchedulerStatus(): Promise<SchedulerStatusResponse> {
const { data } = await client.get<SchedulerStatusResponse>("/system/scheduler-status");
return data;
}