2018-01-23 10:35:21 +01:00
|
|
|
#!/usr/bin/env python3
|
2024-01-17 13:13:14 +01:00
|
|
|
|
|
|
|
from __future__ import annotations
|
2018-01-23 10:35:21 +01:00
|
|
|
|
|
|
|
from .abstractgenerator import AbstractMISPObjectGenerator
|
2018-01-23 11:07:36 +01:00
|
|
|
|
2018-01-23 10:35:21 +01:00
|
|
|
|
|
|
|
class SBSignatureObject(AbstractMISPObjectGenerator):
|
|
|
|
'''
|
|
|
|
Sandbox Analyzer
|
|
|
|
'''
|
2024-02-01 14:40:12 +01:00
|
|
|
def __init__(self, software: str, report: list[tuple[str, str]], **kwargs) -> None: # type: ignore[no-untyped-def]
|
2021-10-26 02:37:12 +02:00
|
|
|
super().__init__('sb-signature', **kwargs)
|
2018-01-23 10:35:21 +01:00
|
|
|
self._software = software
|
2018-01-23 11:07:36 +01:00
|
|
|
self._report = report
|
2018-01-23 10:35:21 +01:00
|
|
|
self.generate_attributes()
|
|
|
|
|
2024-02-01 14:40:12 +01:00
|
|
|
def generate_attributes(self) -> None:
|
2018-01-23 10:35:21 +01:00
|
|
|
''' Parse the report for relevant attributes '''
|
2018-01-23 11:07:36 +01:00
|
|
|
self.add_attribute("software", value=self._software)
|
|
|
|
for (signature_name, description) in self._report:
|
|
|
|
self.add_attribute("signature", value=signature_name, comment=description)
|