pymisp 2.5.3__py3-none-any.whl → 2.5.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pymisp might be problematic. Click here for more details.
- CHANGELOG.txt +5380 -0
- examples/__init__.py +0 -0
- examples/add_attributes_from_csv.py +74 -0
- examples/add_email_object.py +29 -0
- examples/add_fail2ban_object.py +86 -0
- examples/add_feed.py +25 -0
- examples/add_file_object.py +47 -0
- examples/add_filetype_object_from_csv.py +53 -0
- examples/add_generic_object.py +26 -0
- examples/add_github_user.py +65 -0
- examples/add_gitlab_user.py +56 -0
- examples/add_named_attribute.py +25 -0
- examples/add_organisations.py +57 -0
- examples/add_ssh_authorized_keys.py +29 -0
- examples/add_user.py +22 -0
- examples/add_vehicle_object.py +22 -0
- examples/addtag2.py +45 -0
- examples/asciidoc_generator.py +114 -0
- examples/cache_all.py +10 -0
- examples/copyTagsFromAttributesToEvent.py +68 -0
- examples/copy_list.py +93 -0
- examples/create_events.py +26 -0
- examples/cytomic_orion.py +549 -0
- examples/del.py +22 -0
- examples/delete_user.py +16 -0
- examples/edit_organisation.py +20 -0
- examples/edit_user.py +20 -0
- examples/falsepositive_disabletoids.py +136 -0
- examples/fetch_events_feed.py +15 -0
- examples/fetch_warninglist_hits.py +38 -0
- examples/freetext.py +22 -0
- examples/generate_file_objects.py +78 -0
- examples/generate_meta_feed.py +15 -0
- examples/get.py +37 -0
- examples/get_csv.py +37 -0
- examples/get_network_activity.py +187 -0
- examples/last.py +48 -0
- examples/load_csv.py +94 -0
- examples/lookup.py +28 -0
- examples/misp2cef.py +71 -0
- examples/misp2clamav.py +52 -0
- examples/openioc_to_misp.py +27 -0
- examples/proofpoint_tap.py +203 -0
- examples/proofpoint_vap.py +65 -0
- examples/search.py +48 -0
- examples/search_attributes_yara.py +40 -0
- examples/search_sighting.py +42 -0
- examples/server_sync_check_conn.py +32 -0
- examples/sharing_groups.py +15 -0
- examples/show_sightings.py +168 -0
- examples/stats_report.py +405 -0
- examples/sync_sighting.py +171 -0
- examples/tags.py +25 -0
- examples/test_sign.py +19 -0
- examples/trustar_misp.py +59 -0
- examples/up.py +21 -0
- examples/upload.py +60 -0
- examples/users_list.py +15 -0
- examples/vmray_automation.py +281 -0
- examples/vt_to_misp.py +182 -0
- examples/warninglists.py +22 -0
- examples/yara.py +38 -0
- examples/yara_dump.py +98 -0
- pymisp/api.py +33 -5
- pymisp/data/misp-objects/objects/android-app/definition.json +8 -2
- pymisp/data/misp-objects/objects/instagram-account/definition.json +66 -0
- pymisp/data/misp-objects/objects/lnk/definition.json +13 -1
- pymisp/data/misp-objects/objects/rmm/definition.json +88 -0
- pymisp/data/misp-objects/objects/spambee-report/definition.json +54 -0
- pymisp/data/misp-objects/objects/target-system/definition.json +2 -2
- pymisp/data/misp-objects/objects/vulnerability/definition.json +5 -4
- pymisp/data/misp-objects/relationships/definition.json +17 -1
- pymisp/data/misp-objects/schema_objects.json +1 -1
- pymisp/mispevent.py +95 -23
- {pymisp-2.5.3.dist-info → pymisp-2.5.7.dist-info}/METADATA +23 -28
- {pymisp-2.5.3.dist-info → pymisp-2.5.7.dist-info}/RECORD +144 -30
- {pymisp-2.5.3.dist-info → pymisp-2.5.7.dist-info}/WHEEL +1 -1
- tests/57c4445b-c548-4654-af0b-4be3950d210f.json +1 -0
- tests/__init__.py +0 -0
- tests/csv_testfiles/invalid_fieldnames.csv +11 -0
- tests/csv_testfiles/valid_fieldnames.csv +4 -0
- tests/email_testfiles/mail_1.eml.zip +0 -0
- tests/email_testfiles/mail_1.msg +0 -0
- tests/email_testfiles/mail_1_bom.eml +858 -0
- tests/email_testfiles/mail_1_headers_only.eml +28 -0
- tests/email_testfiles/mail_2.eml +32 -0
- tests/email_testfiles/mail_3.eml +170 -0
- tests/email_testfiles/mail_3.msg +0 -0
- tests/email_testfiles/mail_4.msg +0 -0
- tests/email_testfiles/mail_5.msg +0 -0
- tests/email_testfiles/mail_multiple_to.eml +15 -0
- tests/email_testfiles/source +1 -0
- tests/git-vuln-finder-quagga.json +1493 -0
- tests/misp_event.json +76 -0
- tests/mispevent_testfiles/attribute.json +21 -0
- tests/mispevent_testfiles/attribute_del.json +23 -0
- tests/mispevent_testfiles/def_param.json +53 -0
- tests/mispevent_testfiles/event.json +8 -0
- tests/mispevent_testfiles/event_obj_attr_tag.json +57 -0
- tests/mispevent_testfiles/event_obj_def_param.json +62 -0
- tests/mispevent_testfiles/event_obj_tag.json +29 -0
- tests/mispevent_testfiles/event_tags.json +18 -0
- tests/mispevent_testfiles/existing_event.json +4599 -0
- tests/mispevent_testfiles/existing_event_edited.json +4601 -0
- tests/mispevent_testfiles/galaxy.json +25 -0
- tests/mispevent_testfiles/malware.json +19 -0
- tests/mispevent_testfiles/malware_exist.json +163 -0
- tests/mispevent_testfiles/misp_custom_obj.json +38 -0
- tests/mispevent_testfiles/overwrite_file/definition.json +457 -0
- tests/mispevent_testfiles/proposals.json +35 -0
- tests/mispevent_testfiles/shadow.json +148 -0
- tests/mispevent_testfiles/sighting.json +5 -0
- tests/mispevent_testfiles/simple.json +2 -0
- tests/mispevent_testfiles/test_object_template/definition.json +29 -0
- tests/new_misp_event.json +34 -0
- tests/reportlab_testfiles/HTML_event.json +1 -0
- tests/reportlab_testfiles/galaxy_1.json +1250 -0
- tests/reportlab_testfiles/image_event.json +2490 -0
- tests/reportlab_testfiles/japanese_test.json +156 -0
- tests/reportlab_testfiles/japanese_test_heavy.json +318 -0
- tests/reportlab_testfiles/long_event.json +3730 -0
- tests/reportlab_testfiles/mainly_objects_1.json +1092 -0
- tests/reportlab_testfiles/mainly_objects_2.json +977 -0
- tests/reportlab_testfiles/sighting_1.json +305 -0
- tests/reportlab_testfiles/sighting_2.json +221 -0
- tests/reportlab_testfiles/to_delete1.json +804 -0
- tests/reportlab_testfiles/to_delete2.json +1 -0
- tests/reportlab_testfiles/to_delete3.json +1 -0
- tests/reportlab_testfiles/very_long_event.json +1006 -0
- tests/reportlab_testoutputs/to_delete1.json.pdf +391 -0
- tests/reportlab_testoutputs/to_delete2.json.pdf +506 -0
- tests/reportlab_testoutputs/to_delete3.json.pdf +277 -0
- tests/search_index_result.json +69 -0
- tests/sharing_groups.json +98 -0
- tests/stix1.xml-utf8 +110 -0
- tests/stix2.json +1 -0
- tests/test_analyst_data.py +123 -0
- tests/test_emailobject.py +157 -0
- tests/test_fileobject.py +20 -0
- tests/test_mispevent.py +473 -0
- tests/test_reportlab.py +431 -0
- tests/testlive_comprehensive.py +3734 -0
- tests/testlive_sync.py +474 -0
- pymisp/data/misp-objects/.git +0 -1
- pymisp/data/misp-objects/.gitchangelog.rc +0 -289
- pymisp/data/misp-objects/.github/workflows/codeql.yml +0 -41
- pymisp/data/misp-objects/.github/workflows/nosetests.yml +0 -39
- pymisp/data/misp-objects/.travis.yml +0 -16
- pymisp/data/misp-objects/LICENSE-software-only.md +0 -661
- pymisp/data/misp-objects/LICENSE.md +0 -36
- pymisp/data/misp-objects/README.md +0 -566
- pymisp/data/misp-objects/docs/time-related-objects.ods +0 -0
- pymisp/data/misp-objects/docs/time-related-objects.pdf +0 -0
- pymisp/data/misp-objects/jq_all_the_things.sh +0 -29
- pymisp/data/misp-objects/tools/adoc_objects.py +0 -145
- pymisp/data/misp-objects/tools/alfred_links_to_relarelationships.py +0 -48
- pymisp/data/misp-objects/tools/list_of_objects.py +0 -50
- pymisp/data/misp-objects/tools/updated.sh +0 -6
- pymisp/data/misp-objects/tools/validate_opposites.sh +0 -17
- pymisp/data/misp-objects/unique_uuid.py +0 -16
- pymisp/data/misp-objects/validate_all.sh +0 -38
- {pymisp-2.5.3.dist-info → pymisp-2.5.7.dist-info}/LICENSE +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"attributes": {
|
|
3
|
+
"feedback-requested": {
|
|
4
|
+
"description": "User has requested feedback",
|
|
5
|
+
"disable_correlation": true,
|
|
6
|
+
"misp-attribute": "boolean",
|
|
7
|
+
"ui-priority": 0
|
|
8
|
+
},
|
|
9
|
+
"feedback-sent": {
|
|
10
|
+
"description": "Feedback has been sent to user",
|
|
11
|
+
"disable_correlation": true,
|
|
12
|
+
"misp-attribute": "boolean",
|
|
13
|
+
"ui-priority": 0
|
|
14
|
+
},
|
|
15
|
+
"feedback-time": {
|
|
16
|
+
"description": "Timestamp of the feedback",
|
|
17
|
+
"disable_correlation": true,
|
|
18
|
+
"misp-attribute": "datetime",
|
|
19
|
+
"ui-priority": 0
|
|
20
|
+
},
|
|
21
|
+
"privacy": {
|
|
22
|
+
"description": "User has requested privacy",
|
|
23
|
+
"disable_correlation": true,
|
|
24
|
+
"misp-attribute": "boolean",
|
|
25
|
+
"ui-priority": 0
|
|
26
|
+
},
|
|
27
|
+
"report-status": {
|
|
28
|
+
"categories": [
|
|
29
|
+
"External analysis"
|
|
30
|
+
],
|
|
31
|
+
"description": "Result of the Spambee analysis for the submitted email",
|
|
32
|
+
"disable_correlation": true,
|
|
33
|
+
"misp-attribute": "text",
|
|
34
|
+
"ui-priority": 0
|
|
35
|
+
},
|
|
36
|
+
"report-uid": {
|
|
37
|
+
"categories": [
|
|
38
|
+
"Internal reference"
|
|
39
|
+
],
|
|
40
|
+
"description": "Internal reference to the Spambee report",
|
|
41
|
+
"disable_correlation": true,
|
|
42
|
+
"misp-attribute": "text",
|
|
43
|
+
"ui-priority": 0
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"description": "A Spambee analysis report",
|
|
47
|
+
"meta-category": "network",
|
|
48
|
+
"name": "spambee-report",
|
|
49
|
+
"requiredOneOf": [
|
|
50
|
+
"report-uid"
|
|
51
|
+
],
|
|
52
|
+
"uuid": "305d6e6c-bb4d-4b9a-abf5-9f34d1322352",
|
|
53
|
+
"version": 3
|
|
54
|
+
}
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"ui-priority": 1
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"description": "Description about an targeted system, this could potentially be a
|
|
31
|
+
"description": "Description about an targeted system, this could potentially be a compromised internal system",
|
|
32
32
|
"meta-category": "internal",
|
|
33
33
|
"name": "target-system",
|
|
34
34
|
"requiredOneOf": [
|
|
35
35
|
"targeted_machine"
|
|
36
36
|
],
|
|
37
37
|
"uuid": "3110944f-eca0-4c94-9d61-a84d022228a4",
|
|
38
|
-
"version":
|
|
38
|
+
"version": 2
|
|
39
39
|
}
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"ui-priority": 0
|
|
15
15
|
},
|
|
16
16
|
"cvss-score": {
|
|
17
|
-
"description": "Score of the Common Vulnerability Scoring System
|
|
17
|
+
"description": "Score of the Common Vulnerability Scoring System.",
|
|
18
18
|
"disable_correlation": true,
|
|
19
19
|
"misp-attribute": "float",
|
|
20
20
|
"ui-priority": 1
|
|
21
21
|
},
|
|
22
22
|
"cvss-string": {
|
|
23
|
-
"description": "String of the Common Vulnerability Scoring System
|
|
23
|
+
"description": "String of the Common Vulnerability Scoring System.",
|
|
24
24
|
"disable_correlation": true,
|
|
25
25
|
"misp-attribute": "text",
|
|
26
26
|
"ui-priority": 1
|
|
@@ -65,7 +65,8 @@
|
|
|
65
65
|
"Reviewed",
|
|
66
66
|
"Vulnerability ID Assigned",
|
|
67
67
|
"Reported",
|
|
68
|
-
"Fixed"
|
|
68
|
+
"Fixed",
|
|
69
|
+
"Encoded"
|
|
69
70
|
],
|
|
70
71
|
"ui-priority": 0
|
|
71
72
|
},
|
|
@@ -94,5 +95,5 @@
|
|
|
94
95
|
"id"
|
|
95
96
|
],
|
|
96
97
|
"uuid": "81650945-f186-437b-8945-9f31715d32da",
|
|
97
|
-
"version":
|
|
98
|
+
"version": 9
|
|
98
99
|
}
|
|
@@ -1907,7 +1907,23 @@
|
|
|
1907
1907
|
"misp"
|
|
1908
1908
|
],
|
|
1909
1909
|
"name": "releasable-to"
|
|
1910
|
+
},
|
|
1911
|
+
{
|
|
1912
|
+
"description": "The source object is weakened by the target weakness.",
|
|
1913
|
+
"format": [
|
|
1914
|
+
"misp"
|
|
1915
|
+
],
|
|
1916
|
+
"name": "weakened-by",
|
|
1917
|
+
"opposite": "weakens"
|
|
1918
|
+
},
|
|
1919
|
+
{
|
|
1920
|
+
"description": "The source weakness weakens the target object.",
|
|
1921
|
+
"format": [
|
|
1922
|
+
"misp"
|
|
1923
|
+
],
|
|
1924
|
+
"name": "weakens",
|
|
1925
|
+
"opposite": "weakened-by"
|
|
1910
1926
|
}
|
|
1911
1927
|
],
|
|
1912
|
-
"version":
|
|
1928
|
+
"version": 51
|
|
1913
1929
|
}
|
pymisp/mispevent.py
CHANGED
|
@@ -60,28 +60,37 @@ class AnalystDataBehaviorMixin(AbstractMISP):
|
|
|
60
60
|
|
|
61
61
|
def add_note(self, note: str, language: str | None = None, **kwargs) -> MISPNote: # type: ignore[no-untyped-def]
|
|
62
62
|
the_note = MISPNote()
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
object_uuid = kwargs.pop('object_uuid', self.uuid)
|
|
64
|
+
object_type = kwargs.pop('object_type', self.analyst_data_object_type)
|
|
65
|
+
the_note.from_dict(
|
|
66
|
+
note=note, language=language, object_uuid=object_uuid,
|
|
67
|
+
object_type=object_type, contained=True, parent=self, **kwargs
|
|
68
|
+
)
|
|
66
69
|
self.notes.append(the_note)
|
|
67
70
|
self.edited = True
|
|
68
71
|
return the_note
|
|
69
72
|
|
|
70
73
|
def add_opinion(self, opinion: int, comment: str | None = None, **kwargs) -> MISPOpinion: # type: ignore[no-untyped-def]
|
|
71
74
|
the_opinion = MISPOpinion()
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
object_uuid = kwargs.pop('object_uuid', self.uuid)
|
|
76
|
+
object_type = kwargs.pop('object_type', self.analyst_data_object_type)
|
|
77
|
+
the_opinion.from_dict(
|
|
78
|
+
opinion=opinion, comment=comment, object_uuid=object_uuid,
|
|
79
|
+
object_type=object_type, contained=True, parent=self, **kwargs
|
|
80
|
+
)
|
|
75
81
|
self.opinions.append(the_opinion)
|
|
76
82
|
self.edited = True
|
|
77
83
|
return the_opinion
|
|
78
84
|
|
|
79
85
|
def add_relationship(self, related_object_type: AbstractMISP | str, related_object_uuid: str | None, relationship_type: str, **kwargs) -> MISPRelationship: # type: ignore[no-untyped-def]
|
|
80
86
|
the_relationship = MISPRelationship()
|
|
81
|
-
the_relationship.from_dict(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
the_relationship.from_dict(
|
|
88
|
+
related_object_type=related_object_type,
|
|
89
|
+
related_object_uuid=related_object_uuid,
|
|
90
|
+
relationship_type=relationship_type, object_uuid=self.uuid,
|
|
91
|
+
object_type=self.analyst_data_object_type, contained=True,
|
|
92
|
+
parent=self, **kwargs
|
|
93
|
+
)
|
|
85
94
|
self.relationships.append(the_relationship)
|
|
86
95
|
self.edited = True
|
|
87
96
|
return the_relationship
|
|
@@ -93,12 +102,8 @@ class AnalystDataBehaviorMixin(AbstractMISP):
|
|
|
93
102
|
relationships = kwargs.pop('Relationship', [])
|
|
94
103
|
super().from_dict(**kwargs)
|
|
95
104
|
for note in notes:
|
|
96
|
-
note.pop('object_uuid', None)
|
|
97
|
-
note.pop('object_type', None)
|
|
98
105
|
self.add_note(**note)
|
|
99
106
|
for opinion in opinions:
|
|
100
|
-
opinion.pop('object_uuid', None)
|
|
101
|
-
opinion.pop('object_type', None)
|
|
102
107
|
self.add_opinion(**opinion)
|
|
103
108
|
for relationship in relationships:
|
|
104
109
|
relationship.pop('object_uuid', None)
|
|
@@ -2523,6 +2528,18 @@ class MISPAnalystData(AbstractMISP):
|
|
|
2523
2528
|
'Object', 'Note', 'Opinion', 'Relationship', 'Organisation',
|
|
2524
2529
|
'SharingGroup'}
|
|
2525
2530
|
|
|
2531
|
+
@property
|
|
2532
|
+
def analyst_data_object_type(self) -> str:
|
|
2533
|
+
return self._analyst_data_object_type
|
|
2534
|
+
|
|
2535
|
+
@property
|
|
2536
|
+
def notes(self) -> list[MISPNote]:
|
|
2537
|
+
return self.Note
|
|
2538
|
+
|
|
2539
|
+
@property
|
|
2540
|
+
def opinions(self) -> list[MISPOpinion]:
|
|
2541
|
+
return self.Opinion
|
|
2542
|
+
|
|
2526
2543
|
@property
|
|
2527
2544
|
def org(self) -> MISPOrganisation:
|
|
2528
2545
|
return self.Org
|
|
@@ -2538,6 +2555,10 @@ class MISPAnalystData(AbstractMISP):
|
|
|
2538
2555
|
else:
|
|
2539
2556
|
raise PyMISPError('Orgc must be of type MISPOrganisation.')
|
|
2540
2557
|
|
|
2558
|
+
@property
|
|
2559
|
+
def parent(self) -> MISPAttribute | MISPEvent | MISPEventReport | MISPObject:
|
|
2560
|
+
return self.__parent
|
|
2561
|
+
|
|
2541
2562
|
def __new__(cls, *args, **kwargs):
|
|
2542
2563
|
if cls is MISPAnalystData:
|
|
2543
2564
|
raise TypeError(f"only children of '{cls.__name__}' may be instantiated")
|
|
@@ -2552,8 +2573,54 @@ class MISPAnalystData(AbstractMISP):
|
|
|
2552
2573
|
self.created: float | int | datetime
|
|
2553
2574
|
self.modified: float | int | datetime
|
|
2554
2575
|
self.SharingGroup: MISPSharingGroup
|
|
2576
|
+
self._analyst_data_object_type: str # Must be defined in the child class
|
|
2577
|
+
|
|
2578
|
+
def add_note(self, note: str, language: str | None = None, object_uuid: str | None = None, object_type: str | None = None, parent: MISPEvent | MISPAttribute | MISPObject | MISPEventReport | None = None, **kwargs: dict[str, Any]) -> MISPNote:
|
|
2579
|
+
misp_note = MISPNote()
|
|
2580
|
+
if object_uuid is None:
|
|
2581
|
+
object_uuid = self.uuid
|
|
2582
|
+
if object_type is None:
|
|
2583
|
+
object_type = self.analyst_data_object_type
|
|
2584
|
+
if parent is None and hasattr(self, 'parent'):
|
|
2585
|
+
parent = self.parent
|
|
2586
|
+
misp_note.from_dict(
|
|
2587
|
+
note=note, language=language, object_uuid=object_uuid,
|
|
2588
|
+
object_type=object_type, parent=parent, contained=True, **kwargs
|
|
2589
|
+
)
|
|
2590
|
+
if parent is None:
|
|
2591
|
+
if not hasattr(self, 'Note'):
|
|
2592
|
+
self.Note: list[MISPNote] = []
|
|
2593
|
+
self.Note.append(misp_note)
|
|
2594
|
+
else:
|
|
2595
|
+
self.parent.notes.append(misp_note)
|
|
2596
|
+
self.edited = True
|
|
2597
|
+
return misp_note
|
|
2598
|
+
|
|
2599
|
+
def add_opinion(self, opinion: int, comment: str | None = None, object_uuid: str | None = None, object_type: str | None = None, parent: MISPEvent | MISPAttribute | MISPObject | MISPEventReport | None = None, **kwargs: dict[str, Any]) -> MISPOpinion:
|
|
2600
|
+
misp_opinion = MISPOpinion()
|
|
2601
|
+
if object_uuid is None:
|
|
2602
|
+
object_uuid = self.uuid
|
|
2603
|
+
if object_type is None:
|
|
2604
|
+
object_type = self.analyst_data_object_type
|
|
2605
|
+
if parent is None and hasattr(self, 'parent'):
|
|
2606
|
+
parent = self.parent
|
|
2607
|
+
misp_opinion.from_dict(
|
|
2608
|
+
opinion=opinion, comment=comment, object_uuid=object_uuid,
|
|
2609
|
+
object_type=object_type, parent=parent, contained=True, **kwargs
|
|
2610
|
+
)
|
|
2611
|
+
if parent is None:
|
|
2612
|
+
if not hasattr(self, 'Opinion'):
|
|
2613
|
+
self.Opinion: list[MISPOpinion] = []
|
|
2614
|
+
self.Opinion.append(misp_opinion)
|
|
2615
|
+
else:
|
|
2616
|
+
self.parent.opinions.append(misp_opinion)
|
|
2617
|
+
self.edited = True
|
|
2618
|
+
return misp_opinion
|
|
2555
2619
|
|
|
2556
2620
|
def from_dict(self, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2621
|
+
notes = kwargs.pop('Note', [])
|
|
2622
|
+
opinions = kwargs.pop('Opinion', [])
|
|
2623
|
+
self.__parent = kwargs.pop('parent', None)
|
|
2557
2624
|
self.distribution = kwargs.pop('distribution', None)
|
|
2558
2625
|
if self.distribution is not None:
|
|
2559
2626
|
self.distribution = int(self.distribution)
|
|
@@ -2607,6 +2674,11 @@ class MISPAnalystData(AbstractMISP):
|
|
|
2607
2674
|
|
|
2608
2675
|
super().from_dict(**kwargs)
|
|
2609
2676
|
|
|
2677
|
+
for note in notes:
|
|
2678
|
+
self.add_note(**note)
|
|
2679
|
+
for opinion in opinions:
|
|
2680
|
+
self.add_opinion(**opinion)
|
|
2681
|
+
|
|
2610
2682
|
def _set_default(self) -> None:
|
|
2611
2683
|
if not hasattr(self, 'created'):
|
|
2612
2684
|
self.created = datetime.timestamp(datetime.now())
|
|
@@ -2614,7 +2686,7 @@ class MISPAnalystData(AbstractMISP):
|
|
|
2614
2686
|
self.modified = self.created
|
|
2615
2687
|
|
|
2616
2688
|
|
|
2617
|
-
class MISPNote(
|
|
2689
|
+
class MISPNote(MISPAnalystData):
|
|
2618
2690
|
|
|
2619
2691
|
_fields_for_feed: set[str] = MISPAnalystData._fields_for_feed.union({'note', 'language'})
|
|
2620
2692
|
|
|
@@ -2625,8 +2697,8 @@ class MISPNote(AnalystDataBehaviorMixin, MISPAnalystData):
|
|
|
2625
2697
|
self.language: str
|
|
2626
2698
|
super().__init__(**kwargs)
|
|
2627
2699
|
|
|
2628
|
-
def from_dict(self, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2629
|
-
if 'Note' in kwargs:
|
|
2700
|
+
def from_dict(self, contained=False, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2701
|
+
if not contained and 'Note' in kwargs:
|
|
2630
2702
|
kwargs = kwargs['Note']
|
|
2631
2703
|
self.note = kwargs.pop('note', None)
|
|
2632
2704
|
if self.note is None:
|
|
@@ -2639,7 +2711,7 @@ class MISPNote(AnalystDataBehaviorMixin, MISPAnalystData):
|
|
|
2639
2711
|
return f'<{self.__class__.__name__}(NotInitialized)'
|
|
2640
2712
|
|
|
2641
2713
|
|
|
2642
|
-
class MISPOpinion(
|
|
2714
|
+
class MISPOpinion(MISPAnalystData):
|
|
2643
2715
|
|
|
2644
2716
|
_fields_for_feed: set[str] = MISPAnalystData._fields_for_feed.union({'opinion', 'comment'})
|
|
2645
2717
|
|
|
@@ -2650,8 +2722,8 @@ class MISPOpinion(AnalystDataBehaviorMixin, MISPAnalystData):
|
|
|
2650
2722
|
self.comment: str
|
|
2651
2723
|
super().__init__(**kwargs)
|
|
2652
2724
|
|
|
2653
|
-
def from_dict(self, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2654
|
-
if 'Opinion' in kwargs:
|
|
2725
|
+
def from_dict(self, contained=False, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2726
|
+
if not contained and 'Opinion' in kwargs:
|
|
2655
2727
|
kwargs = kwargs['Opinion']
|
|
2656
2728
|
self.opinion = kwargs.pop('opinion', None)
|
|
2657
2729
|
if self.opinion is not None:
|
|
@@ -2673,7 +2745,7 @@ class MISPOpinion(AnalystDataBehaviorMixin, MISPAnalystData):
|
|
|
2673
2745
|
return f'<{self.__class__.__name__}(NotInitialized)'
|
|
2674
2746
|
|
|
2675
2747
|
|
|
2676
|
-
class MISPRelationship(
|
|
2748
|
+
class MISPRelationship(MISPAnalystData):
|
|
2677
2749
|
|
|
2678
2750
|
_fields_for_feed: set[str] = MISPAnalystData._fields_for_feed.union({'related_object_uuid', 'related_object_type', 'relationship_type'})
|
|
2679
2751
|
|
|
@@ -2685,8 +2757,8 @@ class MISPRelationship(AnalystDataBehaviorMixin, MISPAnalystData):
|
|
|
2685
2757
|
self.relationship_type: str
|
|
2686
2758
|
super().__init__(**kwargs)
|
|
2687
2759
|
|
|
2688
|
-
def from_dict(self, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2689
|
-
if 'Relationship' in kwargs:
|
|
2760
|
+
def from_dict(self, contained=False, **kwargs) -> None: # type: ignore[no-untyped-def]
|
|
2761
|
+
if not contained and 'Relationship' in kwargs:
|
|
2690
2762
|
kwargs = kwargs['Relationship']
|
|
2691
2763
|
self.related_object_type = kwargs.pop('related_object_type', None)
|
|
2692
2764
|
if self.related_object_type is None:
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: pymisp
|
|
3
|
-
Version: 2.5.
|
|
3
|
+
Version: 2.5.7
|
|
4
4
|
Summary: Python API for MISP.
|
|
5
|
-
Home-page: https://github.com/MISP/PyMISP
|
|
6
5
|
License: BSD-2-Clause
|
|
7
6
|
Author: Raphaël Vinot
|
|
8
7
|
Author-email: raphael.vinot@circl.lu
|
|
9
|
-
Requires-Python: >=3.9,<4.0
|
|
8
|
+
Requires-Python: >=3.9.2,<4.0
|
|
10
9
|
Classifier: Development Status :: 5 - Production/Stable
|
|
11
10
|
Classifier: Environment :: Console
|
|
12
11
|
Classifier: Intended Audience :: Information Technology
|
|
@@ -15,7 +14,6 @@ Classifier: Intended Audience :: Telecommunications Industry
|
|
|
15
14
|
Classifier: License :: OSI Approved :: BSD License
|
|
16
15
|
Classifier: Operating System :: POSIX :: Linux
|
|
17
16
|
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
19
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -30,29 +28,27 @@ Provides-Extra: openioc
|
|
|
30
28
|
Provides-Extra: pdfexport
|
|
31
29
|
Provides-Extra: url
|
|
32
30
|
Provides-Extra: virustotal
|
|
33
|
-
Requires-Dist: RTFDE (>=0.1.
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
Requires-Dist: oletools (>=0.60.
|
|
41
|
-
Requires-Dist:
|
|
42
|
-
Requires-Dist:
|
|
43
|
-
Requires-Dist:
|
|
44
|
-
Requires-Dist: python-
|
|
45
|
-
Requires-Dist:
|
|
46
|
-
Requires-Dist:
|
|
47
|
-
Requires-Dist:
|
|
48
|
-
Requires-Dist:
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist:
|
|
51
|
-
Requires-Dist: validators (>=0.34.0,<0.35.0) ; extra == "virustotal"
|
|
52
|
-
Project-URL: Bug Tracker, https://github.com/MISP/PyMISP/issues
|
|
31
|
+
Requires-Dist: RTFDE (>=0.1.2) ; (python_version <= "3.9") and (extra == "email")
|
|
32
|
+
Requires-Dist: beautifulsoup4 (>=4.13.3) ; extra == "openioc"
|
|
33
|
+
Requires-Dist: deprecated (>=1.2.18)
|
|
34
|
+
Requires-Dist: docutils (>=0.21.2) ; (python_version >= "3.11") and (extra == "docs")
|
|
35
|
+
Requires-Dist: extract_msg (>=0.53.1) ; extra == "email"
|
|
36
|
+
Requires-Dist: lief (>=0.16.3) ; extra == "fileobjects"
|
|
37
|
+
Requires-Dist: myst-parser (>=4.0.1) ; (python_version >= "3.11") and (extra == "docs")
|
|
38
|
+
Requires-Dist: oletools (>=0.60.2) ; extra == "email"
|
|
39
|
+
Requires-Dist: pydeep2 (>=0.5.1) ; extra == "fileobjects"
|
|
40
|
+
Requires-Dist: pyfaup (>=1.2) ; extra == "url"
|
|
41
|
+
Requires-Dist: python-dateutil (>=2.9.0.post0)
|
|
42
|
+
Requires-Dist: python-magic (>=0.4.27) ; extra == "fileobjects"
|
|
43
|
+
Requires-Dist: reportlab (>=4.3.1) ; extra == "pdfexport"
|
|
44
|
+
Requires-Dist: requests (>=2.32.3)
|
|
45
|
+
Requires-Dist: sphinx (>=8.2.0) ; (python_version >= "3.11") and (extra == "docs")
|
|
46
|
+
Requires-Dist: sphinx-autodoc-typehints (>=3.1.0) ; (python_version >= "3.11") and (extra == "docs")
|
|
47
|
+
Requires-Dist: urllib3 (>=2.3.0) ; extra == "brotli"
|
|
48
|
+
Requires-Dist: validators (>=0.34.0) ; extra == "virustotal"
|
|
53
49
|
Project-URL: Documentation, https://pymisp.readthedocs.io
|
|
54
50
|
Project-URL: Repository, https://github.com/MISP/PyMISP
|
|
55
|
-
Project-URL:
|
|
51
|
+
Project-URL: issues, https://github.com/MISP/PyMISP/issues
|
|
56
52
|
Description-Content-Type: text/markdown
|
|
57
53
|
|
|
58
54
|
**IMPORTANT NOTE**: This library will require **at least** Python 3.10 starting the 1st of January 2024. If you have legacy versions of python, please use the latest PyMISP version that will be released in December 2023, and consider updating your system(s). Anything released within the last 2 years will do, starting with Ubuntu 22.04.
|
|
@@ -61,7 +57,7 @@ Description-Content-Type: text/markdown
|
|
|
61
57
|
|
|
62
58
|
[](http://pymisp.readthedocs.io/?badge=latest)
|
|
63
59
|
[](https://coveralls.io/github/MISP/PyMISP?branch=main)
|
|
64
|
-
[](https://www.python.org/downloads/release/python-390/)
|
|
65
61
|
[](https://pypi.python.org/pypi/pymisp/)
|
|
66
62
|
[](https://pypi.python.org/pypi/pymisp/)
|
|
67
63
|
|
|
@@ -248,4 +244,3 @@ python -m pip install --no-index --no-deps packages/*.whl
|
|
|
248
244
|
|
|
249
245
|
PyMISP is distributed under an [open source license](./LICENSE). A simplified 2-BSD license.
|
|
250
246
|
|
|
251
|
-
|