PyMISP/pymisp/tools/fail2banobject.py

25 lines
740 B
Python
Raw Normal View History

2018-03-26 12:07:40 +02:00
#!/usr/bin/env python
from __future__ import annotations
2018-03-26 12:07:40 +02:00
import logging
from typing import Any
from .abstractgenerator import AbstractMISPObjectGenerator
2018-03-26 12:07:40 +02:00
logger = logging.getLogger('pymisp')
class Fail2BanObject(AbstractMISPObjectGenerator):
def __init__(self, parameters: dict[str, Any], strict: bool = True, **kwargs): # type: ignore[no-untyped-def]
super().__init__('fail2ban', strict=strict, **kwargs)
self._parameters = parameters
2018-03-26 12:07:40 +02:00
self.generate_attributes()
def generate_attributes(self) -> None:
timestamp = self._sanitize_timestamp(self._parameters.pop('processing-timestamp', None))
self._parameters['processing-timestamp'] = timestamp
super().generate_attributes()