feat: add _time

so that generated records can be saved to index, if configured
This commit is contained in:
Ming Di Leom 2023-02-15 09:40:37 +00:00
parent 10dc471223
commit 975e1531bc
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
7 changed files with 14 additions and 7 deletions

View File

@ -5,6 +5,7 @@ Usage: "| getbotnetfilter | outputlookup override_if_empty=false botnet-filter-s
import sys
from os import path
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -34,7 +35,7 @@ class GetBotnetFilter(Utility, GeneratingCommand):
if isinstance(self.custom_message, str) and len(self.custom_message) >= 1:
row["custom_message"] = self.custom_message
yield self.gen_record(**row)
yield self.gen_record(_time=unix_time(), **row)
dispatch(GetBotnetFilter, sys.argv, sys.stdin, sys.stdout, __name__)

View File

@ -8,6 +8,7 @@ import sys
from datetime import datetime, timezone
from os import path
from re import search
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -45,7 +46,7 @@ class GetBotnetIP(Utility, GeneratingCommand):
if isinstance(self.custom_message, str) and len(self.custom_message) >= 1:
row["custom_message"] = self.custom_message
yield self.gen_record(**row)
yield self.gen_record(_time=unix_time(), **row)
dispatch(GetBotnetIP, sys.argv, sys.stdin, sys.stdout, __name__)

View File

@ -8,6 +8,7 @@ import sys
from datetime import datetime, timezone
from os import path
from re import search
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -71,7 +72,7 @@ class GetOpenDBL(Utility, GeneratingCommand):
):
row["custom_message"] = self.custom_message
yield self.gen_record(**row)
yield self.gen_record(_time=unix_time(), **row)
dispatch(GetOpenDBL, sys.argv, sys.stdin, sys.stdout, __name__)

View File

@ -5,6 +5,7 @@ Usage: "| getphishingfilter | outputlookup override_if_empty=false phishing-filt
import sys
from os import path
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -41,7 +42,7 @@ class GetPhishingFilter(Utility, GeneratingCommand):
row, self.wildcard_prefix, self.wildcard_suffix, self.wildcard_affix
)
yield self.gen_record(**affixed_row)
yield self.gen_record(_time=unix_time(), **affixed_row)
dispatch(GetPhishingFilter, sys.argv, sys.stdin, sys.stdout, __name__)

View File

@ -5,6 +5,7 @@ Usage: "| getpupfilter | outputlookup override_if_empty=false pup-filter-splunk.
import sys
from os import path
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -39,7 +40,7 @@ class GetPupFilter(Utility, GeneratingCommand):
affixed_row = self.insert_affix(
row, self.wildcard_prefix, self.wildcard_suffix, self.wildcard_affix
)
yield self.gen_record(**affixed_row)
yield self.gen_record(_time=unix_time(), **affixed_row)
dispatch(GetPupFilter, sys.argv, sys.stdin, sys.stdout, __name__)

View File

@ -5,6 +5,7 @@ Usage: "| geturlhausfilter | outputlookup override_if_empty=false urlhaus-filter
import sys
from os import path
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -40,7 +41,7 @@ class GetUrlhausFilter(Utility, GeneratingCommand):
affixed_row = self.insert_affix(
row, self.wildcard_prefix, self.wildcard_suffix, self.wildcard_affix
)
yield self.gen_record(**affixed_row)
yield self.gen_record(_time=unix_time(), **affixed_row)
dispatch(GetUrlhausFilter, sys.argv, sys.stdin, sys.stdout, __name__)

View File

@ -5,6 +5,7 @@ Usage: "| getvnbadsitefilter | outputlookup override_if_empty=false vn-badsite-f
import sys
from os import path
from time import time as unix_time
sys.path.insert(0, path.join(path.dirname(__file__)))
from utils import Utility
@ -40,7 +41,7 @@ class GetVNBadsiteFilter(Utility, GeneratingCommand):
affixed_row = self.insert_affix(
row, self.wildcard_prefix, self.wildcard_suffix, self.wildcard_affix
)
yield self.gen_record(**affixed_row)
yield self.gen_record(_time=unix_time(), **affixed_row)
dispatch(GetVNBadsiteFilter, sys.argv, sys.stdin, sys.stdout, __name__)