From a16aa0387267cef3de38aa37647f48a47536c6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 28 Oct 2021 16:29:27 -0400 Subject: [PATCH] chg: Keep strict and generate attributes when needed --- pymisp/tools/asnobject.py | 3 ++- pymisp/tools/domainipobject.py | 3 ++- pymisp/tools/fail2banobject.py | 3 ++- pymisp/tools/geolocationobject.py | 3 ++- pymisp/tools/git_vuln_finder_object.py | 3 ++- pymisp/tools/microblogobject.py | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pymisp/tools/asnobject.py b/pymisp/tools/asnobject.py index 3abe89f..909d06b 100644 --- a/pymisp/tools/asnobject.py +++ b/pymisp/tools/asnobject.py @@ -10,7 +10,7 @@ logger = logging.getLogger('pymisp') class ASNObject(AbstractMISPObjectGenerator): def __init__(self, parameters: dict, strict: bool = True, **kwargs): - super().__init__('asn', **kwargs) + super().__init__('asn', strict=strict, **kwargs) self._parameters = parameters self.generate_attributes() @@ -19,3 +19,4 @@ class ASNObject(AbstractMISPObjectGenerator): self._parameters['first-seen'] = first last = self._sanitize_timestamp(self._parameters.pop('last-seen', None)) self._parameters['last-seen'] = last + super().generate_attributes() diff --git a/pymisp/tools/domainipobject.py b/pymisp/tools/domainipobject.py index d1bff67..2fe9a3e 100644 --- a/pymisp/tools/domainipobject.py +++ b/pymisp/tools/domainipobject.py @@ -10,7 +10,7 @@ logger = logging.getLogger('pymisp') class DomainIPObject(AbstractMISPObjectGenerator): def __init__(self, parameters: dict, strict: bool = True, **kwargs): - super().__init__('domain-ip', **kwargs) + super().__init__('domain-ip', strict=strict, **kwargs) self._parameters = parameters self.generate_attributes() @@ -19,3 +19,4 @@ class DomainIPObject(AbstractMISPObjectGenerator): self._parameters['first-seen'] = first last = self._sanitize_timestamp(self._parameters.pop('last-seen', None)) self._parameters['last-seen'] = last + super().generate_attributes() diff --git a/pymisp/tools/fail2banobject.py b/pymisp/tools/fail2banobject.py index 2943bab..5a5a5b3 100644 --- a/pymisp/tools/fail2banobject.py +++ b/pymisp/tools/fail2banobject.py @@ -10,10 +10,11 @@ logger = logging.getLogger('pymisp') class Fail2BanObject(AbstractMISPObjectGenerator): def __init__(self, parameters: dict, strict: bool = True, **kwargs): - super().__init__('fail2ban', **kwargs) + super().__init__('fail2ban', strict=strict, **kwargs) self._parameters = parameters self.generate_attributes() def generate_attributes(self): timestamp = self._sanitize_timestamp(self._parameters.pop('processing-timestamp', None)) self._parameters['processing-timestamp'] = timestamp + super().generate_attributes() diff --git a/pymisp/tools/geolocationobject.py b/pymisp/tools/geolocationobject.py index d785145..9ecb460 100644 --- a/pymisp/tools/geolocationobject.py +++ b/pymisp/tools/geolocationobject.py @@ -10,7 +10,7 @@ logger = logging.getLogger('pymisp') class GeolocationObject(AbstractMISPObjectGenerator): def __init__(self, parameters: dict, strict: bool = True, **kwargs): - super().__init__('geolocation', **kwargs) + super().__init__('geolocation', strict=strict, **kwargs) self._parameters = parameters self.generate_attributes() @@ -19,3 +19,4 @@ class GeolocationObject(AbstractMISPObjectGenerator): self._parameters['first-seen'] = first last = self._sanitize_timestamp(self._parameters.pop('last-seen', None)) self._parameters['last-seen'] = last + super().generate_attributes() diff --git a/pymisp/tools/git_vuln_finder_object.py b/pymisp/tools/git_vuln_finder_object.py index 9a22b88..451d62a 100644 --- a/pymisp/tools/git_vuln_finder_object.py +++ b/pymisp/tools/git_vuln_finder_object.py @@ -10,7 +10,7 @@ logger = logging.getLogger('pymisp') class GitVulnFinderObject(AbstractMISPObjectGenerator): def __init__(self, parameters: dict, strict: bool = True, **kwargs): - super().__init__('git-vuln-finder', **kwargs) + super().__init__('git-vuln-finder', strict=strict, **kwargs) self._parameters = parameters self.generate_attributes() @@ -25,3 +25,4 @@ class GitVulnFinderObject(AbstractMISPObjectGenerator): self._parameters['stats.deletions'] = stats.pop('deletions') self._parameters['stats.lines'] = stats.pop('lines') self._parameters['stats.files'] = stats.pop('files') + super().generate_attributes() diff --git a/pymisp/tools/microblogobject.py b/pymisp/tools/microblogobject.py index 19878f8..14adfb0 100644 --- a/pymisp/tools/microblogobject.py +++ b/pymisp/tools/microblogobject.py @@ -12,7 +12,7 @@ logger = logging.getLogger('pymisp') class MicroblogObject(AbstractMISPObjectGenerator): def __init__(self, parameters: dict, strict: bool = True, **kwargs): - super().__init__('microblog', **kwargs) + super().__init__('microblog', strict=strict, **kwargs) self._parameters = parameters self.generate_attributes()