I have created the below watcher that looks in my proxy index, it currently works however I would like to tune it.
Would like to only send events to the SIEM that exceed 20 hits for "deviceAction:TCP_AUTH_REDIRECT" from a single source IP within a specified time, lets say 10 minutes. I am new to creating watchers, any ideas on how I can make this happen or if this is even possible?
so the main question here is, how to create a query, that reflects what you need. From what I understand you need to search for all documents
that have a timestamp from now-10m
that are deviceAction:TCP_AUTH_REDIRECT
for those documents you need to aggregate on their sourceIp. And when you find aggregates, that have a count higher than 20 hits, those need to be returned. This works with the min_doc_count parameter of the terms aggregation. Also make sure you read the terms agg docs, especially the approximation part
So trying again to get this watch to work. My ultimate goal now is to look through all source IP addresses, gather a list of all srcIPs for a period of time (let's say 15 minutes) that have more than X (maybe 150) number of "TCP_AUTH_REDIRECT" in the proxy logs "deviceAction" field.
Now, look through that list of srcIPs and if they have at least one successful GET (successful means you'll see a "TCP_NC_MISS" or "TUNNELED" in the "deviceAction" field then exclude those IPs. Those left are sources that I want to review/display.
First, can you use code blocks for better readability, see this markdown documentation for help.
And second and as already written in my last post: Is the query actually returning the data you need? If so, where is the current issue? If not, lets focus on that first.
That is what I need help with, I think I need to build a multiple query but can't figure out how to do it....
Watcher should look through all my data, within a specified amount of time, say 15m, if it sees in the field deviceAction multiple TCP_AUTH_REDIRECT, lets now say 10 consecutive and at no point does it see in the deviceAction field TCP_NC_MISS or TUNNELED then I want it to be reported to me.
Currently my the query only reports sources that have more than 150 TCP_AUTH_REDIRECT in the deviceAction field within a 15 min window. Need to figure out a way to not report those that have a TCP_NC_MISS or TUNNELED within the same specified time window, they could still have 150 TCP_AUTH_REDIRECTS but won't report because TCP_NC_MISS or TUNNELED was seen.
you might be better off asking this in the Elasticsearch forum, as there are much more people to help you. Keep in mind, that Elasticsearch searches on a per document base, when asking (and maybe come up with a concrete example, like some example documents). You might change your indexing strategy/document modeling strategy to support this. You might be able to use a terms aggregation to get all the deviceAction fields during that time grouped per IP to actually exclude a certain ip/set of documents that have been indexed.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.