@@ -125,12 +125,10 @@ def _update_portscan_index_hash(
125125 # if no first seen ts is set, then this flow is the first seen
126126 key = f"{ base } :first_seen"
127127 pipe .zadd (key , {ip : flow .starttime }, nx = True )
128- pipe .expire (key , self .tw_width , nx = True )
129128
130129 key = f"{ base } :last_seen"
131130 # last seen is now. this flow.
132131 pipe .zadd (key , {ip : flow .starttime })
133- pipe .expire (key , self .tw_width , nx = True )
134132
135133 return pipe
136134
@@ -397,7 +395,6 @@ def _store_vertical_portscan_info(
397395 f":{ str_proto } :not_estab:{ target_ip } :dstports"
398396 )
399397 pipe .hincrby (key , flow .dport , int (flow .pkts ))
400- pipe .expire (key , self .tw_width , nx = True )
401398 # increment the total pkts sent to this target ip on this
402399 # proto so slips can retreieve it in O(1) when setting and
403400 # evidence
@@ -407,7 +404,6 @@ def _store_vertical_portscan_info(
407404 f"{ target_ip } :dstports:tot_pkts_sum"
408405 )
409406 pipe .incrby (key , int (flow .spkts ))
410- pipe .expire (key , self .tw_width , nx = True )
411407
412408 # we keep an index hash of target_ips to be able to access the
413409 # diff variants of the key above using them
@@ -430,7 +426,6 @@ def _store_horizontal_portscan_info(
430426 f"{ str_proto } :not_estab:dstports:total_packets"
431427 )
432428 pipe .hincrby (key , flow .dport , int (flow .pkts ))
433- pipe .expire (key , self .tw_width , nx = True )
434429
435430 # ZSET
436431 # profile_tw:[tcp|udp]:not_estab:dport:
@@ -445,7 +440,6 @@ def _store_horizontal_portscan_info(
445440 # To make sure the stored ts is the first seen ts of this
446441 # daddr, we use nx=True, so if a daddr is present we dont zadd
447442 pipe .zadd (key , {flow .daddr : flow .starttime }, nx = True )
448- pipe .expire (key , self .tw_width , nx = True )
449443
450444 return pipe
451445
@@ -458,21 +452,17 @@ def _store_conn_to_multiple_ports_info(
458452 if role == role .CLIENT :
459453 key = f"{ profileid } _{ twid } :tcp:est:dstips"
460454 pipe .zadd (key , {flow .daddr : flow .starttime }, nx = True )
461- pipe .expire (key , self .tw_width , nx = True )
462455
463456 key = f"{ profileid } _{ twid } :tcp:est:{ flow .daddr } :dstports"
464457 pipe .hset (key , flow .dport , flow .uid )
465- pipe .expire (key , self .tw_width , nx = True )
466458
467459 elif role == role .SERVER :
468460 client_profileid = ProfileID (ip = flow .saddr )
469461 key = f"{ client_profileid } _{ twid } :tcp:est:dstips"
470462 pipe .zadd (key , {flow .saddr : flow .starttime }, nx = True )
471- pipe .expire (key , self .tw_width , nx = True )
472463
473464 key = f"{ client_profileid } _{ twid } :tcp:est:{ flow .saddr } :dstports"
474465 pipe .hset (key , flow .dport , flow .uid )
475- pipe .expire (key , self .tw_width , nx = True )
476466 return pipe
477467
478468 def _store_flow_info_if_needed_by_detection_modules (
0 commit comments