From 95de5d982ce9b3a72ad056a4a43c1b43f4087821 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Mon, 25 Mar 2024 17:43:48 +0100 Subject: [PATCH 1/2] chg: [test] Check attribute search --- tests/testlive_comprehensive_local.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testlive_comprehensive_local.py b/tests/testlive_comprehensive_local.py index 52de96262bd..a7926df6fca 100644 --- a/tests/testlive_comprehensive_local.py +++ b/tests/testlive_comprehensive_local.py @@ -923,6 +923,9 @@ def test_event_alert_default_enabled(self): self.assertTrue(created_user.autoalert, created_user) self.admin_misp_connector.delete_user(created_user) + def test_attribute_search(self): + request(self.admin_misp_connector, "GET", "/attributes/search/value:8.8.8.8.json") + def test_search_snort_suricata(self): event = create_simple_event() event.add_attribute('ip-src', '8.8.8.8', to_ids=True) From f182cbcec5110cbe4a79e986672d848c8622d396 Mon Sep 17 00:00:00 2001 From: Jakub Onderka Date: Mon, 25 Mar 2024 17:54:38 +0100 Subject: [PATCH 2/2] fix: [search] Attribute search error 500 because of force index search --- app/Controller/AttributesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controller/AttributesController.php b/app/Controller/AttributesController.php index 2d6f13691f8..9694cfac8b8 100644 --- a/app/Controller/AttributesController.php +++ b/app/Controller/AttributesController.php @@ -1576,7 +1576,7 @@ public function search($continue = false) // Force index for performance reasons see #3321 if (isset($filters['value'])) { - $this->paginate['forceIndexHint'] = '(value1, value2)'; + $this->paginate['forceIndexHint'] = 'value1, value2'; } $this->paginate['conditions'] = $params['conditions'];