From e30f387796d0d801793c7e794ee3c859ec6d52a2 Mon Sep 17 00:00:00 2001 From: Corey Ogburn Date: Thu, 1 Aug 2024 14:46:03 -0600 Subject: [PATCH 01/12] Majority of Work Each engine now keeps track of the AI Summaries generated for all the rules of that engine. When the module starts and during Syncs, an engine will update the AI repo and reload the YAML file. The UI will show the AI Summary if it is present and marked as reviewed. Otherwise, the UI falls back to the extracted description. On the detection getter, call the new MergeAuxilleryData function on the proper engine so that this AI info is present on the detection when requested. This is the only endpoint that returns AI data, searches will not contain these fields. readAiSummary is mocked to make progress. It will be implemented soon. All engines should be configured to put the AiRepo in the same location but this location should NOT be the same as Sigma's rule repos. This would present a problem if somebody didn't use SO's Sigma rules. --- html/css/app.css | 4 + html/index.html | 16 ++- html/js/i18n.js | 1 + html/js/routes/detection.js | 5 + html/js/routes/detection.test.js | 17 +++ model/detection.go | 8 ++ server/detectionengine.go | 1 + server/detectionhandler.go | 16 +++ server/modules/detections/ai.go | 124 ++++++++++++++++++ .../modules/detections/detengine_helpers.go | 3 +- .../detections/detengine_helpers_test.go | 4 +- server/modules/detections/sync.go | 12 +- server/modules/elastalert/elastalert.go | 81 ++++++++++-- server/modules/elastalert/elastalert_test.go | 77 ++++++++++- server/modules/strelka/strelka.go | 72 +++++++++- server/modules/strelka/strelka_test.go | 81 +++++++++++- server/modules/suricata/suricata.go | 61 +++++++++ server/modules/suricata/suricata_test.go | 77 ++++++++++- 18 files changed, 623 insertions(+), 37 deletions(-) create mode 100644 server/modules/detections/ai.go diff --git a/html/css/app.css b/html/css/app.css index 4b79ad05..c8a5af69 100644 --- a/html/css/app.css +++ b/html/css/app.css @@ -684,4 +684,8 @@ tbody tr:hover { .theme--light tbody tr:hover:nth-of-type(even) { background-color: rgba(230, 230, 230, 0.25) !important; +} + +.unset-vertical-align { + vertical-align: unset !important; } \ No newline at end of file diff --git a/html/index.html b/html/index.html index b3381cd9..90d8b7c0 100644 --- a/html/index.html +++ b/html/index.html @@ -1144,10 +1144,18 @@

{{ detect.title }}

-
{{i18n.summary}}
-
- {{ extractedSummary }} -
+ +
{{i18n.references}}