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.
- mmisp/api_schemas/__init__.py +0 -0
- mmisp/api_schemas/attributes/__init__.py +0 -0
- mmisp/api_schemas/attributes/add_attribute_body.py +34 -0
- mmisp/api_schemas/attributes/add_attribute_response.py +33 -0
- mmisp/api_schemas/attributes/add_remove_tag_attribute_response.py +13 -0
- mmisp/api_schemas/attributes/delete_attribute_response.py +8 -0
- mmisp/api_schemas/attributes/delete_selected_attribute_body.py +9 -0
- mmisp/api_schemas/attributes/delete_selected_attribute_response.py +13 -0
- mmisp/api_schemas/attributes/edit_attribute_body.py +24 -0
- mmisp/api_schemas/attributes/edit_attributes_response.py +42 -0
- mmisp/api_schemas/attributes/get_all_attributes_response.py +38 -0
- mmisp/api_schemas/attributes/get_attribute_response.py +41 -0
- mmisp/api_schemas/attributes/get_attribute_statistics_response.py +137 -0
- mmisp/api_schemas/attributes/get_describe_types_response.py +29 -0
- mmisp/api_schemas/attributes/restore_attribute_reponse.py +25 -0
- mmisp/api_schemas/attributes/search_attributes_body.py +74 -0
- mmisp/api_schemas/attributes/search_attributes_response.py +52 -0
- mmisp/api_schemas/auth_keys/__init__.py +0 -0
- mmisp/api_schemas/auth_keys/add_auth_key_body.py +10 -0
- mmisp/api_schemas/auth_keys/add_auth_key_response.py +20 -0
- mmisp/api_schemas/auth_keys/edit_auth_key_body.py +8 -0
- mmisp/api_schemas/auth_keys/edit_auth_key_response.py +24 -0
- mmisp/api_schemas/auth_keys/search_auth_keys_body.py +17 -0
- mmisp/api_schemas/auth_keys/search_get_all_auth_keys_users_response.py +28 -0
- mmisp/api_schemas/auth_keys/view_auth_key_response.py +24 -0
- mmisp/api_schemas/authentication/__init__.py +0 -0
- mmisp/api_schemas/authentication/exchange_token_login_body.py +5 -0
- mmisp/api_schemas/authentication/password_login_body.py +6 -0
- mmisp/api_schemas/authentication/start_login_body.py +5 -0
- mmisp/api_schemas/authentication/start_login_response.py +21 -0
- mmisp/api_schemas/authentication/token_response.py +5 -0
- mmisp/api_schemas/events/FreeTextImportWorkerBody.py +17 -0
- mmisp/api_schemas/events/__init__.py +0 -0
- mmisp/api_schemas/events/add_attribute_via_free_text_import_event_body.py +12 -0
- mmisp/api_schemas/events/add_attribute_via_free_text_import_event_response.py +14 -0
- mmisp/api_schemas/events/add_edit_get_event_response.py +234 -0
- mmisp/api_schemas/events/add_event_body.py +30 -0
- mmisp/api_schemas/events/add_remove_tag_events_response.py +11 -0
- mmisp/api_schemas/events/delete_event_response.py +14 -0
- mmisp/api_schemas/events/edit_event_body.py +28 -0
- mmisp/api_schemas/events/get_all_events_response.py +99 -0
- mmisp/api_schemas/events/get_event_response.py +8 -0
- mmisp/api_schemas/events/index_events_body.py +30 -0
- mmisp/api_schemas/events/index_events_response.py +40 -0
- mmisp/api_schemas/events/publish_event_response.py +13 -0
- mmisp/api_schemas/events/search_events_body.py +43 -0
- mmisp/api_schemas/events/search_events_response.py +10 -0
- mmisp/api_schemas/events/unpublish_event_response.py +13 -0
- mmisp/api_schemas/feeds/__init__.py +0 -0
- mmisp/api_schemas/feeds/cache_feed_response.py +12 -0
- mmisp/api_schemas/feeds/create_feed_body.py +30 -0
- mmisp/api_schemas/feeds/enable_disable_feed_response.py +10 -0
- mmisp/api_schemas/feeds/fetch_feeds_response.py +8 -0
- mmisp/api_schemas/feeds/get_feed_response.py +47 -0
- mmisp/api_schemas/feeds/toggle_feed_body.py +8 -0
- mmisp/api_schemas/feeds/update_feed_body.py +30 -0
- mmisp/api_schemas/galaxies/__init__.py +0 -0
- mmisp/api_schemas/galaxies/attach_galaxy_cluster_body.py +12 -0
- mmisp/api_schemas/galaxies/attach_galaxy_cluster_response.py +10 -0
- mmisp/api_schemas/galaxies/delete_force_update_import_galaxy_response.py +12 -0
- mmisp/api_schemas/galaxies/export_galaxies_body.py +16 -0
- mmisp/api_schemas/galaxies/export_galaxies_response.py +44 -0
- mmisp/api_schemas/galaxies/galaxy_schema.py +18 -0
- mmisp/api_schemas/galaxies/get_all_search_galaxies_response.py +22 -0
- mmisp/api_schemas/galaxies/get_galaxy_response.py +37 -0
- mmisp/api_schemas/galaxies/import_galaxies_body.py +15 -0
- mmisp/api_schemas/galaxies/search_galaxies_body.py +22 -0
- mmisp/api_schemas/noticelists/__init__.py +0 -0
- mmisp/api_schemas/noticelists/get_all_noticelist_response.py +10 -0
- mmisp/api_schemas/noticelists/get_noticelist_response.py +38 -0
- mmisp/api_schemas/objects/__init__.py +0 -0
- mmisp/api_schemas/objects/create_object_body.py +19 -0
- mmisp/api_schemas/objects/get_object_response.py +50 -0
- mmisp/api_schemas/objects/search_objects_body.py +49 -0
- mmisp/api_schemas/organisations/__init__.py +0 -0
- mmisp/api_schemas/organisations/organisation.py +24 -0
- mmisp/api_schemas/roles/__init__.py +0 -0
- mmisp/api_schemas/roles/role.py +71 -0
- mmisp/api_schemas/sharing_groups/__init__.py +0 -0
- mmisp/api_schemas/sharing_groups/add_org_to_sharing_group_body.py +6 -0
- mmisp/api_schemas/sharing_groups/add_org_to_sharing_group_legacy_body.py +5 -0
- mmisp/api_schemas/sharing_groups/add_server_to_sharing_group_body.py +6 -0
- mmisp/api_schemas/sharing_groups/add_server_to_sharing_group_legacy_body.py +5 -0
- mmisp/api_schemas/sharing_groups/create_sharing_group_body.py +12 -0
- mmisp/api_schemas/sharing_groups/create_sharing_group_legacy_body.py +23 -0
- mmisp/api_schemas/sharing_groups/create_sharing_group_legacy_response.py +18 -0
- mmisp/api_schemas/sharing_groups/delete_sharing_group_legacy_response.py +5 -0
- mmisp/api_schemas/sharing_groups/get_all_sharing_groups_response.py +53 -0
- mmisp/api_schemas/sharing_groups/get_sharing_group_info_response.py +44 -0
- mmisp/api_schemas/sharing_groups/sharing_group.py +19 -0
- mmisp/api_schemas/sharing_groups/sharing_group_org.py +8 -0
- mmisp/api_schemas/sharing_groups/sharing_group_server.py +8 -0
- mmisp/api_schemas/sharing_groups/update_sharing_group_body.py +10 -0
- mmisp/api_schemas/sharing_groups/update_sharing_group_legacy_body.py +28 -0
- mmisp/api_schemas/sharing_groups/view_update_sharing_group_legacy_response.py +40 -0
- mmisp/api_schemas/sightings/__init__.py +0 -0
- mmisp/api_schemas/sightings/create_sighting_body.py +49 -0
- mmisp/api_schemas/sightings/get_sighting_response.py +27 -0
- mmisp/api_schemas/standard_status_response.py +13 -0
- mmisp/api_schemas/tags/__init__.py +0 -0
- mmisp/api_schemas/tags/create_tag_body.py +15 -0
- mmisp/api_schemas/tags/delete_tag_response.py +10 -0
- mmisp/api_schemas/tags/get_tag_response.py +31 -0
- mmisp/api_schemas/tags/search_tags_response.py +26 -0
- mmisp/api_schemas/tags/update_tag_body.py +15 -0
- mmisp/api_schemas/taxonomies/__init__.py +0 -0
- mmisp/api_schemas/taxonomies/export_taxonomies_response.py +30 -0
- mmisp/api_schemas/taxonomies/get_taxonomy_by_id_response.py +30 -0
- mmisp/api_schemas/taxonomies/get_taxonomy_response.py +21 -0
- mmisp/api_schemas/taxonomies/get_taxonomy_tags_response.py +32 -0
- mmisp/api_schemas/user_settings/__init__.py +0 -0
- mmisp/api_schemas/user_settings/get_uid_user_setting_response.py +21 -0
- mmisp/api_schemas/user_settings/get_user_settings_response.py +13 -0
- mmisp/api_schemas/user_settings/search_user_setting_body.py +7 -0
- mmisp/api_schemas/user_settings/search_user_setting_response.py +11 -0
- mmisp/api_schemas/user_settings/set_user_setting_body.py +5 -0
- mmisp/api_schemas/user_settings/set_user_setting_response.py +13 -0
- mmisp/api_schemas/user_settings/view_user_setting_response.py +13 -0
- mmisp/api_schemas/users/__init__.py +0 -0
- mmisp/api_schemas/users/user.py +42 -0
- mmisp/api_schemas/users/users_view_me_response.py +12 -0
- mmisp/api_schemas/warninglists/__init__.py +0 -0
- mmisp/api_schemas/warninglists/check_value_warninglists_body.py +8 -0
- mmisp/api_schemas/warninglists/check_value_warninglists_response.py +14 -0
- mmisp/api_schemas/warninglists/create_warninglist_body.py +220 -0
- mmisp/api_schemas/warninglists/delete_warninglist_response.py +13 -0
- mmisp/api_schemas/warninglists/get_selected_all_warninglists_response.py +14 -0
- mmisp/api_schemas/warninglists/get_selected_warninglists_body.py +9 -0
- mmisp/api_schemas/warninglists/toggle_enable_warninglists_body.py +10 -0
- mmisp/api_schemas/warninglists/toggle_enable_warninglists_response.py +10 -0
- mmisp/api_schemas/warninglists/warninglist_response.py +42 -0
- mmisp/db/__init__.py +0 -0
- mmisp/db/config.py +17 -0
- mmisp/db/database.py +42 -0
- mmisp/db/models/__init__.py +0 -0
- mmisp/db/models/attribute.py +92 -0
- mmisp/db/models/auth_key.py +24 -0
- mmisp/db/models/event.py +62 -0
- mmisp/db/models/feed.py +32 -0
- mmisp/db/models/galaxy.py +22 -0
- mmisp/db/models/galaxy_cluster.py +52 -0
- mmisp/db/models/identity_provider.py +22 -0
- mmisp/db/models/noticelist.py +22 -0
- mmisp/db/models/object.py +39 -0
- mmisp/db/models/organisation.py +26 -0
- mmisp/db/models/role.py +42 -0
- mmisp/db/models/server.py +33 -0
- mmisp/db/models/sharing_group.py +43 -0
- mmisp/db/models/sighting.py +21 -0
- mmisp/db/models/tag.py +19 -0
- mmisp/db/models/taxonomy.py +41 -0
- mmisp/db/models/user.py +44 -0
- mmisp/db/models/user_setting.py +29 -0
- mmisp/db/models/warninglist.py +33 -0
- mmisp/db/print_changes.py +59 -0
- mmisp/lib/__init__.py +0 -0
- mmisp/lib/attributes.py +1386 -0
- mmisp_lib-0.1.0.dist-info/METADATA +77 -0
- mmisp_lib-0.1.0.dist-info/RECORD +161 -0
- mmisp_lib-0.1.0.dist-info/WHEEL +5 -0
- mmisp_lib-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
|
4
|
+
class SearchEventsBody(BaseModel):
|
5
|
+
returnFormat: str
|
6
|
+
page: int | None = None
|
7
|
+
limit: int | None = None
|
8
|
+
value: str | None = None
|
9
|
+
type: str | None = None
|
10
|
+
category: str | None = None
|
11
|
+
org: str | None = None
|
12
|
+
tags: list[str] | None = None
|
13
|
+
event_tags: list[str] | None = None
|
14
|
+
searchall: str | None = None
|
15
|
+
from_: str | None = None
|
16
|
+
to: str | None = None
|
17
|
+
last: int | None = None
|
18
|
+
eventid: str | None = None
|
19
|
+
withAttachments: bool | None = None
|
20
|
+
sharinggroup: list[str] | None = None
|
21
|
+
metadata: bool | None = None
|
22
|
+
uuid: str | None = None
|
23
|
+
publish_timestamp: str | None = None
|
24
|
+
timestamp: str | None = None
|
25
|
+
published: bool | None = None
|
26
|
+
enforceWarninglist: bool | None = None
|
27
|
+
sgReferenceOnly: bool | None = None
|
28
|
+
requested_attributes: list[str] | None = None
|
29
|
+
includeContext: bool | None = None
|
30
|
+
headerless: bool | None = None
|
31
|
+
includeWarninglistHits: bool | None = None
|
32
|
+
attackGalaxy: str | None = None
|
33
|
+
to_ids: bool | None = None
|
34
|
+
deleted: bool | None = None
|
35
|
+
excludeLocalTags: bool | None = None
|
36
|
+
date: str | None = None
|
37
|
+
includeSightingdb: bool | None = None
|
38
|
+
tag: str | None = None
|
39
|
+
object_relation: str | None = None
|
40
|
+
threat_level_id: str | None = None
|
41
|
+
|
42
|
+
class Config:
|
43
|
+
orm_mode = True
|
File without changes
|
@@ -0,0 +1,30 @@
|
|
1
|
+
from pydantic import BaseModel, Field
|
2
|
+
|
3
|
+
|
4
|
+
class FeedCreateBody(BaseModel):
|
5
|
+
name: str = Field(min_length=1)
|
6
|
+
provider: str = Field(min_length=1)
|
7
|
+
url: str = Field(min_length=1)
|
8
|
+
rules: str | None = None
|
9
|
+
enabled: bool | None = None
|
10
|
+
distribution: str | None = None
|
11
|
+
sharing_group_id: str | None = None
|
12
|
+
tag_id: str | None = None
|
13
|
+
default: bool | None = None
|
14
|
+
source_format: str | None = None
|
15
|
+
fixed_event: bool | None = None
|
16
|
+
delta_merge: bool | None = None
|
17
|
+
event_id: str | None = None
|
18
|
+
publish: bool | None = None
|
19
|
+
override_ids: bool | None = None
|
20
|
+
settings: str | None = None
|
21
|
+
input_source: str | None = None
|
22
|
+
delete_local_file: bool | None = None
|
23
|
+
lookup_visible: bool | None = None
|
24
|
+
headers: str | None = None
|
25
|
+
caching_enabled: bool | None = None
|
26
|
+
force_to_ids: bool | None = None
|
27
|
+
orgc_id: str | None = None
|
28
|
+
|
29
|
+
class Config:
|
30
|
+
orm_mode = True
|
@@ -0,0 +1,47 @@
|
|
1
|
+
from typing import Any, Dict, Optional
|
2
|
+
|
3
|
+
from pydantic import BaseModel, validator
|
4
|
+
|
5
|
+
|
6
|
+
class FeedAttributesResponse(BaseModel):
|
7
|
+
id: str
|
8
|
+
name: str
|
9
|
+
provider: str
|
10
|
+
url: str
|
11
|
+
rules: str | None = None
|
12
|
+
enabled: bool | None = None
|
13
|
+
distribution: str
|
14
|
+
sharing_group_id: str | None = None
|
15
|
+
tag_id: str
|
16
|
+
default: bool | None = None
|
17
|
+
source_format: str | None = None
|
18
|
+
fixed_event: bool
|
19
|
+
delta_merge: bool
|
20
|
+
event_id: str
|
21
|
+
publish: bool
|
22
|
+
override_ids: bool
|
23
|
+
settings: str | None = None
|
24
|
+
input_source: str
|
25
|
+
delete_local_file: bool | None = None
|
26
|
+
lookup_visible: bool | None = None
|
27
|
+
headers: str | None = None
|
28
|
+
caching_enabled: bool
|
29
|
+
force_to_ids: bool
|
30
|
+
orgc_id: str
|
31
|
+
|
32
|
+
@validator("sharing_group_id", always=True)
|
33
|
+
def check_sharing_group_id(cls, value: Any, values: Dict[str, Any]) -> Optional[int]: # noqa: ANN101
|
34
|
+
"""
|
35
|
+
If distribution equals 4, sharing_group_id will be shown.
|
36
|
+
"""
|
37
|
+
distribution = values.get("distribution", None)
|
38
|
+
if distribution == "4" and value is not None:
|
39
|
+
return value
|
40
|
+
return None
|
41
|
+
|
42
|
+
|
43
|
+
class FeedResponse(BaseModel):
|
44
|
+
Feed: FeedAttributesResponse
|
45
|
+
|
46
|
+
class Config:
|
47
|
+
orm_mode = True
|
@@ -0,0 +1,30 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
|
4
|
+
class FeedUpdateBody(BaseModel):
|
5
|
+
name: str | None = None
|
6
|
+
provider: str | None = None
|
7
|
+
url: str | None = None
|
8
|
+
rules: str | None = None
|
9
|
+
enabled: bool | None = None
|
10
|
+
distribution: str | None = None
|
11
|
+
sharing_group_id: str | None = None
|
12
|
+
tag_id: str | None = None
|
13
|
+
default: bool | None = None
|
14
|
+
source_format: str | None = None
|
15
|
+
fixed_event: bool | None = None
|
16
|
+
delta_merge: bool | None = None
|
17
|
+
event_id: str | None = None
|
18
|
+
publish: bool | None = None
|
19
|
+
override_ids: bool | None = None
|
20
|
+
settings: str | None = None
|
21
|
+
input_source: str | None = None
|
22
|
+
delete_local_file: bool | None = None
|
23
|
+
lookup_visible: bool | None = None
|
24
|
+
headers: str | None = None
|
25
|
+
caching_enabled: bool | None = None
|
26
|
+
force_to_ids: bool | None = None
|
27
|
+
orgc_id: str | None = None
|
28
|
+
|
29
|
+
class Config:
|
30
|
+
orm_mode = True
|
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
|
4
|
+
class ExportGalaxyAttributes(BaseModel):
|
5
|
+
default: bool
|
6
|
+
custom: bool | None = None
|
7
|
+
distribution: str
|
8
|
+
format: str | None = None
|
9
|
+
download: bool | None = None
|
10
|
+
|
11
|
+
|
12
|
+
class ExportGalaxyBody(BaseModel):
|
13
|
+
Galaxy: ExportGalaxyAttributes
|
14
|
+
|
15
|
+
class Config:
|
16
|
+
orm_mode = True
|
@@ -0,0 +1,44 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
from mmisp.api_schemas.events.add_edit_get_event_response import AddEditGetEventGalaxyClusterRelation
|
4
|
+
from mmisp.api_schemas.events.get_all_events_response import GetAllEventsGalaxyClusterGalaxy
|
5
|
+
from mmisp.api_schemas.organisations.organisation import Organisation
|
6
|
+
|
7
|
+
|
8
|
+
class ExportGalaxyGalaxyElement(BaseModel):
|
9
|
+
id: str | None = None
|
10
|
+
galaxy_cluster_id: str | None = None
|
11
|
+
key: str
|
12
|
+
value: str
|
13
|
+
|
14
|
+
|
15
|
+
class ExportGalaxyClusterResponse(BaseModel):
|
16
|
+
id: str
|
17
|
+
uuid: str
|
18
|
+
collection_uuid: str
|
19
|
+
type: str
|
20
|
+
value: str
|
21
|
+
tag_name: str
|
22
|
+
description: str
|
23
|
+
galaxy_id: str
|
24
|
+
source: str
|
25
|
+
authors: list[str]
|
26
|
+
version: str
|
27
|
+
distribution: str
|
28
|
+
sharing_group_id: str
|
29
|
+
org_id: str
|
30
|
+
orgc_id: str
|
31
|
+
default: bool
|
32
|
+
locked: bool
|
33
|
+
extends_uuid: str
|
34
|
+
extends_version: str
|
35
|
+
published: bool
|
36
|
+
deleted: bool
|
37
|
+
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
38
|
+
Galaxy: GetAllEventsGalaxyClusterGalaxy
|
39
|
+
GalaxyClusterRelation: list[AddEditGetEventGalaxyClusterRelation] = []
|
40
|
+
Org: Organisation
|
41
|
+
Orgc: Organisation
|
42
|
+
|
43
|
+
class Config:
|
44
|
+
orm_mode = True
|
@@ -0,0 +1,18 @@
|
|
1
|
+
from typing import List
|
2
|
+
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
|
6
|
+
class GalaxySchema(BaseModel):
|
7
|
+
id: str
|
8
|
+
uuid: str
|
9
|
+
name: str
|
10
|
+
type: str
|
11
|
+
description: str
|
12
|
+
version: str
|
13
|
+
icon: str
|
14
|
+
namespace: str
|
15
|
+
kill_chain_order: List[str]
|
16
|
+
|
17
|
+
class Config:
|
18
|
+
orm_mode = True
|
@@ -0,0 +1,22 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
|
4
|
+
class GetAllSearchGalaxiesAttributes(BaseModel):
|
5
|
+
id: str
|
6
|
+
uuid: str
|
7
|
+
name: str
|
8
|
+
type: str
|
9
|
+
description: str
|
10
|
+
version: str
|
11
|
+
icon: str
|
12
|
+
namespace: str
|
13
|
+
kill_chain_order: str | None = None
|
14
|
+
enabled: bool
|
15
|
+
local_only: bool
|
16
|
+
|
17
|
+
|
18
|
+
class GetAllSearchGalaxiesResponse(BaseModel):
|
19
|
+
Galaxy: GetAllSearchGalaxiesAttributes
|
20
|
+
|
21
|
+
class Config:
|
22
|
+
orm_mode = True
|
@@ -0,0 +1,37 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
from .export_galaxies_response import ExportGalaxyGalaxyElement
|
4
|
+
from .get_all_search_galaxies_response import GetAllSearchGalaxiesAttributes
|
5
|
+
|
6
|
+
|
7
|
+
class GetGalaxyClusterResponse(BaseModel):
|
8
|
+
id: str | None = None
|
9
|
+
uuid: str | None = None
|
10
|
+
collection_uuid: str
|
11
|
+
type: str
|
12
|
+
value: str
|
13
|
+
tag_name: str
|
14
|
+
description: str
|
15
|
+
galaxy_id: str
|
16
|
+
source: str
|
17
|
+
authors: list[str]
|
18
|
+
version: str
|
19
|
+
distribution: str
|
20
|
+
sharing_group_id: str
|
21
|
+
org_id: str
|
22
|
+
orgc_id: str
|
23
|
+
default: bool
|
24
|
+
locked: bool
|
25
|
+
extends_uuid: str
|
26
|
+
extends_version: str
|
27
|
+
published: bool
|
28
|
+
deleted: bool
|
29
|
+
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
30
|
+
|
31
|
+
|
32
|
+
class GetGalaxyResponse(BaseModel):
|
33
|
+
Galaxy: GetAllSearchGalaxiesAttributes
|
34
|
+
GalaxyCluster: list[GetGalaxyClusterResponse]
|
35
|
+
|
36
|
+
class Config:
|
37
|
+
orm_mode = True
|
@@ -0,0 +1,15 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
from .get_galaxy_response import GetGalaxyClusterResponse
|
4
|
+
|
5
|
+
|
6
|
+
class ImportGalaxyGalaxy(BaseModel):
|
7
|
+
uuid: str
|
8
|
+
|
9
|
+
|
10
|
+
class ImportGalaxyBody(BaseModel):
|
11
|
+
GalaxyCluster: GetGalaxyClusterResponse
|
12
|
+
Galaxy: ImportGalaxyGalaxy
|
13
|
+
|
14
|
+
class Config:
|
15
|
+
orm_mode = True
|
@@ -0,0 +1,22 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
|
4
|
+
class SearchGalaxiesbyValue(BaseModel):
|
5
|
+
value: str
|
6
|
+
|
7
|
+
|
8
|
+
class SearchGalaxiesBody(BaseModel):
|
9
|
+
id: str | None = None
|
10
|
+
uuid: str | None = None
|
11
|
+
name: str | None = None
|
12
|
+
type: str | None = None
|
13
|
+
description: str | None = None
|
14
|
+
version: str | None = None
|
15
|
+
icon: str | None = None
|
16
|
+
namespace: str | None = None
|
17
|
+
kill_chain_order: str | None = None
|
18
|
+
enabled: bool | None = None
|
19
|
+
local_only: bool | None = None
|
20
|
+
|
21
|
+
class Config:
|
22
|
+
orm_mode = True
|
File without changes
|
@@ -0,0 +1,38 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
|
6
|
+
class Data(BaseModel):
|
7
|
+
scope: str | list[str] | None
|
8
|
+
field: str | list[str] | None
|
9
|
+
value: str | list[str] | None
|
10
|
+
tags: str | list[str] | None
|
11
|
+
message: str | Any
|
12
|
+
|
13
|
+
|
14
|
+
class NoticelistEntryResponse(BaseModel):
|
15
|
+
id: str
|
16
|
+
noticelist_id: str
|
17
|
+
data: Data
|
18
|
+
|
19
|
+
|
20
|
+
class NoticelistAttributes(BaseModel):
|
21
|
+
id: str
|
22
|
+
name: str
|
23
|
+
expanded_name: str
|
24
|
+
ref: list[str]
|
25
|
+
geographical_area: list[str]
|
26
|
+
version: str
|
27
|
+
enabled: bool
|
28
|
+
|
29
|
+
|
30
|
+
class NoticelistAttributesResponse(NoticelistAttributes):
|
31
|
+
NoticelistEntry: list[NoticelistEntryResponse]
|
32
|
+
|
33
|
+
|
34
|
+
class NoticelistResponse(BaseModel):
|
35
|
+
Noticelist: NoticelistAttributesResponse
|
36
|
+
|
37
|
+
class Config:
|
38
|
+
orm_mode = True
|
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
from pydantic import BaseModel, Field
|
2
|
+
|
3
|
+
from mmisp.api_schemas.attributes.add_attribute_body import AddAttributeBody
|
4
|
+
|
5
|
+
|
6
|
+
class ObjectCreateBody(BaseModel):
|
7
|
+
name: str = Field(min_length=1)
|
8
|
+
meta_category: str | None = None
|
9
|
+
description: str | None = None
|
10
|
+
distribution: str | None = None
|
11
|
+
sharing_group_id: str = Field(min_length=1)
|
12
|
+
comment: str = Field(min_length=1)
|
13
|
+
deleted: bool | None = None
|
14
|
+
first_seen: str | None = None
|
15
|
+
last_seen: str | None = None
|
16
|
+
Attribute: list[AddAttributeBody] | None = None
|
17
|
+
|
18
|
+
class Config:
|
19
|
+
orm_mode = True
|
@@ -0,0 +1,50 @@
|
|
1
|
+
from typing import Any, Dict, Optional
|
2
|
+
|
3
|
+
from pydantic import BaseModel, validator
|
4
|
+
|
5
|
+
from mmisp.api_schemas.attributes.get_all_attributes_response import GetAllAttributesResponse
|
6
|
+
from mmisp.api_schemas.events.get_event_response import ObjectEventResponse
|
7
|
+
|
8
|
+
|
9
|
+
class ObjectWithAttributesResponse(BaseModel):
|
10
|
+
id: str
|
11
|
+
uuid: str
|
12
|
+
name: str
|
13
|
+
meta_category: str | None = None
|
14
|
+
description: str | None = None
|
15
|
+
template_uuid: str | None = None
|
16
|
+
template_version: str | None = None
|
17
|
+
event_id: str | None = None
|
18
|
+
timestamp: str | None = None
|
19
|
+
distribution: str | None = None
|
20
|
+
sharing_group_id: str | None = None
|
21
|
+
comment: str | None = None
|
22
|
+
deleted: bool | None = None
|
23
|
+
first_seen: str | None = None
|
24
|
+
last_seen: str | None = None
|
25
|
+
Attribute: list[GetAllAttributesResponse] | None = None
|
26
|
+
Event: ObjectEventResponse | None = None
|
27
|
+
|
28
|
+
@validator("sharing_group_id", always=True)
|
29
|
+
def check_sharing_group_id(cls, value: Any, values: Dict[str, Any]) -> Optional[int]: # noqa: ANN101
|
30
|
+
"""
|
31
|
+
If distribution equals 4, sharing_group_id will be shown.
|
32
|
+
"""
|
33
|
+
distribution = values.get("distribution", None)
|
34
|
+
if distribution == "4" and value is not None:
|
35
|
+
return value
|
36
|
+
return None
|
37
|
+
|
38
|
+
|
39
|
+
class ObjectResponse(BaseModel):
|
40
|
+
Object: ObjectWithAttributesResponse
|
41
|
+
|
42
|
+
class Config:
|
43
|
+
orm_mode = True
|
44
|
+
|
45
|
+
|
46
|
+
class ObjectSearchResponse(BaseModel):
|
47
|
+
response: list[ObjectResponse]
|
48
|
+
|
49
|
+
class Config:
|
50
|
+
orm_mode = True
|
@@ -0,0 +1,49 @@
|
|
1
|
+
from typing import Any
|
2
|
+
|
3
|
+
from pydantic import BaseModel, validator
|
4
|
+
|
5
|
+
|
6
|
+
class ObjectSearchBody(BaseModel):
|
7
|
+
object_name: str | None = None
|
8
|
+
object_template_uuid: str | None = None
|
9
|
+
object_template_version: str | None = None
|
10
|
+
event_id: str | None = None
|
11
|
+
category: str | None = None
|
12
|
+
comment: str | None = None
|
13
|
+
first_seen: str | None = None
|
14
|
+
last_seen: str | None = None
|
15
|
+
quick_filter: str | None = None
|
16
|
+
timestamp: str | None = None
|
17
|
+
event_info: str | None = None
|
18
|
+
from_: str | None = None # 'from' is a reserved word in Python, so an underscore is added
|
19
|
+
to: str | None = None
|
20
|
+
date: str | None = None
|
21
|
+
last: str | None = None
|
22
|
+
event_timestamp: str | None = None
|
23
|
+
org_id: str | None = None
|
24
|
+
uuid: str | None = None
|
25
|
+
value1: str | None = None
|
26
|
+
value2: str | None = None
|
27
|
+
type: str | None = None
|
28
|
+
object_relation: str | None = None
|
29
|
+
attribute_timestamp: str | None = None
|
30
|
+
to_ids: bool | None = None
|
31
|
+
published: bool | None = None
|
32
|
+
deleted: bool | None = None
|
33
|
+
return_format: str | None = "json"
|
34
|
+
limit: str | None = "25"
|
35
|
+
|
36
|
+
@validator("limit")
|
37
|
+
def check_limit(cls, value: Any) -> str: # noqa: ANN101
|
38
|
+
if value:
|
39
|
+
try:
|
40
|
+
limit_int = int(value)
|
41
|
+
except ValueError:
|
42
|
+
raise ValueError("'limit' must be a valid integer")
|
43
|
+
|
44
|
+
if not 1 <= limit_int <= 500:
|
45
|
+
raise ValueError("'limit' must be between 1 and 500")
|
46
|
+
return value
|
47
|
+
|
48
|
+
class Config:
|
49
|
+
orm_mode = True
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
|
6
|
+
class Organisation(BaseModel):
|
7
|
+
id: str
|
8
|
+
name: str
|
9
|
+
date_created: datetime
|
10
|
+
date_modified: datetime
|
11
|
+
description: str | None = None
|
12
|
+
type: str
|
13
|
+
nationality: str | None = None
|
14
|
+
sector: str | None = None
|
15
|
+
created_by: str
|
16
|
+
uuid: str
|
17
|
+
contacts: str | None = None
|
18
|
+
local: bool
|
19
|
+
"""organisation gains access to the local instance, otherwise treated as external"""
|
20
|
+
restricted_to_domain: str | None = None
|
21
|
+
landingpage: str | None = None
|
22
|
+
|
23
|
+
class Config:
|
24
|
+
orm_mode = True
|
File without changes
|