2022-07-12 11:09:23 +01:00
|
|
|
import datetime
|
|
|
|
from typing import List
|
|
|
|
|
|
|
|
from dateutil.parser import isoparse
|
|
|
|
|
|
|
|
from app.terraform.block.bridge import BlockBridgeAutomation
|
|
|
|
|
|
|
|
|
|
|
|
class BlockBridgeReachabilityAutomation(BlockBridgeAutomation):
|
|
|
|
|
|
|
|
_lines: List[str]
|
|
|
|
|
2022-08-12 12:24:56 +01:00
|
|
|
def parse(self) -> None:
|
2022-07-12 11:09:23 +01:00
|
|
|
for line in self._lines:
|
|
|
|
parts = line.split("\t")
|
|
|
|
if isoparse(parts[2]) < (datetime.datetime.now(datetime.timezone.utc)
|
|
|
|
- datetime.timedelta(days=3)):
|
|
|
|
# Skip results older than 3 days
|
|
|
|
continue
|
|
|
|
if int(parts[1]) < 40:
|
|
|
|
self.hashed_fingerprints.append(parts[0])
|