From 37b948339c8ce1c36587785c3da80e598cbdebc9 Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Tue, 18 Apr 2023 08:01:11 +0200 Subject: [PATCH] [BUG] No space between the detector details and the rule panel #522 [BUG] A rule flyout without references have an empty link #521 [FEATURE] Update header size to use euiTitle--small #520 Signed-off-by: Jovan Cvetkovic --- .../rule/create_windows_usb_rule.json | 2 +- cypress/fixtures/sample_detector.json | 8 ++++++-- cypress/fixtures/sample_document.json | 2 +- cypress/integration/3_alerts.spec.js | 14 ++++++++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/cypress/fixtures/integration_tests/rule/create_windows_usb_rule.json b/cypress/fixtures/integration_tests/rule/create_windows_usb_rule.json index 7c84a69a4..3db4cf141 100644 --- a/cypress/fixtures/integration_tests/rule/create_windows_usb_rule.json +++ b/cypress/fixtures/integration_tests/rule/create_windows_usb_rule.json @@ -16,7 +16,7 @@ } ], "log_source": "", - "detection": "selection:\n winlog-event_id:\n - 2003\n - 2100\n - 2102\ncondition: selection", + "detection": "selection:\n winlog.event_id:\n - 2003\n - 2100\n - 2102\ncondition: selection", "level": "low", "false_positives": [ { diff --git a/cypress/fixtures/sample_detector.json b/cypress/fixtures/sample_detector.json index 76d129300..7c92db523 100644 --- a/cypress/fixtures/sample_detector.json +++ b/cypress/fixtures/sample_detector.json @@ -20,7 +20,11 @@ "id": "1a4bd6e3-4c6e-405d-a9a3-53a116e341d4" } ], - "custom_rules": [] + "custom_rules": [ + { + "id": "" + } + ] } } ], @@ -51,7 +55,7 @@ ], "types": ["windows"], "severity": "4", - "ids": ["1a4bd6e3-4c6e-405d-a9a3-53a116e341d4"] + "ids": [] } ] } diff --git a/cypress/fixtures/sample_document.json b/cypress/fixtures/sample_document.json index f8b8b4e2e..521d2f677 100644 --- a/cypress/fixtures/sample_document.json +++ b/cypress/fixtures/sample_document.json @@ -1,3 +1,3 @@ { - "winlog.event_id": "2003" + "winlog.event_id": 2003 } diff --git a/cypress/integration/3_alerts.spec.js b/cypress/integration/3_alerts.spec.js index 71910cf74..1b7ef92f0 100644 --- a/cypress/integration/3_alerts.spec.js +++ b/cypress/integration/3_alerts.spec.js @@ -7,8 +7,9 @@ import moment from 'moment'; import { DETECTOR_TRIGGER_TIMEOUT, OPENSEARCH_DASHBOARDS_URL } from '../support/constants'; import sample_index_settings from '../fixtures/sample_windows_index_settings.json'; import sample_alias_mappings from '../fixtures/sample_alias_mappings.json'; -import sample_detector from '../fixtures/sample_detector.json'; +import sample_detector from '../fixtures/integration_tests/detector/create_usb_detector_data.json'; import sample_document from '../fixtures/sample_document.json'; +import windows_rule_data from '../fixtures/integration_tests/rule/create_windows_usb_rule.json'; const testIndex = 'sample_alerts_spec_cypress_test_index'; const testDetectorName = 'alerts_spec_cypress_test_detector'; @@ -53,7 +54,16 @@ describe('Alerts', () => { ) // Create test detector - .then(() => cy.createDetector(testDetector)) + .then(() => { + cy.createRule(windows_rule_data) + .then((response) => { + testDetector.inputs[0].detector_input.custom_rules[0].id = response.body.response._id; + testDetector.triggers[0].ids.push(response.body.response._id); + }) + .then((response) => { + cy.createDetector(testDetector); + }); + }) .then(() => { // Go to the detectors table page