mmisp-lib 0.1.0__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.
Files changed (161) hide show
  1. mmisp/api_schemas/__init__.py +0 -0
  2. mmisp/api_schemas/attributes/__init__.py +0 -0
  3. mmisp/api_schemas/attributes/add_attribute_body.py +34 -0
  4. mmisp/api_schemas/attributes/add_attribute_response.py +33 -0
  5. mmisp/api_schemas/attributes/add_remove_tag_attribute_response.py +13 -0
  6. mmisp/api_schemas/attributes/delete_attribute_response.py +8 -0
  7. mmisp/api_schemas/attributes/delete_selected_attribute_body.py +9 -0
  8. mmisp/api_schemas/attributes/delete_selected_attribute_response.py +13 -0
  9. mmisp/api_schemas/attributes/edit_attribute_body.py +24 -0
  10. mmisp/api_schemas/attributes/edit_attributes_response.py +42 -0
  11. mmisp/api_schemas/attributes/get_all_attributes_response.py +38 -0
  12. mmisp/api_schemas/attributes/get_attribute_response.py +41 -0
  13. mmisp/api_schemas/attributes/get_attribute_statistics_response.py +137 -0
  14. mmisp/api_schemas/attributes/get_describe_types_response.py +29 -0
  15. mmisp/api_schemas/attributes/restore_attribute_reponse.py +25 -0
  16. mmisp/api_schemas/attributes/search_attributes_body.py +74 -0
  17. mmisp/api_schemas/attributes/search_attributes_response.py +52 -0
  18. mmisp/api_schemas/auth_keys/__init__.py +0 -0
  19. mmisp/api_schemas/auth_keys/add_auth_key_body.py +10 -0
  20. mmisp/api_schemas/auth_keys/add_auth_key_response.py +20 -0
  21. mmisp/api_schemas/auth_keys/edit_auth_key_body.py +8 -0
  22. mmisp/api_schemas/auth_keys/edit_auth_key_response.py +24 -0
  23. mmisp/api_schemas/auth_keys/search_auth_keys_body.py +17 -0
  24. mmisp/api_schemas/auth_keys/search_get_all_auth_keys_users_response.py +28 -0
  25. mmisp/api_schemas/auth_keys/view_auth_key_response.py +24 -0
  26. mmisp/api_schemas/authentication/__init__.py +0 -0
  27. mmisp/api_schemas/authentication/exchange_token_login_body.py +5 -0
  28. mmisp/api_schemas/authentication/password_login_body.py +6 -0
  29. mmisp/api_schemas/authentication/start_login_body.py +5 -0
  30. mmisp/api_schemas/authentication/start_login_response.py +21 -0
  31. mmisp/api_schemas/authentication/token_response.py +5 -0
  32. mmisp/api_schemas/events/FreeTextImportWorkerBody.py +17 -0
  33. mmisp/api_schemas/events/__init__.py +0 -0
  34. mmisp/api_schemas/events/add_attribute_via_free_text_import_event_body.py +12 -0
  35. mmisp/api_schemas/events/add_attribute_via_free_text_import_event_response.py +14 -0
  36. mmisp/api_schemas/events/add_edit_get_event_response.py +234 -0
  37. mmisp/api_schemas/events/add_event_body.py +30 -0
  38. mmisp/api_schemas/events/add_remove_tag_events_response.py +11 -0
  39. mmisp/api_schemas/events/delete_event_response.py +14 -0
  40. mmisp/api_schemas/events/edit_event_body.py +28 -0
  41. mmisp/api_schemas/events/get_all_events_response.py +99 -0
  42. mmisp/api_schemas/events/get_event_response.py +8 -0
  43. mmisp/api_schemas/events/index_events_body.py +30 -0
  44. mmisp/api_schemas/events/index_events_response.py +40 -0
  45. mmisp/api_schemas/events/publish_event_response.py +13 -0
  46. mmisp/api_schemas/events/search_events_body.py +43 -0
  47. mmisp/api_schemas/events/search_events_response.py +10 -0
  48. mmisp/api_schemas/events/unpublish_event_response.py +13 -0
  49. mmisp/api_schemas/feeds/__init__.py +0 -0
  50. mmisp/api_schemas/feeds/cache_feed_response.py +12 -0
  51. mmisp/api_schemas/feeds/create_feed_body.py +30 -0
  52. mmisp/api_schemas/feeds/enable_disable_feed_response.py +10 -0
  53. mmisp/api_schemas/feeds/fetch_feeds_response.py +8 -0
  54. mmisp/api_schemas/feeds/get_feed_response.py +47 -0
  55. mmisp/api_schemas/feeds/toggle_feed_body.py +8 -0
  56. mmisp/api_schemas/feeds/update_feed_body.py +30 -0
  57. mmisp/api_schemas/galaxies/__init__.py +0 -0
  58. mmisp/api_schemas/galaxies/attach_galaxy_cluster_body.py +12 -0
  59. mmisp/api_schemas/galaxies/attach_galaxy_cluster_response.py +10 -0
  60. mmisp/api_schemas/galaxies/delete_force_update_import_galaxy_response.py +12 -0
  61. mmisp/api_schemas/galaxies/export_galaxies_body.py +16 -0
  62. mmisp/api_schemas/galaxies/export_galaxies_response.py +44 -0
  63. mmisp/api_schemas/galaxies/galaxy_schema.py +18 -0
  64. mmisp/api_schemas/galaxies/get_all_search_galaxies_response.py +22 -0
  65. mmisp/api_schemas/galaxies/get_galaxy_response.py +37 -0
  66. mmisp/api_schemas/galaxies/import_galaxies_body.py +15 -0
  67. mmisp/api_schemas/galaxies/search_galaxies_body.py +22 -0
  68. mmisp/api_schemas/noticelists/__init__.py +0 -0
  69. mmisp/api_schemas/noticelists/get_all_noticelist_response.py +10 -0
  70. mmisp/api_schemas/noticelists/get_noticelist_response.py +38 -0
  71. mmisp/api_schemas/objects/__init__.py +0 -0
  72. mmisp/api_schemas/objects/create_object_body.py +19 -0
  73. mmisp/api_schemas/objects/get_object_response.py +50 -0
  74. mmisp/api_schemas/objects/search_objects_body.py +49 -0
  75. mmisp/api_schemas/organisations/__init__.py +0 -0
  76. mmisp/api_schemas/organisations/organisation.py +24 -0
  77. mmisp/api_schemas/roles/__init__.py +0 -0
  78. mmisp/api_schemas/roles/role.py +71 -0
  79. mmisp/api_schemas/sharing_groups/__init__.py +0 -0
  80. mmisp/api_schemas/sharing_groups/add_org_to_sharing_group_body.py +6 -0
  81. mmisp/api_schemas/sharing_groups/add_org_to_sharing_group_legacy_body.py +5 -0
  82. mmisp/api_schemas/sharing_groups/add_server_to_sharing_group_body.py +6 -0
  83. mmisp/api_schemas/sharing_groups/add_server_to_sharing_group_legacy_body.py +5 -0
  84. mmisp/api_schemas/sharing_groups/create_sharing_group_body.py +12 -0
  85. mmisp/api_schemas/sharing_groups/create_sharing_group_legacy_body.py +23 -0
  86. mmisp/api_schemas/sharing_groups/create_sharing_group_legacy_response.py +18 -0
  87. mmisp/api_schemas/sharing_groups/delete_sharing_group_legacy_response.py +5 -0
  88. mmisp/api_schemas/sharing_groups/get_all_sharing_groups_response.py +53 -0
  89. mmisp/api_schemas/sharing_groups/get_sharing_group_info_response.py +44 -0
  90. mmisp/api_schemas/sharing_groups/sharing_group.py +19 -0
  91. mmisp/api_schemas/sharing_groups/sharing_group_org.py +8 -0
  92. mmisp/api_schemas/sharing_groups/sharing_group_server.py +8 -0
  93. mmisp/api_schemas/sharing_groups/update_sharing_group_body.py +10 -0
  94. mmisp/api_schemas/sharing_groups/update_sharing_group_legacy_body.py +28 -0
  95. mmisp/api_schemas/sharing_groups/view_update_sharing_group_legacy_response.py +40 -0
  96. mmisp/api_schemas/sightings/__init__.py +0 -0
  97. mmisp/api_schemas/sightings/create_sighting_body.py +49 -0
  98. mmisp/api_schemas/sightings/get_sighting_response.py +27 -0
  99. mmisp/api_schemas/standard_status_response.py +13 -0
  100. mmisp/api_schemas/tags/__init__.py +0 -0
  101. mmisp/api_schemas/tags/create_tag_body.py +15 -0
  102. mmisp/api_schemas/tags/delete_tag_response.py +10 -0
  103. mmisp/api_schemas/tags/get_tag_response.py +31 -0
  104. mmisp/api_schemas/tags/search_tags_response.py +26 -0
  105. mmisp/api_schemas/tags/update_tag_body.py +15 -0
  106. mmisp/api_schemas/taxonomies/__init__.py +0 -0
  107. mmisp/api_schemas/taxonomies/export_taxonomies_response.py +30 -0
  108. mmisp/api_schemas/taxonomies/get_taxonomy_by_id_response.py +30 -0
  109. mmisp/api_schemas/taxonomies/get_taxonomy_response.py +21 -0
  110. mmisp/api_schemas/taxonomies/get_taxonomy_tags_response.py +32 -0
  111. mmisp/api_schemas/user_settings/__init__.py +0 -0
  112. mmisp/api_schemas/user_settings/get_uid_user_setting_response.py +21 -0
  113. mmisp/api_schemas/user_settings/get_user_settings_response.py +13 -0
  114. mmisp/api_schemas/user_settings/search_user_setting_body.py +7 -0
  115. mmisp/api_schemas/user_settings/search_user_setting_response.py +11 -0
  116. mmisp/api_schemas/user_settings/set_user_setting_body.py +5 -0
  117. mmisp/api_schemas/user_settings/set_user_setting_response.py +13 -0
  118. mmisp/api_schemas/user_settings/view_user_setting_response.py +13 -0
  119. mmisp/api_schemas/users/__init__.py +0 -0
  120. mmisp/api_schemas/users/user.py +42 -0
  121. mmisp/api_schemas/users/users_view_me_response.py +12 -0
  122. mmisp/api_schemas/warninglists/__init__.py +0 -0
  123. mmisp/api_schemas/warninglists/check_value_warninglists_body.py +8 -0
  124. mmisp/api_schemas/warninglists/check_value_warninglists_response.py +14 -0
  125. mmisp/api_schemas/warninglists/create_warninglist_body.py +220 -0
  126. mmisp/api_schemas/warninglists/delete_warninglist_response.py +13 -0
  127. mmisp/api_schemas/warninglists/get_selected_all_warninglists_response.py +14 -0
  128. mmisp/api_schemas/warninglists/get_selected_warninglists_body.py +9 -0
  129. mmisp/api_schemas/warninglists/toggle_enable_warninglists_body.py +10 -0
  130. mmisp/api_schemas/warninglists/toggle_enable_warninglists_response.py +10 -0
  131. mmisp/api_schemas/warninglists/warninglist_response.py +42 -0
  132. mmisp/db/__init__.py +0 -0
  133. mmisp/db/config.py +17 -0
  134. mmisp/db/database.py +42 -0
  135. mmisp/db/models/__init__.py +0 -0
  136. mmisp/db/models/attribute.py +92 -0
  137. mmisp/db/models/auth_key.py +24 -0
  138. mmisp/db/models/event.py +62 -0
  139. mmisp/db/models/feed.py +32 -0
  140. mmisp/db/models/galaxy.py +22 -0
  141. mmisp/db/models/galaxy_cluster.py +52 -0
  142. mmisp/db/models/identity_provider.py +22 -0
  143. mmisp/db/models/noticelist.py +22 -0
  144. mmisp/db/models/object.py +39 -0
  145. mmisp/db/models/organisation.py +26 -0
  146. mmisp/db/models/role.py +42 -0
  147. mmisp/db/models/server.py +33 -0
  148. mmisp/db/models/sharing_group.py +43 -0
  149. mmisp/db/models/sighting.py +21 -0
  150. mmisp/db/models/tag.py +19 -0
  151. mmisp/db/models/taxonomy.py +41 -0
  152. mmisp/db/models/user.py +44 -0
  153. mmisp/db/models/user_setting.py +29 -0
  154. mmisp/db/models/warninglist.py +33 -0
  155. mmisp/db/print_changes.py +59 -0
  156. mmisp/lib/__init__.py +0 -0
  157. mmisp/lib/attributes.py +1386 -0
  158. mmisp_lib-0.1.0.dist-info/METADATA +77 -0
  159. mmisp_lib-0.1.0.dist-info/RECORD +161 -0
  160. mmisp_lib-0.1.0.dist-info/WHEEL +5 -0
  161. mmisp_lib-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,28 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class SearchGetAuthKeysResponseItemUser(BaseModel):
