fix(qa): 5 bug fixes — audit dates, CSP, template modal, MITRE sync timeout, data source auto-sync
Some checks failed
Aegis CI / lint-and-test (push) Has been cancelled

- 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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
kitos
2026-05-19 12:05:35 +02:00
parent fd476ce460
commit 63da22b77e
8 changed files with 355 additions and 30 deletions

View File

@@ -2,8 +2,9 @@ import client from "./client";
export interface SyncMitreResponse {
message: string;
new: number;
updated: number;
status?: string;
new?: number;
updated?: number;
}
export interface IntelScanResponse {

View File

@@ -98,6 +98,17 @@ export async function createTemplate(
return data;
}
// ── Update (admin) ────────────────────────────────────────────────
/** Update fields of an existing test template. Admin/lead only. */
export async function updateTemplate(
id: string,
payload: Partial<CreateTemplatePayload>,
): Promise<TestTemplate> {
const { data } = await client.patch<TestTemplate>(`/test-templates/${id}`, payload);
return data;
}
// ── Stats (admin) ──────────────────────────────────────────────────
export interface TemplateStats {