PyMISP/pymisp/tools/asnobject.py

23 lines
822 B
Python
Raw Normal View History

2018-03-28 10:27:02 +02:00
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .abstractgenerator import AbstractMISPObjectGenerator
import logging
logger = logging.getLogger('pymisp')
class ASNObject(AbstractMISPObjectGenerator):
2020-01-23 10:27:40 +01:00
def __init__(self, parameters: dict, strict: bool=True, standalone: bool=True, **kwargs):
2018-03-28 10:27:02 +02:00
super(ASNObject, self).__init__('asn', 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(ASNObject, self).generate_attributes()