Subnet Mask in Discover's filter

151 views
Skip to first unread message

joh nte

unread,
Feb 10, 2023, 8:53:48 AM2/10/23
to Wazuh mailing list
Hi,
I would like to know if there's a way to add subnet mask on Wazuh's Discover cause i want to filter out the Non-Routable Address Space from a search.

I've tried, for example, to add the filter:
data.srcip is not one of 10.0.0.0/8 or 192.168.0.0/16

but it doesn't seems to work!.

Is it even possibile?

Thanks,

Giovanni

Federico Gustavo Galland

unread,
Feb 13, 2023, 5:13:02 AM2/13/23
to Wazuh mailing list
Hi there,

There is no subnet mask filters that I'm aware of, but you can perform a simple query with regex such as the following too look for a particular subnet:

{
  "query": {
    "regexp": {
      "data.srcip": "192.168.<0-255>.<0-255>"
    }
  }
}

The example above is equivalent to: 192.168.0.0/16

2023-02-13_07-10.jpg


Let us know if this helped.

Regards,

Federico

joh nte

unread,
Feb 20, 2023, 5:49:36 AM2/20/23
to Wazuh mailing list
Hi Federico,
thanks for the reply!
unfortunately it doesn't seems to work, in fact, in my dashboard, i still visualize all te events containing non-routable address.

for example, if i set this query to exlude results, they're still visible:

{
  "query": {
    "match_phrase": {
      "data.srcip": "10.<0-255>.<0-255>.<0-255>"
    }
  }
}

Federico Gustavo Galland

unread,
Feb 20, 2023, 6:52:00 AM2/20/23
to joh nte, Wazuh mailing list
Hi Joh,

In your quoted query, you are using "match_phrase" instead of "regexp". Make sure to check that out.

Regards,
Federico

--
You received this message because you are subscribed to a topic in the Google Groups "Wazuh mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wazuh/09z6Ga1mZr0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/56905dac-8d7e-4fad-a5f4-4dcdff72e964n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages