Error when creating Sigma rule with integer field #12745
Replies: 4 comments 1 reply
-
up |
Beta Was this translation helpful? Give feedback.
-
If you wrap 7023 in single or double quotes within the Sigma rule itself, ie '7023', does that work? |
Beta Was this translation helpful? Give feedback.
-
Hello @defensivedepth, do you think this is some limitation in this moment? Thank you |
Beta Was this translation helpful? Give feedback.
-
@guiausechi With 2.4.70 released yesterday, we have added a new module called That should solve this problem longterm. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version
2.4.10
Installation Method
Network installation on Red Hat derivative like Oracle, Rocky, Alma, etc.
Description
other (please provide detail below)
Installation Type
Distributed
Location
cloud
Hardware Specs
Exceeds minimum requirements
CPU
4
RAM
32
Storage for /
200
Storage for /nsm
600
Network Traffic Collection
other (please provide detail below)
Network Traffic Speeds
Less than 1Gbps
Status
Yes, all services on all nodes are running OK
Salt Status
No, there are no failures
Logs
Yes, there are additional clues in /opt/so/log/ (please provide detail below)
Detail
Hello Team, good afternoon!
We are facing a problem when creating a sigma rule through the graphical interface when the rule has an integer field.
We did not receive any errors converting or creating the rule. However, the rule only does not execute and consequently does not generate alerts. When we make a troubleshooting via so-elastialert-test, we received the following error:
Error running your filter:
RequestError(400, 'verification_exception', {'error': {'root_cause': [{'type': 'verification_exception', 'reason': 'Found 1 problem\nline 1:12: first argument of [:] must be [string], found value [destination.port] type [long]; consider using [==] instead'}], 'type': 'verification_exception', 'reason': 'Found 1 problem\nline 1:12: first argument of [:] must be [string], found value [destination.port] type [long]; consider using [==] instead'}, 'status': 400})
Would have written the following documents to writeback index (default is elastalert_status):
elastalert_error - {'message': "Error running query: RequestError(400, 'verification_exception', 'Found 1 problem\nline 1:12: first argument of [:] must be [string], found value [destination.port] type [long]; consider using [==] instead')", 'traceback': ['Traceback (most recent call last):', ' File "/usr/local/lib/python3.11/site-packages/elastalert/elastalert.py", line 373, in get_hits', ' res = self.thread_data.current_es.search(', ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', ' File "/usr/local/lib/python3.11/site-packages/elasticsearch/client/utils.py", line 152, in _wrapped', ' return func(*args, params=params, headers=headers, **kwargs)', ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', ' File "/usr/local/lib/python3.11/site-packages/elastalert/init.py", line 147, in search', ' results = self.transport.perform_request(', ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^', ' File "/usr/local/lib/python3.11/site-packages/elasticsearch/transport.py", line 392, in perform_request', ' raise e', ' File "/usr/local/lib/python3.11/site-packages/elasticsearch/transport.py", line 358, in perform_request', ' status, headers_response, data = connection.perform_request(', ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^', ' File "/usr/local/lib/python3.11/site-packages/elasticsearch/connection/http_requests.py", line 199, in perform_request', ' self._raise_error(response.status_code, raw_data)', ' File "/usr/local/lib/python3.11/site-packages/elasticsearch/connection/base.py", line 315, in _raise_error', ' raise HTTP_EXCEPTIONS.get(status_code, TransportError)(', "elasticsearch.exceptions.RequestError: RequestError(400, 'verification_exception', 'Found 1 problem\nline 1:12: first argument of [:] must be [string], found value [destination.port] type [long]; consider using [==] instead')"], 'data': {'rule': 'Test rule - aed45a787', 'query': {'query': {'bool': {'filter': {'bool': {'must': [{'range': {'@timestamp': {'gt': '2024-04-02T19:04:15.027348Z', 'lte': '2024-04-02T19:14:15.027348Z'}}}, {'eql': 'any where (destination.port : "7023")\n'}]}}}}, 'sort': [{'@timestamp': {'order': 'asc'}}]}}}
When we adjust the .yml file as recommended, the rule works. However, we would not like to have to do this every time we create a new rule with integer field , because we do not know what will happen if we apply new updates or this rule is updated via the graphical interface it returns to the original configuration, losing what was done via the line command. Is it really a problem or can we do something to solve it?
Rule:
title: Test rule
id: 65354b83-a2ea-4ea6-8414-3ab38be0d409
status: test
description: Test rule
references:
https://github.com/oooo
author: Teste
date: 2024/04/03
modified: 2024/04/03
tags:
logsource:
category: teste
detection:
select_method:
destination.port : 7023
condition: select_method
fields:
falsepositives:
a lot of FPs due to this think of adding more filters such as "User Agent" strings
and more response codes
level: high
Thank you!
Guidelines
Beta Was this translation helpful? Give feedback.
All reactions