feat: clickable WAF event rows with detail drawer

- WafEvent model: expose rawData field from DB
- DataTable: add optional onRowClick prop with hover cursor
- WafEventsClient: clicking a row opens a right-side drawer showing
  all event fields plus the raw Coraza audit JSON (pretty-printed)

Safety: rawData is rendered via JSON.stringify into a <pre> element,
never via dangerouslySetInnerHTML, so attack payloads are displayed
as inert text.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
fuomag9
2026-03-04 18:21:08 +01:00
parent edd4e6879f
commit 77d3e35c63
3 changed files with 120 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ export type WafEvent = {
ruleId: number | null;
ruleMessage: string | null;
severity: string | null;
rawData: string | null;
};
function buildSearch(search?: string) {
@@ -53,5 +54,6 @@ export async function listWafEvents(limit = 50, offset = 0, search?: string): Pr
ruleId: r.ruleId ?? null,
ruleMessage: r.ruleMessage ?? null,
severity: r.severity ?? null,
rawData: r.rawData ?? null,
}));
}