2020-08-06 12:21 PM
2020-08-06 12:36 PM
Unless something has changed you can not use entity keys in EPL rules.
This must be changed -> port_dst_all= 22,3389 to something like ip.dstport in (22,3389)
Also action is an array key so it must be written like this -> (isOneOfIgnoreCase(action,{ 'accept' }))
2020-08-06 01:10 PM
Hi, Thanks for the reply.. Still a new error
Syntax error in module. Incorrect syntax near 'FOLLOWEDBY' expecting a closing parenthesis ')' but found an identifier at line 11 column 2, please check the filter specification within the from clause [@RSAAlert(oneInSeconds=0)
SELECT * FROM
Event (
medium = 1
AND device_type='checkpointfw1'
AND ip_src IS NOT NULL
AND ip_dst IS NOT NULL
AND (isOneOfIgnoreCase(action,{ 'accept' }))
AND alert_id IS 'TS-Outbound'
AND ip.dstport IN (22,3389)
FOLLOWEDBY (isNotOneOfIgnoreCase(action,{ 'drop' }))
).std:groupwin(ip_src)
.win:time_length_batch(100 sec, 1)
.std:unique(ip_src)
GROUP BY ip_dst
HAVING count(ip_src) = 1]
2020-08-06 03:56 PM
I may be wrong, but I don't believe FOLLOWEDBY is valid EPL language.
I don't want to assume I know exactly what you're trying to do here, so….what scenario or traffic pattern are you trying to alert against?
2020-08-06 04:29 PM
Try this if you are doing log data, if packet, change medium to 1
SELECT * FROM Event(
(medium IN ( 32 )
AND device_type IN ( 'checkpointfw1' )
AND ip_src IS NOT NULL
AND ip_dst IS NOT NULL
AND isOneOfIgnoreCase(action,{ 'accept' })
AND ( 'TS-Outbound' = ANY( alert_id ) )
AND ip_dstport IN ( 22 , 3389 ))
OR
(isNotOneOfIgnoreCase(action,{ 'drop' }))
).win:time(100 Seconds)
MATCH_RECOGNIZE (
PARTITION BY ip_src
MEASURES E1 as e1_data , E2 as e2_data
PATTERN (E1 E2)
DEFINE
E1 as (E1.medium IN ( 32 ) AND E1. device_type IN ( 'checkpointfw1' ) AND E1.ip_src IS NOT NULL AND E1.ip_dst IS NOT NULL AND isOneOfIgnoreCase(E1.action,{ 'accept' }) AND ( 'TS-Outbound' = ANY( E1.alert_id ) ) AND E1.ip_dstport IN ( 22 , 3389 )),
E2 as (isNotOneOfIgnoreCase(E2.action,{ 'drop' }))
);
This will find either event happening in the time frame, but only trigger if event1 happens then is followed by event 2