PyMISP/pymisp/tools/domainipobject.py

23 lines
825 B
Python
Raw Normal View History

2018-03-27 15:18:50 +02:00
#!/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):
2018-03-27 15:19:52 +02:00
first = self._sanitize_timestamp(self._parameters.pop('first-seen', None))
2018-03-27 15:18:50 +02:00
self._parameters['first-seen'] = first
2018-03-27 15:19:52 +02:00
last = self._sanitize_timestamp(self._parameters.pop('last-seen', None))
2018-03-27 15:18:50 +02:00
self._parameters['last-seen'] = last
return super(DomainIPObject, self).generate_attributes()