mmisp-lib 0.5.0__tar.gz → 0.6.1__tar.gz
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_lib-0.5.0 → mmisp_lib-0.6.1}/PKG-INFO +1 -1
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/pyproject.toml +1 -1
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/galaxies.py +2 -73
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/galaxy_clusters.py +25 -9
- mmisp_lib-0.6.1/src/mmisp/api_schemas/galaxy_common.py +15 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/organisations.py +16 -3
- mmisp_lib-0.6.1/src/mmisp/lib/fallbacks.py +18 -0
- mmisp_lib-0.6.1/src/mmisp/lib/galaxies.py +17 -0
- mmisp_lib-0.6.1/src/mmisp/lib/serialisation_helper.py +9 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/fixtures.py +122 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp_lib.egg-info/PKG-INFO +1 -1
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp_lib.egg-info/SOURCES.txt +4 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/LICENSE +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/README.md +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/setup.cfg +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/attributes.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/auth_keys.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/authentication.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/common.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/events.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/feeds.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/jobs.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/logs.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/noticelists.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/objects.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/responses/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/responses/check_graph_response.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/responses/standard_status_response.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/roles.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/servers.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/sharing_groups.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/sightings.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/statistics.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/tags.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/taxonomies.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/user_settings.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/users.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/warninglists.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/workflows.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/commandline_tool/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/commandline_tool/main.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/commandline_tool/organisation.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/commandline_tool/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/commandline_tool/setup.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/commandline_tool/user.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/additional_properties.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/all_models.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/config.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/database.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/mixins.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/admin_setting.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/attribute.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/auth_key.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/event.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/feed.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/galaxy.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/galaxy_cluster.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/identity_provider.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/log.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/noticelist.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/object.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/organisation.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/role.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/server.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/sharing_group.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/sighting.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/tag.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/taxonomy.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/user.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/user_setting.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/warninglist.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/workflow.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/models/workflow_blueprint.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/mypy.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/print_changes.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/db/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/actions.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/attribute_search_filter.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/attributes.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/logging.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/permissions.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/lib/uuid.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/plugins/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/compatibility_helpers.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/feed_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/attribute_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/auth_key_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/event_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/galaxy_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/identity_provider_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/noticelist_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/organisation_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/role_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/server_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/sharing_group_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/tag_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/taxonomy_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/user_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/user_setting_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/warninglist_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/workflow_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/object_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/sighting_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/tag_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/taxonomies_generator.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/util/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/util/crypto.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/util/models.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/util/partial.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/util/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/util/uuid.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/__init__.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/execution.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/fastapi.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/graph.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/input.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/legacy.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/misp_core_format.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/modules.py +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/workflows/py.typed +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp_lib.egg-info/dependency_links.txt +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp_lib.egg-info/requires.txt +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp_lib.egg-info/top_level.txt +0 -0
- {mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/tests/test_commandline_tool.py +0 -0
@@ -2,8 +2,8 @@ from typing import List
|
|
2
2
|
|
3
3
|
from pydantic import BaseModel
|
4
4
|
|
5
|
-
|
6
|
-
from mmisp.api_schemas.
|
5
|
+
from mmisp.api_schemas.galaxy_clusters import GetGalaxyClusterResponse
|
6
|
+
from mmisp.api_schemas.galaxy_common import GetAllSearchGalaxiesAttributes
|
7
7
|
|
8
8
|
|
9
9
|
class SearchGalaxiesBody(BaseModel):
|
@@ -38,31 +38,6 @@ class ExportGalaxyGalaxyElement(BaseModel):
|
|
38
38
|
value: str
|
39
39
|
|
40
40
|
|
41
|
-
class GetGalaxyClusterResponse(BaseModel):
|
42
|
-
id: str | None = None
|
43
|
-
uuid: str | None = None
|
44
|
-
collection_uuid: str
|
45
|
-
type: str
|
46
|
-
value: str
|
47
|
-
tag_name: str
|
48
|
-
description: str
|
49
|
-
galaxy_id: str
|
50
|
-
source: str
|
51
|
-
authors: list[str]
|
52
|
-
version: str
|
53
|
-
distribution: str
|
54
|
-
sharing_group_id: str
|
55
|
-
org_id: str
|
56
|
-
orgc_id: str
|
57
|
-
default: bool
|
58
|
-
locked: bool
|
59
|
-
extends_uuid: str
|
60
|
-
extends_version: str
|
61
|
-
published: bool
|
62
|
-
deleted: bool
|
63
|
-
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
64
|
-
|
65
|
-
|
66
41
|
class ImportGalaxyBody(BaseModel):
|
67
42
|
GalaxyCluster: GetGalaxyClusterResponse
|
68
43
|
Galaxy: ImportGalaxyGalaxy
|
@@ -71,20 +46,6 @@ class ImportGalaxyBody(BaseModel):
|
|
71
46
|
orm_mode = True
|
72
47
|
|
73
48
|
|
74
|
-
class GetAllSearchGalaxiesAttributes(BaseModel):
|
75
|
-
id: str
|
76
|
-
uuid: str
|
77
|
-
name: str
|
78
|
-
type: str
|
79
|
-
description: str
|
80
|
-
version: str
|
81
|
-
icon: str
|
82
|
-
namespace: str
|
83
|
-
kill_chain_order: str | None = None
|
84
|
-
enabled: bool
|
85
|
-
local_only: bool
|
86
|
-
|
87
|
-
|
88
49
|
class GetAllSearchGalaxiesResponse(BaseModel):
|
89
50
|
Galaxy: GetAllSearchGalaxiesAttributes
|
90
51
|
|
@@ -115,38 +76,6 @@ class GalaxySchema(BaseModel):
|
|
115
76
|
orm_mode = True
|
116
77
|
|
117
78
|
|
118
|
-
class ExportGalaxyClusterResponse(BaseModel):
|
119
|
-
id: str
|
120
|
-
uuid: str
|
121
|
-
collection_uuid: str
|
122
|
-
type: str
|
123
|
-
value: str
|
124
|
-
tag_name: str
|
125
|
-
description: str
|
126
|
-
galaxy_id: str
|
127
|
-
source: str
|
128
|
-
authors: list[str]
|
129
|
-
version: str
|
130
|
-
distribution: str
|
131
|
-
sharing_group_id: str
|
132
|
-
org_id: str
|
133
|
-
orgc_id: str
|
134
|
-
default: bool
|
135
|
-
locked: bool
|
136
|
-
extends_uuid: str
|
137
|
-
extends_version: str
|
138
|
-
published: bool
|
139
|
-
deleted: bool
|
140
|
-
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
141
|
-
Galaxy: GetAllEventsGalaxyClusterGalaxy
|
142
|
-
GalaxyClusterRelation: list[AddEditGetEventGalaxyClusterRelation] = []
|
143
|
-
Org: mmisp.api_schemas.organisations.Organisation
|
144
|
-
Orgc: mmisp.api_schemas.organisations.Organisation
|
145
|
-
|
146
|
-
class Config:
|
147
|
-
orm_mode = True
|
148
|
-
|
149
|
-
|
150
79
|
class ExportGalaxyAttributes(BaseModel):
|
151
80
|
default: bool
|
152
81
|
custom: bool | None = None
|
@@ -1,10 +1,17 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
|
1
3
|
from pydantic import BaseModel
|
2
4
|
|
3
|
-
from mmisp.api_schemas.events
|
4
|
-
from mmisp.api_schemas.
|
5
|
-
from mmisp.api_schemas.
|
6
|
-
|
7
|
-
|
5
|
+
from mmisp.api_schemas.events import AddEditGetEventGalaxyClusterRelation, GetAllEventsGalaxyClusterGalaxy
|
6
|
+
from mmisp.api_schemas.galaxy_common import GetAllSearchGalaxiesAttributes
|
7
|
+
from mmisp.api_schemas.organisations import GetOrganisationResponse, Organisation
|
8
|
+
|
9
|
+
|
10
|
+
class ExportGalaxyGalaxyElement(BaseModel):
|
11
|
+
id: str | None = None
|
12
|
+
galaxy_cluster_id: str | None = None
|
13
|
+
key: str
|
14
|
+
value: str
|
8
15
|
|
9
16
|
|
10
17
|
class GetGalaxyClusterResponse(BaseModel):
|
@@ -25,14 +32,23 @@ class GetGalaxyClusterResponse(BaseModel):
|
|
25
32
|
orgc_id: str
|
26
33
|
default: bool
|
27
34
|
locked: bool
|
28
|
-
extends_uuid: str
|
35
|
+
extends_uuid: str | None = None
|
29
36
|
extends_version: str
|
30
37
|
published: bool
|
31
38
|
deleted: bool
|
32
|
-
Galaxy: GetAllSearchGalaxiesAttributes
|
39
|
+
Galaxy: GetAllSearchGalaxiesAttributes | None = None
|
33
40
|
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
34
|
-
|
35
|
-
|
41
|
+
GalaxyClusterRelation: list = []
|
42
|
+
RelationshipInbound: list = []
|
43
|
+
Org: GetOrganisationResponse | None = None
|
44
|
+
Orgc: GetOrganisationResponse | None = None
|
45
|
+
|
46
|
+
|
47
|
+
class GalaxyClusterResponse(BaseModel):
|
48
|
+
GalaxyCluster: GetGalaxyClusterResponse
|
49
|
+
|
50
|
+
class Config:
|
51
|
+
json_encoders = {datetime: lambda v: v.strftime("%Y-%m-%d %H:%M:%S")}
|
36
52
|
|
37
53
|
|
38
54
|
class ExportGalaxyClusterResponse(BaseModel):
|
@@ -0,0 +1,15 @@
|
|
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
|
@@ -1,7 +1,10 @@
|
|
1
1
|
from datetime import datetime
|
2
|
+
from typing import Self
|
2
3
|
|
3
4
|
from pydantic import BaseModel
|
4
5
|
|
6
|
+
from mmisp.lib.serialisation_helper import timestamp_or_empty_string
|
7
|
+
|
5
8
|
|
6
9
|
class BaseOrganisation(BaseModel):
|
7
10
|
id: str | None = None
|
@@ -34,15 +37,25 @@ class GetOrganisationResponse(BaseModel):
|
|
34
37
|
sector: str | None = None
|
35
38
|
type: str | None = None
|
36
39
|
uuid: str | None = None
|
37
|
-
|
38
|
-
|
40
|
+
# the fallback GENERIC_MISP_ORGANISATION doesn't have this property
|
41
|
+
# str is needed because its returned as string
|
42
|
+
date_created: datetime | None | str = None
|
43
|
+
date_modified: datetime | None | str = None
|
39
44
|
description: str | None = None
|
40
45
|
created_by: str
|
41
46
|
contacts: str | None = None
|
42
47
|
local: bool
|
43
|
-
restricted_to_domain: str | None = None
|
48
|
+
restricted_to_domain: str | list | None = None
|
44
49
|
landingpage: str | None = None
|
45
50
|
|
51
|
+
def dict(self: Self, *args, **kwargs) -> dict:
|
52
|
+
d = super().dict(*args, **kwargs)
|
53
|
+
|
54
|
+
d["date_created"] = timestamp_or_empty_string(d["date_created"])
|
55
|
+
d["date_modified"] = timestamp_or_empty_string(d["date_modified"])
|
56
|
+
|
57
|
+
return d
|
58
|
+
|
46
59
|
|
47
60
|
class GetAllOrganisationsOrganisation(BaseModel):
|
48
61
|
id: str
|
@@ -0,0 +1,18 @@
|
|
1
|
+
from mmisp.db.models.organisation import Organisation
|
2
|
+
|
3
|
+
GENERIC_MISP_ORGANISATION = Organisation(
|
4
|
+
id="0",
|
5
|
+
name="MISP",
|
6
|
+
date_created=None,
|
7
|
+
date_modified=None,
|
8
|
+
description="Automatically generated MISP organisation",
|
9
|
+
type="",
|
10
|
+
nationality="Not specified",
|
11
|
+
sector="",
|
12
|
+
created_by="0",
|
13
|
+
uuid="0",
|
14
|
+
contacts="",
|
15
|
+
local=True,
|
16
|
+
restricted_to_domain=[],
|
17
|
+
landingpage=None,
|
18
|
+
)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import json
|
2
|
+
|
3
|
+
|
4
|
+
def json_or_original_string(s: str) -> str | dict | list:
|
5
|
+
try:
|
6
|
+
return json.loads(s)
|
7
|
+
except json.decoder.JSONDecodeError:
|
8
|
+
return s
|
9
|
+
|
10
|
+
|
11
|
+
def parse_galaxy_authors(str_authors: str) -> list[str]:
|
12
|
+
parsed_author = json_or_original_string(str_authors)
|
13
|
+
if isinstance(parsed_author, str):
|
14
|
+
parsed_author = [parsed_author] # force to be a list
|
15
|
+
assert isinstance(parsed_author, list)
|
16
|
+
|
17
|
+
return parsed_author
|
@@ -469,6 +469,16 @@ def galaxy_cluster_collection_uuid():
|
|
469
469
|
return uuid()
|
470
470
|
|
471
471
|
|
472
|
+
@pytest.fixture
|
473
|
+
def galaxy_default_cluster_one_uuid():
|
474
|
+
return uuid()
|
475
|
+
|
476
|
+
|
477
|
+
@pytest.fixture
|
478
|
+
def galaxy_default_cluster_two_uuid():
|
479
|
+
return uuid()
|
480
|
+
|
481
|
+
|
472
482
|
@pytest.fixture
|
473
483
|
def galaxy_cluster_one_uuid():
|
474
484
|
return uuid()
|
@@ -479,6 +489,118 @@ def galaxy_cluster_two_uuid():
|
|
479
489
|
return uuid()
|
480
490
|
|
481
491
|
|
492
|
+
@pytest_asyncio.fixture
|
493
|
+
async def test_default_galaxy(db, galaxy_default_cluster_one_uuid, galaxy_default_cluster_two_uuid):
|
494
|
+
galaxy = Galaxy(
|
495
|
+
namespace="misp",
|
496
|
+
name="test galaxy",
|
497
|
+
type="test galaxy type",
|
498
|
+
description="test",
|
499
|
+
version="1",
|
500
|
+
kill_chain_order=None,
|
501
|
+
uuid=uuid(),
|
502
|
+
enabled=True,
|
503
|
+
local_only=False,
|
504
|
+
)
|
505
|
+
|
506
|
+
db.add(galaxy)
|
507
|
+
await db.commit()
|
508
|
+
await db.refresh(galaxy)
|
509
|
+
|
510
|
+
galaxy_cluster = GalaxyCluster(
|
511
|
+
uuid=galaxy_default_cluster_one_uuid,
|
512
|
+
collection_uuid="",
|
513
|
+
type="test galaxy type",
|
514
|
+
value="test",
|
515
|
+
tag_name=galaxy_tag_name_from_uuid(galaxy_default_cluster_one_uuid),
|
516
|
+
description="test",
|
517
|
+
galaxy_id=galaxy.id,
|
518
|
+
source="me",
|
519
|
+
authors='["Konstantin Zangerle", "Test Writer"]',
|
520
|
+
version=1,
|
521
|
+
distribution=3,
|
522
|
+
sharing_group_id=None,
|
523
|
+
org_id=0,
|
524
|
+
orgc_id=0,
|
525
|
+
default=0,
|
526
|
+
locked=0,
|
527
|
+
extends_uuid=None,
|
528
|
+
extends_version=None,
|
529
|
+
published=True,
|
530
|
+
deleted=False,
|
531
|
+
)
|
532
|
+
galaxy_cluster2 = GalaxyCluster(
|
533
|
+
uuid=galaxy_default_cluster_two_uuid,
|
534
|
+
collection_uuid="",
|
535
|
+
type="test galaxy type",
|
536
|
+
value="test",
|
537
|
+
tag_name=galaxy_tag_name_from_uuid(galaxy_default_cluster_two_uuid),
|
538
|
+
description="test",
|
539
|
+
galaxy_id=galaxy.id,
|
540
|
+
source="me",
|
541
|
+
authors='["Konstantin Zangerle", "Test Writer"]',
|
542
|
+
version=1,
|
543
|
+
distribution=3,
|
544
|
+
sharing_group_id=None,
|
545
|
+
org_id=0,
|
546
|
+
orgc_id=0,
|
547
|
+
default=0,
|
548
|
+
locked=0,
|
549
|
+
extends_uuid=None,
|
550
|
+
extends_version=None,
|
551
|
+
published=True,
|
552
|
+
deleted=False,
|
553
|
+
)
|
554
|
+
|
555
|
+
db.add(galaxy_cluster)
|
556
|
+
db.add(galaxy_cluster2)
|
557
|
+
|
558
|
+
await db.commit()
|
559
|
+
await db.refresh(galaxy_cluster)
|
560
|
+
await db.refresh(galaxy_cluster2)
|
561
|
+
|
562
|
+
galaxy_element = GalaxyElement(
|
563
|
+
galaxy_cluster_id=galaxy_cluster.id, key="refs", value="http://test-one-one.example.com"
|
564
|
+
)
|
565
|
+
galaxy_element2 = GalaxyElement(
|
566
|
+
galaxy_cluster_id=galaxy_cluster.id, key="refs", value="http://test-one-two.example.com"
|
567
|
+
)
|
568
|
+
|
569
|
+
galaxy_element21 = GalaxyElement(
|
570
|
+
galaxy_cluster_id=galaxy_cluster2.id, key="refs", value="http://test-two-one.example.com"
|
571
|
+
)
|
572
|
+
galaxy_element22 = GalaxyElement(
|
573
|
+
galaxy_cluster_id=galaxy_cluster2.id, key="refs", value="http://test-two-two.example.com"
|
574
|
+
)
|
575
|
+
|
576
|
+
db.add(galaxy_element)
|
577
|
+
db.add(galaxy_element2)
|
578
|
+
|
579
|
+
db.add(galaxy_element21)
|
580
|
+
db.add(galaxy_element22)
|
581
|
+
|
582
|
+
await db.commit()
|
583
|
+
|
584
|
+
yield {
|
585
|
+
"galaxy": galaxy,
|
586
|
+
"galaxy_cluster": galaxy_cluster,
|
587
|
+
"galaxy_cluster2": galaxy_cluster2,
|
588
|
+
"galaxy_element": galaxy_element,
|
589
|
+
"galaxy_element2": galaxy_element2,
|
590
|
+
"galaxy_element21": galaxy_element21,
|
591
|
+
"galaxy_element22": galaxy_element22,
|
592
|
+
}
|
593
|
+
|
594
|
+
await db.delete(galaxy_element22)
|
595
|
+
await db.delete(galaxy_element21)
|
596
|
+
await db.delete(galaxy_element2)
|
597
|
+
await db.delete(galaxy_element)
|
598
|
+
await db.delete(galaxy_cluster2)
|
599
|
+
await db.delete(galaxy_cluster)
|
600
|
+
await db.delete(galaxy)
|
601
|
+
await db.commit()
|
602
|
+
|
603
|
+
|
482
604
|
@pytest_asyncio.fixture
|
483
605
|
async def test_galaxy(db, instance_owner_org, galaxy_cluster_one_uuid, galaxy_cluster_two_uuid):
|
484
606
|
galaxy = Galaxy(
|
@@ -10,6 +10,7 @@ src/mmisp/api_schemas/events.py
|
|
10
10
|
src/mmisp/api_schemas/feeds.py
|
11
11
|
src/mmisp/api_schemas/galaxies.py
|
12
12
|
src/mmisp/api_schemas/galaxy_clusters.py
|
13
|
+
src/mmisp/api_schemas/galaxy_common.py
|
13
14
|
src/mmisp/api_schemas/jobs.py
|
14
15
|
src/mmisp/api_schemas/logs.py
|
15
16
|
src/mmisp/api_schemas/noticelists.py
|
@@ -73,9 +74,12 @@ src/mmisp/lib/__init__.py
|
|
73
74
|
src/mmisp/lib/actions.py
|
74
75
|
src/mmisp/lib/attribute_search_filter.py
|
75
76
|
src/mmisp/lib/attributes.py
|
77
|
+
src/mmisp/lib/fallbacks.py
|
78
|
+
src/mmisp/lib/galaxies.py
|
76
79
|
src/mmisp/lib/logging.py
|
77
80
|
src/mmisp/lib/permissions.py
|
78
81
|
src/mmisp/lib/py.typed
|
82
|
+
src/mmisp/lib/serialisation_helper.py
|
79
83
|
src/mmisp/lib/uuid.py
|
80
84
|
src/mmisp/plugins/py.typed
|
81
85
|
src/mmisp/tests/__init__.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/api_schemas/responses/standard_status_response.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/event_generator.py
RENAMED
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/galaxy_generator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/role_generator.py
RENAMED
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/server_generator.py
RENAMED
File without changes
|
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/tag_generator.py
RENAMED
File without changes
|
File without changes
|
{mmisp_lib-0.5.0 → mmisp_lib-0.6.1}/src/mmisp/tests/generators/model_generators/user_generator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|