From 63dba29c52874c0ddafbc1a47b89705a7d982c80 Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Fri, 18 Oct 2019 11:09:10 +0200 Subject: [PATCH] fix: Fixed module names with - to avoid errors with python paths --- misp_modules/modules/expansion/__init__.py | 4 ++-- .../expansion/{docx-enrich.py => docx_enrich.py} | 0 .../expansion/{ocr-enrich.py => ocr_enrich.py} | 0 .../expansion/{ods-enrich.py => ods_enrich.py} | 0 .../expansion/{odt-enrich.py => odt_enrich.py} | 0 .../expansion/{pdf-enrich.py => pdf_enrich.py} | 0 .../expansion/{pptx-enrich.py => pptx_enrich.py} | 0 .../expansion/{xlsx-enrich.py => xlsx_enrich.py} | 0 tests/test_expansions.py | 14 +++++++------- 9 files changed, 9 insertions(+), 9 deletions(-) rename misp_modules/modules/expansion/{docx-enrich.py => docx_enrich.py} (100%) rename misp_modules/modules/expansion/{ocr-enrich.py => ocr_enrich.py} (100%) rename misp_modules/modules/expansion/{ods-enrich.py => ods_enrich.py} (100%) rename misp_modules/modules/expansion/{odt-enrich.py => odt_enrich.py} (100%) rename misp_modules/modules/expansion/{pdf-enrich.py => pdf_enrich.py} (100%) rename misp_modules/modules/expansion/{pptx-enrich.py => pptx_enrich.py} (100%) rename misp_modules/modules/expansion/{xlsx-enrich.py => xlsx_enrich.py} (100%) diff --git a/misp_modules/modules/expansion/__init__.py b/misp_modules/modules/expansion/__init__.py index ef31ad95..9fe3b5c2 100644 --- a/misp_modules/modules/expansion/__init__.py +++ b/misp_modules/modules/expansion/__init__.py @@ -12,6 +12,6 @@ __all__ = ['cuckoo_submit', 'vmray_submit', 'bgpranking', 'circl_passivedns', 'c 'xforceexchange', 'sigma_syntax_validator', 'stix2_pattern_syntax_validator', 'sigma_queries', 'dbl_spamhaus', 'vulners', 'yara_query', 'macaddress_io', 'intel471', 'backscatter_io', 'btc_scam_check', 'hibp', 'greynoise', 'macvendors', - 'qrcode', 'ocr-enrich', 'pdf-enrich', 'docx-enrich', 'xlsx-enrich', 'pptx-enrich', - 'ods-enrich', 'odt-enrich', 'joesandbox_submit', 'joesandbox_query', 'urlhaus', + 'qrcode', 'ocr_enrich', 'pdf_enrich', 'docx_enrich', 'xlsx_enrich', 'pptx_enrich', + 'ods_enrich', 'odt_enrich', 'joesandbox_submit', 'joesandbox_query', 'urlhaus', 'virustotal_public'] diff --git a/misp_modules/modules/expansion/docx-enrich.py b/misp_modules/modules/expansion/docx_enrich.py similarity index 100% rename from misp_modules/modules/expansion/docx-enrich.py rename to misp_modules/modules/expansion/docx_enrich.py diff --git a/misp_modules/modules/expansion/ocr-enrich.py b/misp_modules/modules/expansion/ocr_enrich.py similarity index 100% rename from misp_modules/modules/expansion/ocr-enrich.py rename to misp_modules/modules/expansion/ocr_enrich.py diff --git a/misp_modules/modules/expansion/ods-enrich.py b/misp_modules/modules/expansion/ods_enrich.py similarity index 100% rename from misp_modules/modules/expansion/ods-enrich.py rename to misp_modules/modules/expansion/ods_enrich.py diff --git a/misp_modules/modules/expansion/odt-enrich.py b/misp_modules/modules/expansion/odt_enrich.py similarity index 100% rename from misp_modules/modules/expansion/odt-enrich.py rename to misp_modules/modules/expansion/odt_enrich.py diff --git a/misp_modules/modules/expansion/pdf-enrich.py b/misp_modules/modules/expansion/pdf_enrich.py similarity index 100% rename from misp_modules/modules/expansion/pdf-enrich.py rename to misp_modules/modules/expansion/pdf_enrich.py diff --git a/misp_modules/modules/expansion/pptx-enrich.py b/misp_modules/modules/expansion/pptx_enrich.py similarity index 100% rename from misp_modules/modules/expansion/pptx-enrich.py rename to misp_modules/modules/expansion/pptx_enrich.py diff --git a/misp_modules/modules/expansion/xlsx-enrich.py b/misp_modules/modules/expansion/xlsx_enrich.py similarity index 100% rename from misp_modules/modules/expansion/xlsx-enrich.py rename to misp_modules/modules/expansion/xlsx_enrich.py diff --git a/tests/test_expansions.py b/tests/test_expansions.py index d2ab54ca..a3a2c8e4 100644 --- a/tests/test_expansions.py +++ b/tests/test_expansions.py @@ -92,7 +92,7 @@ class TestExpansions(unittest.TestCase): filename = 'test.docx' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "docx-enrich", "attachment": filename, "data": encoded} + query = {"module": "docx_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), '\nThis is an basic test docx file. ') @@ -127,7 +127,7 @@ class TestExpansions(unittest.TestCase): filename = 'misp-logo.png' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "ocr-enrich", "attachment": filename, "data": encoded} + query = {"module": "ocr_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), 'Threat Sharing') @@ -135,7 +135,7 @@ class TestExpansions(unittest.TestCase): filename = 'test.ods' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "ods-enrich", "attachment": filename, "data": encoded} + query = {"module": "ods_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), '\n column_0\n0 ods test') @@ -143,7 +143,7 @@ class TestExpansions(unittest.TestCase): filename = 'test.odt' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "odt-enrich", "attachment": filename, "data": encoded} + query = {"module": "odt_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), 'odt test') @@ -165,7 +165,7 @@ class TestExpansions(unittest.TestCase): filename = 'test.pdf' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "pdf-enrich", "attachment": filename, "data": encoded} + query = {"module": "pdf_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), 'Pdf test') @@ -173,7 +173,7 @@ class TestExpansions(unittest.TestCase): filename = 'test.pptx' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "pptx-enrich", "attachment": filename, "data": encoded} + query = {"module": "pptx_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), '\npptx test\n') @@ -244,7 +244,7 @@ class TestExpansions(unittest.TestCase): filename = 'test.xlsx' with open(f'{self.dirname}/test_files/{filename}', 'rb') as f: encoded = b64encode(f.read()).decode() - query = {"module": "xlsx-enrich", "attachment": filename, "data": encoded} + query = {"module": "xlsx_enrich", "attachment": filename, "data": encoded} response = self.misp_modules_post(query) self.assertEqual(self.get_values(response), ' header\n0 xlsx test')