mirror of https://github.com/MISP/PyMISP
chg: Keep strict and generate attributes when needed
parent
7e9490e12e
commit
a16aa03872
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Reference in New Issue