I've written a rule for alerting ssh event with "failed password". This rule is here:
rule "Hello World"
when
accumulate(m:Message(eventType=="Failed password") over window:time( 59s );s:count(m);s>3)
then
System.out.println( "success" );
Alert alert=new Alert("ssh","test");
insert(alert);
end
This is working for the first scenario. But I want to extend this rule. I want to accumulate ssh event with "failed password" for with the same Src_ip address. For example, if I have 4 failed password ssh event in 59s from three different src_ip, the rule does not match, but when I have 4 failed password ssh event in 59s from one src_ip, rule matches. How I should rewrite this rule for this scenario.