elastalert icon indicating copy to clipboard operation
elastalert copied to clipboard

Multiple windows event id based correlation rule

Open suchandbabu opened this issue 8 years ago • 6 comments

Hi sir, @Qmando @sathishdsgithub Thank you so much for your support. Sorry if my below mentioned query doesn't make sense, since I am a beginner in Elastalert.

Can you please help me to write a correlation rule for querying multiple windows event ids.

Logic I have mentioned below.

[(4618 AND 6273) AND (4907 OR 4660 OR 4670) AND (4964 OR 4767 )]

I tried using "query_string but" its not allowing to query multiple events, its only querying multiple fields in a single event.

suchandbabu avatar Mar 17 '18 18:03 suchandbabu

@Qmando Requesting your help to solve the above mentioned issue.

suchandbabu avatar Mar 23 '18 19:03 suchandbabu

This is not really supported very well out of the box. One thing you could do is use cardinality rule. Let's say the field you are looking at is called "code".

type: cardinality
filter:
 - terms:
      code: [4618, 6273]
cardinality_field: code
max_cardinality: 1
timeframe:
  hours: 1

This will alert if there is at least one of each 4618 and 6273 in an hour. However, you would need to make a new alert for every combination.

Qmando avatar Mar 23 '18 20:03 Qmando

@Qmando Thanks for your help.

Is there any option to give OR logical condition same like this code which you have mentioned. type: cardinality filter:

  • terms: code: [4618, 6273] cardinality_field: code max_cardinality: 1 timeframe: hours: 1

Also please let me know, how can i correlate between multiple rule. For example Rule name: r1 , r2, r3 and r4. I need to write a rule to alert when r1 AND r2 AND (r3 OR r4) alerted in last 30 minutes.

suchandbabu avatar Mar 24 '18 05:03 suchandbabu

@suchandbabu did you find a way to do that?

Regards

sebash1992 avatar Oct 02 '18 18:10 sebash1992

@suchandbabu @sebash1992 did you find a way of writing a cardinality rule for correlating more than 2 rules?

Regards!

beaesteban01 avatar Feb 09 '21 15:02 beaesteban01

I just figured out that making max_cardinality = n°rules-1 world, in case anyone is interested

beaesteban01 avatar Feb 10 '21 13:02 beaesteban01