2018-03-26 12:07:40 +02:00
|
|
|
#!/usr/bin/env python
|
2024-01-17 13:13:14 +01:00
|
|
|
|
|
|
|
from __future__ import annotations
|
2018-03-26 12:07:40 +02:00
|
|
|
|
|
|
|
from .abstractgenerator import AbstractMISPObjectGenerator
|
|
|
|
import logging
|
|
|
|
|
|
|
|
logger = logging.getLogger('pymisp')
|
|
|
|
|
|
|
|
|
|
|
|
class Fail2BanObject(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__('fail2ban', strict=strict, **kwargs)
|
2018-03-27 14:57:07 +02:00
|
|
|
self._parameters = parameters
|
2018-03-26 12:07:40 +02:00
|
|
|
self.generate_attributes()
|
|
|
|
|
|
|
|
def generate_attributes(self):
|
2018-03-27 14:57:07 +02:00
|
|
|
timestamp = self._sanitize_timestamp(self._parameters.pop('processing-timestamp', None))
|
|
|
|
self._parameters['processing-timestamp'] = timestamp
|
2021-10-28 22:29:27 +02:00
|
|
|
super().generate_attributes()
|