diff --git a/pymisp/tools/domainipobject.py b/pymisp/tools/domainipobject.py new file mode 100644 index 0000000..8da3944 --- /dev/null +++ b/pymisp/tools/domainipobject.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from .abstractgenerator import AbstractMISPObjectGenerator +import logging + +logger = logging.getLogger('pymisp') + + +class DomainIPObject(AbstractMISPObjectGenerator): + + def __init__(self, parameters, strict=True, standalone=True, **kwargs): + super(DomainIPObject, self).__init__('domain-ip', strict=strict, standalone=standalone, **kwargs) + self._parameters = parameters + self.generate_attributes() + + def generate_attributes(self): + first = self._sanitize_timestamp(self.__parameters.pop('first-seen', None)) + self._parameters['first-seen'] = first + last = self._sanitize_timestamp(self.__parameters.pop('last-seen', None)) + self._parameters['last-seen'] = last + return super(DomainIPObject, self).generate_attributes()