5
+ id: str
6
+ email: str
7
+
8
+
9
+ class SearchGetAuthKeysResponseItemAuthKey(BaseModel):
10
+ id: str
11
+ uuid: str
12
+ authkey_start: str
13
+ authkey_end: str
14
+ created: str
15
+ expiration: str
16
+ read_only: bool
17
+ user_id: str
18
+ comment: str | None
19
+ allowed_ips: list[str] | None = None
20
+ unique_ips: list[str] | None = []
21
+
22
+
23
+ class SearchGetAuthKeysResponseItem(BaseModel):
24
+ AuthKey: SearchGetAuthKeysResponseItemAuthKey
25
+ User: SearchGetAuthKeysResponseItemUser
26
+
27
+ class Config:
28
+ orm_mode = True
@@ -0,0 +1,24 @@
1
+ from datetime import datetime
2
+
3
+ from pydantic import BaseModel
4
+
5
+ from .search_get_all_auth_keys_users_response import SearchGetAuthKeysResponseItemUser
6
+
7
+
8
+ class ViewAuthKeyResponseWrapper(BaseModel):
9
+ id: str
10
+ uuid: str
11
+ authkey_start: str
12
+ authkey_end: str
13
+ created: datetime
14
+ expiration: int
15
+ read_only: bool
16
+ user_id: str
17
+ comment: str
18
+ allowed_ips: list[str] | None = None
19
+ unique_ips: list[str] | None = []
20
+
21
+
22
+ class ViewAuthKeysResponse(BaseModel):
23
+ AuthKey: ViewAuthKeyResponseWrapper
24
+ User: SearchGetAuthKeysResponseItemUser
File without changes
@@ -0,0 +1,5 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class ExchangeTokenLoginBody(BaseModel):
5
+ exchangeToken: str
@@ -0,0 +1,6 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class PasswordLoginBody(BaseModel):
5
+ email: str
6
+ password: str
@@ -0,0 +1,5 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class StartLoginBody(BaseModel):
5
+ email: str
@@ -0,0 +1,21 @@
1
+ from enum import Enum
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class LoginType(Enum):
7
+ PASSWORD = "password"
8
+ IDENTITY_PROVIDER = "idp"
9
+
10
+
11
+ class IdentityProviderInfo(BaseModel):
12
+ id: str
13
+ name: str
14
+
15
+ class Config:
16
+ orm_mode = True
17
+
18
+
19
+ class StartLoginResponse(BaseModel):
20
+ loginType: LoginType
21
+ identityProviders: list[IdentityProviderInfo] = []
@@ -0,0 +1,5 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class TokenResponse(BaseModel):
5
+ token: str
@@ -0,0 +1,17 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class FreeTextImportWorkerUser(BaseModel):
5
+ user_id: int
6
+
7
+
8
+ class FreeTextImportWorkerData(BaseModel):
9
+ data: str
10
+
11
+
12
+ class FreeTextImportWorkerBody(BaseModel):
13
+ user: FreeTextImportWorkerUser
14
+ data: FreeTextImportWorkerData
15
+
16
+ class Config:
17
+ orm_mode = True
File without changes
@@ -0,0 +1,12 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class AddAttributeViaFreeTextImportEventAttributes(BaseModel):
5
+ value: str
6
+
7
+
8
+ class AddAttributeViaFreeTextImportEventBody(BaseModel):
9
+ Attribute: AddAttributeViaFreeTextImportEventAttributes
10
+
11
+ class Config:
12
+ orm_mode = True
@@ -0,0 +1,14 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class AddAttributeViaFreeTextImportEventResponse(BaseModel):
5
+ comment: str | None = None
6
+ value: str
7
+ original_value: str
8
+ to_ids: str
9
+ type: str
10
+ category: str
11
+ distribution: str
12
+
13
+ class Config:
14
+ orm_mode = True
@@ -0,0 +1,234 @@
1
+ from pydantic import BaseModel
2
+
3
+ from ..organisations.organisation import Organisation
4
+
5
+
6
+ class AddEditGetEventGalaxyClusterMeta(BaseModel):
7
+ external_id: str | None = None
8
+ refs: list[str] | None = None
9
+ kill_chain: str | None = None
10
+
11
+
12
+ class AddEditGetEventGalaxyClusterRelationTag(BaseModel):
13
+ id: str
14
+ name: str
15
+ colour: str
16
+ exportable: bool
17
+ org_id: str
18
+ user_id: str
19
+ hide_tag: bool
20
+ numerical_value: str
21
+ is_galaxy: bool
22
+ is_custom_galaxy: bool
23
+ local_only: bool
24
+
25
+
26
+ class AddEditGetEventGalaxyClusterRelation(BaseModel):
27
+ id: str
28
+ galaxy_cluster_id: str
29
+ referenced_galaxy_cluster_id: str
30
+ referenced_galaxy_cluster_uuid: str
31
+ referenced_galaxy_cluster_type: str
32
+ galaxy_cluster_uuid: str
33
+ distribution: str
34
+ sharing_group_id: str | None = None
35
+ default: bool
36
+ Tag: list[AddEditGetEventGalaxyClusterRelationTag] = []
37
+
38
+
39
+ class AddEditGetEventGalaxyCluster(BaseModel):
40
+ id: str
41
+ uuid: str
42
+ collection_uuid: str
43
+ type: str
44
+ value: str
45
+ tag_name: str
46
+ description: str
47
+ galaxy_id: str
48
+ source: str
49
+ authors: list[str]
50
+ version: str
51
+ distribution: str | None = None
52
+ sharing_group_id: str | None = None
53
+ org_id: str
54
+ orgc_id: str
55
+ default: bool | None = None
56
+ locked: bool | None = None
57
+ extends_uuid: str | None = None
58
+ extends_version: str | None = None
59
+ published: bool | None = None
60
+ deleted: bool | None = None
61
+ GalaxyClusterRelation: list[AddEditGetEventGalaxyClusterRelation] = []
62
+ Org: Organisation | None = None
63
+ Orgc: Organisation | None = None
64
+ meta: AddEditGetEventGalaxyClusterMeta | None = None
65
+ tag_id: str
66
+ attribute_tag_id: str | None = None
67
+ event_tag_id: str | None = None
68
+ local: bool | None = None
69
+ relationship_type: str = ""
70
+
71
+
72
+ class AddEditGetEventGalaxy(BaseModel):
73
+ id: str
74
+ uuid: str
75
+ name: str
76
+ type: str
77
+ description: str
78
+ version: str
79
+ icon: str
80
+ namespace: str
81
+ enabled: bool
82
+ local_only: bool
83
+ kill_chain_order: str | None = None
84
+ GalaxyCluster: list[AddEditGetEventGalaxyCluster] = []
85
+
86
+
87
+ class AddEditGetEventOrg(BaseModel):
88
+ id: str
89
+ name: str
90
+ uuid: str
91
+ local: bool | None = None
92
+
93
+
94
+ class AddEditGetEventShadowAttribute(BaseModel):
95
+ value: str
96
+ to_ids: bool
97
+ type: str
98
+ category: str
99
+
100
+
101
+ class AddEditGetEventRelatedEventAttributesOrg(BaseModel):
102
+ id: str
103
+ name: str
104
+ uuid: str
105
+
106
+
107
+ class AddEditGetEventRelatedEventAttributes(BaseModel):
108
+ id: str
109
+ date: str
110
+ threat_level_id: str
111
+ info: str
112
+ published: str
113
+ uuid: str
114
+ analysis: str
115
+ timestamp: str
116
+ distribution: str
117
+ org_id: str
118
+ orgc_id: str
119
+ Org: AddEditGetEventRelatedEventAttributesOrg
120
+ Orgc: AddEditGetEventRelatedEventAttributesOrg
121
+
122
+
123
+ class AddEditGetEventRelatedEvent(BaseModel):
124
+ Event: list[AddEditGetEventRelatedEventAttributes] = []
125
+
126
+
127
+ class AddEditGetEventTag(BaseModel):
128
+ id: str
129
+ name: str
130
+ colour: str
131
+ exportable: str
132
+ user_id: str
133
+ hide_tag: bool
134
+ numerical_value: int | None = None
135
+ is_galaxy: bool
136
+ is_custom_galaxy: bool
137
+ local_only: bool
138
+ local: int
139
+ relationship_type: str | None = None
140
+
141
+
142
+ class AddEditGetEventAttribute(BaseModel):
143
+ id: str
144
+ event_id: str
145
+ object_id: str
146
+ object_relation: str | None = None
147
+ category: str
148
+ type: str
149
+ value: str
150
+ to_ids: bool
151
+ uuid: str
152
+ timestamp: str
153
+ distribution: str
154
+ sharing_group_id: str
155
+ comment: str | None = None
156
+ deleted: bool
157
+ disable_correlation: bool
158
+ first_seen: str | None = None
159
+ last_seen: str | None = None
160
+ Galaxy: list[AddEditGetEventGalaxy] = []
161
+ ShadowAttribute: list[str] = []
162
+ Tag: list[AddEditGetEventTag] = []
163
+
164
+
165
+ class AddEditGetEventObject(BaseModel):
166
+ id: str
167
+ name: str
168
+ meta_category: str
169
+ description: str
170
+ template_uuid: str
171
+ template_version: str
172
+ event_id: str
173
+ uuid: str
174
+ timestamp: str
175
+ distribution: str
176
+ sharing_group_id: str
177
+ comment: str
178
+ deleted: bool
179
+ first_seen: str | None = None
180
+ last_seen: str | None = None
181
+ ObjectReference: list[str] = []
182
+ Attribute: list[AddEditGetEventAttribute] = []
183
+
184
+
185
+ class AddEditGetEventEventReport(BaseModel):
186
+ id: str
187
+ uuid: str
188
+ event_id: str
189
+ name: str
190
+ content: str
191
+ distribution: str
192
+ sharing_group_id: str
193
+ timestamp: str
194
+ deleted: bool
195
+
196
+
197
+ class AddEditGetEventDetails(BaseModel):
198
+ id: str
199
+ orgc_id: str
200
+ org_id: str
201
+ date: str
202
+ threat_level_id: str
203
+ info: str
204
+ published: bool
205
+ uuid: str
206
+ attribute_count: str
207
+ analysis: str
208
+ timestamp: str
209
+ distribution: str
210
+ proposal_email_lock: bool
211
+ locked: bool
212
+ publish_timestamp: str
213
+ sharing_group_id: str
214
+ disable_correlation: bool
215
+ extends_uuid: str
216
+ protected: bool | None = None
217
+ event_creator_email: str
218
+ Org: AddEditGetEventOrg
219
+ Orgc: AddEditGetEventOrg
220
+ Attribute: list[AddEditGetEventAttribute] = []
221
+ ShadowAttribute: list[AddEditGetEventShadowAttribute] = []
222
+ RelatedEvent: list[AddEditGetEventEventReport] = []
223
+ Galaxy: list[AddEditGetEventGalaxy] = []
224
+ Object: list[AddEditGetEventObject] = []
225
+ EventReport: list[AddEditGetEventEventReport] = []
226
+ CryptographicKey: list[str] = []
227
+ Tag: list[AddEditGetEventTag] = []
228
+
229
+
230
+ class AddEditGetEventResponse(BaseModel):
231
+ Event: AddEditGetEventDetails
232
+
233
+ class Config:
234
+ orm_mode = True
@@ -0,0 +1,30 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class AddEventTag(BaseModel):
5
+ name: str
6
+
7
+
8
+ class AddEventBody(BaseModel):
9
+ info: str
10
+ org_id: str | None = None
11
+ distribution: str | None = None
12
+ orgc_id: str | None = None
13
+ uuid: str | None = None
14
+ date: str | None = None
15
+ published: bool | None = None
16
+ analysis: str | None = None
17
+ attribute_count: str | None = None
18
+ timestamp: str | None = None
19
+ sharing_group_id: str | None = None
20
+ proposal_email_lock: bool | None = None
21
+ locked: bool | None = None
22
+ threat_level_id: str | None = None
23
+ publish_timestamp: str | None = None
24
+ sighting_timestamp: str | None = None
25
+ disable_correlation: bool | None = None
26
+ extends_uuid: str | None = None
27
+ protected: str | None = None
28
+
29
+ class Config:
30
+ orm_mode = True
@@ -0,0 +1,11 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class AddRemoveTagEventsResponse(BaseModel):
5
+ saved: bool
6
+ success: str | None = None
7
+ check_publish: bool | None = None
8
+ errors: str | None = None
9
+
10
+ class Config:
11
+ orm_mode = True
@@ -0,0 +1,14 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class DeleteEventResponse(BaseModel):
5
+ saved: bool
6
+ success: bool | None = None
7
+ name: str
8
+ message: str
9
+ url: str
10
+ id: str
11
+ errors: str | None = None
12
+
13
+ class Config:
14
+ orm_mode = True
@@ -0,0 +1,28 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class EditEventBody(BaseModel):
5
+ info: str | None = None
6
+ org_id: str | None = None
7
+ distribution: str | None = None
8
+ orgc_id: str | None = None
9
+ uuid: str | None = None
10
+ date: str | None = None
11
+ published: bool | None = None
12
+ analysis: str | None = None
13
+ attribute_count: str | None = None
14
+ timestamp: str | None = None
15
+ sharing_group_id: str | None = None
16
+ proposal_email_lock: bool | None = None
17
+ locked: bool | None = None
18
+ threat_level_id: str | None = None
19
+ publish_timestamp: str | None = None
20
+ sighting_timestamp: str | None = None
21
+ disable_correlation: bool | None = None
22
+ extends_uuid: str | None = None
23
+ event_creator_email: str | None = None
24
+ protected: str | None = None
25
+ cryptographic_key: str | None = None
26
+
27
+ class Config:
28
+ orm_mode = True
@@ -0,0 +1,99 @@
1
+ from pydantic import BaseModel
2
+
3
+ from .add_edit_get_event_response import AddEditGetEventGalaxyClusterMeta
4
+
5
+
6
+ class GetAllEventsOrg(BaseModel):
7
+ id: str
8
+ name: str
9
+ uuid: str
10
+
11
+
12
+ class GetAllEventsGalaxyClusterGalaxy(BaseModel):
13
+ id: str
14
+ uuid: str
15
+ name: str
16
+ type: str
17
+ description: str
18
+ version: str
19
+ icon: str
20
+ namespace: str
21
+ enabled: bool
22
+ local_only: bool
23
+ kill_chain_order: str | None = None
24
+
25
+
26
+ class GetAllEventsGalaxyCluster(BaseModel):
27
+ id: str
28
+ uuid: str
29
+ collection_uuid: str
30
+ type: str
31
+ value: str
32
+ tag_name: str
33
+ description: str
34
+ galaxy_id: str
35
+ source: str
36
+ authors: list[str]
37
+ version: str
38
+ distribution: str | None = None
39
+ sharing_group_id: str | None = None
40
+ org_id: str
41
+ orgc_id: str
42
+ default: str | None = None
43
+ locked: bool | None = None
44
+ extends_uuid: str
45
+ extends_version: str
46
+ published: bool | None = None
47
+ deleted: bool | None = None
48
+ Galaxy: GetAllEventsGalaxyClusterGalaxy
49
+ meta: AddEditGetEventGalaxyClusterMeta | None = None
50
+ tag_id: str
51
+ local: bool | None = None
52
+ relationship_type: str | None = None
53
+
54
+
55
+ class GetAllEventsEventTagTag(BaseModel):
56
+ id: str
57
+ name: str
58
+ colour: str
59
+ is_galaxy: bool
60
+
61
+
62
+ class GetAllEventsEventTag(BaseModel):
63
+ id: str
64
+ event_id: str
65
+ tag_id: str
66
+ local: bool
67
+ relationship_type: str
68
+ Tag: GetAllEventsEventTagTag
69
+
70
+
71
+ class GetAllEventsResponse(BaseModel):
72
+ id: str
73
+ org_id: str # owner org
74
+ distribution: str
75
+ info: str
76
+ orgc_id: str # creator org
77
+ uuid: str
78
+ date: str
79
+ published: bool
80
+ analysis: str
81
+ attribute_count: str
82
+ timestamp: str
83
+ sharing_group_id: str
84
+ proposal_email_lock: bool
85
+ locked: bool
86
+ threat_level_id: str
87
+ publish_timestamp: str
88
+ sighting_timestamp: str
89
+ disable_correlation: bool
90
+ extends_uuid: str
91
+ event_creator_email: str # omitted
92
+ protected: str | None = None
93
+ Org: GetAllEventsOrg
94
+ Orgc: GetAllEventsOrg
95
+ GalaxyCluster: list[GetAllEventsGalaxyCluster]
96
+ EventTag: list[GetAllEventsEventTag]
97
+
98
+ class Config:
99
+ orm_mode = True
@@ -0,0 +1,8 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class ObjectEventResponse(BaseModel):
5
+ id: str
6
+ info: str
7
+ org_id: str | None = None
8
+ orgc_id: str | None = None
@@ -0,0 +1,30 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class IndexEventsBody(BaseModel):
5
+ page: int | None = None
6
+ limit: int | None = None
7
+ sort: int | None = None
8
+ direction: int | None = None
9
+ minimal: bool | None = None
10
+ attribute: str | None = None
11
+ eventid: str | None = None
12
+ datefrom: str | None = None
13
+ dateuntil: str | None = None
14
+ org: str | None = None
15
+ eventinfo: str | None = None
16
+ tag: str | None = None
17
+ tags: list[str] | None = None
18
+ distribution: str | None = None
19
+ sharinggroup: str | None = None
20
+ analysis: str | None = None
21
+ threatlevel: str | None = None
22
+ email: str | None = None
23
+ hasproposal: str | None = None
24
+ timestamp: str | None = None
25
+ publish_timestamp: str | None = None
26
+ searchDatefrom: str | None = None
27
+ searchDateuntil: str | None = None
28
+
29
+ class Config:
30
+ orm_mode = True
@@ -0,0 +1,40 @@
1
+ from pydantic import BaseModel
2
+
3
+ from .get_all_events_response import GetAllEventsGalaxyCluster, GetAllEventsOrg
4
+
5
+
6
+ class IndexEventsEventTag(BaseModel):
7
+ id: str
8
+ event_id: str
9
+ tag_id: str
10
+ local: bool
11
+
12
+
13
+ class IndexEventsAttributes(BaseModel):
14
+ id: str
15
+ org_id: str
16
+ date: str
17
+ info: str
18
+ uuid: str
19
+ published: bool
20
+ analysis: str
21
+ attribute_count: str
22
+ orgc_id: str
23
+ timestamp: str
24
+ distribution: str
25
+ sharing_group_id: str
26
+ proposal_email_lock: bool
27
+ locked: bool
28
+ threat_level_id: str
29
+ publish_timestamp: str
30
+ sighting_timestamp: str
31
+ disable_correlation: bool
32
+ extends_uuid: str
33
+ protected: bool | None = None
34
+ Org: GetAllEventsOrg
35
+ Orgc: GetAllEventsOrg
36
+ GalaxyCluster: list[GetAllEventsGalaxyCluster] = []
37
+ EventTag: list[IndexEventsEventTag] = []
38
+
39
+ class Config:
40
+ orm_mode = True
@@ -0,0 +1,13 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class PublishEventResponse(BaseModel):
5
+ saved: bool | None = None
6
+ success: bool | None = None
7
+ name: str
8
+ message: str
9
+ url: str
10
+ id: str | None = None
11
+
12
+ class Config:
13
+ orm_mode = True