Merge pull request #783 from JakubOnderka/fixes-149

Changes for upcoming MISP 2.4.150
JakubOnderka-patch-1
Jakub Onderka 2021-10-08 16:38:50 +02:00 committed by GitHub
commit 5064107093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -981,7 +981,7 @@
"default_category": "Person",
"to_ids": 0
},
"pattern-filename": {
"filename-pattern": {
"default_category": "Payload installation",
"to_ids": 1
},
@ -1385,7 +1385,7 @@
"passport-country",
"passport-expiration",
"passport-number",
"pattern-filename",
"filename-pattern",
"pattern-in-file",
"pattern-in-memory",
"pattern-in-traffic",

View File

@ -1988,15 +1988,19 @@ class TestComprehensive(unittest.TestCase):
remote_types = remote.pop('types')
remote_categories = remote.pop('categories')
remote_category_type_mappings = remote.pop('category_type_mappings')
local = dict(self.admin_misp_connector.describe_types_local)
local_types = local.pop('types')
local_categories = local.pop('categories')
local_category_type_mappings = local.pop('category_type_mappings')
self.assertDictEqual(remote, local)
self.assertEqual(sorted(remote_types), sorted(local_types))
self.assertEqual(sorted(remote_categories), sorted(local_categories))
for category, mapping in remote_category_type_mappings.items():
self.assertEqual(sorted(local_category_type_mappings[category]), sorted(mapping))
for typ in mapping:
self.assertIn(typ, remote_types)
def test_versions(self):
self.assertEqual(self.user_misp_connector.version, self.user_misp_connector.pymisp_version_master)
@ -2751,7 +2755,7 @@ class TestComprehensive(unittest.TestCase):
else:
raise Exception('Unable to find UUID in Events blocklist')
first = self.user_misp_connector.add_event(first, pythonify=True)
self.assertEqual(first['errors'][1]['message'], 'Could not add Event', first)
self.assertEqual(first['errors'][1]['message'], 'Event blocked by event blocklist.', first)
ble.comment = 'This is a test'
ble.event_info = 'foo'
ble.event_orgc = 'bar'
@ -2771,7 +2775,7 @@ class TestComprehensive(unittest.TestCase):
else:
raise Exception('Unable to find UUID in Orgs blocklist')
first = self.user_misp_connector.add_event(first, pythonify=True)
self.assertEqual(first['errors'][1]['message'], 'Could not add Event', first)
self.assertEqual(first['errors'][1]['message'], 'Event blocked by organisation blocklist.', first)
blo.comment = 'This is a test'
blo.org_name = 'bar'