From dd5f10131de3fde5ef7ee9ba71eb69102fb8de34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20BASLER?= <14902945+Megafredo@users.noreply.github.com> Date: Mon, 19 Aug 2024 15:30:47 +0200 Subject: [PATCH] [Malpedia] Fix default_marking recovery error and update readme (#2499) --- external-import/malpedia/README.md | 3 +++ external-import/malpedia/src/malpedia_connector/malpedia.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/external-import/malpedia/README.md b/external-import/malpedia/README.md index cd24220b5f..c7661e94f3 100644 --- a/external-import/malpedia/README.md +++ b/external-import/malpedia/README.md @@ -73,5 +73,8 @@ If you are authenticated, then all entities created by the connector will be in If you are not authenticated, by leaving this variable (auth_key) undefined or only public in the form of an empty string (""), all entities created by the connector will be in TLP:WHITE. This connector can therefore be used without an account. +However, it is possible to use "default_marking" as an environment variable to customize your default marking. +Markings availables : "TLP:CLEAR", ""TLP:GREEN", "TLP:AMBER", "TLP:RED". + If you choose to set environment variables such as import_intrusion_sets, import_yara, create_indicators, create_observables to false, the connector will simply skip the bundle creation steps for the selected category. diff --git a/external-import/malpedia/src/malpedia_connector/malpedia.py b/external-import/malpedia/src/malpedia_connector/malpedia.py index 1891f43884..d338cbda83 100644 --- a/external-import/malpedia/src/malpedia_connector/malpedia.py +++ b/external-import/malpedia/src/malpedia_connector/malpedia.py @@ -45,7 +45,7 @@ def __init__(self) -> None: "TLP:AMBER": stix2.TLP_AMBER, "TLP:RED": stix2.TLP_RED, } - self.default_marking = self.config.load["malpedia"].get("default_marking", None) + self.default_marking = getattr(self.config, "default_marking", None) if self.default_marking is not None: default_marking_normalized = self.default_marking.strip().upper()