--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+unsubscribe@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at https://groups.google.com/group/wazuh.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/9110362b-1da7-4a13-a32b-90be2cd87dd8%40googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+unsubscribe@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at https://groups.google.com/group/wazuh.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/0a879caa-48a0-48c5-a969-be8c00e691d6%40googlegroups.com.
I’m in a similar situation in which my company customizes logs, including the timestamp format, and built a custom decoder. If I understand correctly, timestamps are estimated and rules with frequency= and timeframe= should work.
I’m trying to build unit tests for such rules, using ossec-logtest. Currently, these don’t work — I assume because of timestamp: '(null)' for all the events with non-standard timestamps. Is there a way to fix this — either by having the decoder read the timestamps correctly or somehow convincing ossec-logtest that the simulated log events all occurred within the timeframe?
Many thanks!
Hi,That should not present any trouble in term of the alert generation, the manager will put the time where it receives the event as the timestamp.Best Regards,On Wed, Apr 18, 2018 at 10:29 PM, J. Desipeda <james...@gmail.com> wrote:Thank you for the response :)I've actually finished creating a successful regex:<decoder name="hmailserver"><prematch>SMTPD</prematch><regex>^"(\w+)" (\d+) (\d+) "(\d+-\d+-\d+) (\d+:\d+:\d+.\d+)" "(\d+.\d+.\d+.\d+)" "(\w+): (\d+) (\.+)"$</regex><order>source,threadid,sessionid,date,time,srcip,action,status,message</order></decoder>Will the null timestamp affect this kind of log when it appears in the interface?--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at https://groups.google.com/group/wazuh.
Thanks!
Here’s an example from the Ansible code we’re using to test some rules:
# mimic ten (10) 503 return codes within 240 seconds in `/var/log/squid/access.log`
- name: 'Test rule 35058'
command:
cmd: '/var/ossec/bin/ossec-logtest -U 35058:10:squid-accesslog'
stdin: |
01/Jan/2021:16:23:08 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:23:18 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:23:28 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:23:38 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:23:48 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:23:58 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:24:08 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:24:18 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:24:28 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:24:38 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:24:48 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
01/Jan/2021:16:24:58 243 3681 10.10.10.10 TCP_TUNNEL/503 14488 CONNECT 1.2.3.4:443 url.domain.com - ORIGINAL_DST/1.2.3.4 -
FWIW, we use a similar task to test other rules and they work fine where we haven’t changed the log format. In addition, rules that operate on a single event for the same log (same format) also work fine with this type of task.
What’s different here is that the timestamps don’t seem to be recognized and the parent rule fires ten (10) times.
The timestamp format is %tg in the squid log format.
Thanks again!
Maybe this is relevant: in the custom decoder to recognize this log format, I tried to get clever recognizing the date with <prematch>^\d\d/\w\w\w/2\d\d\d:\d\d:\d\d:\d\d\s+\d+ \d+ \S+ TCP_\S+ .... Could that mess up the timestamp parsing? Thanks!