Browse Source

fix: Fixed module names with - to avoid errors with python paths

pull/342/head
chrisr3d 2 years ago
parent
commit
63dba29c52
No known key found for this signature in database GPG Key ID: 6BBED1B63A6D639F
  1. 4
      misp_modules/modules/expansion/__init__.py
  2. 0
      misp_modules/modules/expansion/docx_enrich.py
  3. 0
      misp_modules/modules/expansion/ocr_enrich.py
  4. 0
      misp_modules/modules/expansion/ods_enrich.py
  5. 0
      misp_modules/modules/expansion/odt_enrich.py
  6. 0
      misp_modules/modules/expansion/pdf_enrich.py
  7. 0
      misp_modules/modules/expansion/pptx_enrich.py
  8. 0
      misp_modules/modules/expansion/xlsx_enrich.py
  9. 14
      tests/test_expansions.py

4
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']

0
misp_modules/modules/expansion/docx-enrich.py → misp_modules/modules/expansion/docx_enrich.py

0
misp_modules/modules/expansion/ocr-enrich.py → misp_modules/modules/expansion/ocr_enrich.py

0
misp_modules/modules/expansion/ods-enrich.py → misp_modules/modules/expansion/ods_enrich.py

0
misp_modules/modules/expansion/odt-enrich.py → misp_modules/modules/expansion/odt_enrich.py

0
misp_modules/modules/expansion/pdf-enrich.py → misp_modules/modules/expansion/pdf_enrich.py

0
misp_modules/modules/expansion/pptx-enrich.py → misp_modules/modules/expansion/pptx_enrich.py

0
misp_modules/modules/expansion/xlsx-enrich.py → misp_modules/modules/expansion/xlsx_enrich.py

14
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')

Loading…
Cancel
Save