2018-03-28 10:52:12 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from .abstractgenerator import AbstractMISPObjectGenerator
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger('pymisp')
|
|
|
|
|
|
|
|
|
|
|
|
class GeolocationObject(AbstractMISPObjectGenerator):
|
|
|
|
|
2020-07-28 20:05:42 +02:00
|
|
|
def __init__(self, parameters: dict, strict: bool = True, **kwargs):
|
2021-10-28 22:29:27 +02:00
|
|
|
super().__init__('geolocation', strict=strict, **kwargs)
|
2018-03-28 10:52:12 +02:00
|
|
|
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
|
2021-10-28 22:29:27 +02:00
|
|
|
super().generate_attributes()
|