mmisp-lib 0.6.0__tar.gz → 0.6.2__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.6.0 → mmisp_lib-0.6.2}/PKG-INFO +1 -1
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/pyproject.toml +1 -1
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/galaxy_clusters.py +21 -2
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/organisations.py +16 -3
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/galaxy_cluster.py +3 -3
- mmisp_lib-0.6.2/src/mmisp/lib/distribution.py +8 -0
- mmisp_lib-0.6.2/src/mmisp/lib/fallbacks.py +18 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/galaxies.py +4 -0
- mmisp_lib-0.6.2/src/mmisp/lib/serialisation_helper.py +9 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/fixtures.py +125 -6
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp_lib.egg-info/PKG-INFO +1 -1
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp_lib.egg-info/SOURCES.txt +3 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/LICENSE +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/README.md +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/setup.cfg +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/attributes.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/auth_keys.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/authentication.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/common.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/events.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/feeds.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/galaxies.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/galaxy_common.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/jobs.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/logs.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/noticelists.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/objects.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/responses/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/responses/check_graph_response.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/responses/standard_status_response.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/roles.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/servers.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/sharing_groups.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/sightings.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/statistics.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/tags.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/taxonomies.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/user_settings.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/users.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/warninglists.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/api_schemas/workflows.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/commandline_tool/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/commandline_tool/main.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/commandline_tool/organisation.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/commandline_tool/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/commandline_tool/setup.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/commandline_tool/user.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/additional_properties.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/all_models.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/config.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/database.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/mixins.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/admin_setting.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/attribute.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/auth_key.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/event.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/feed.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/galaxy.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/identity_provider.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/log.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/noticelist.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/object.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/organisation.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/role.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/server.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/sharing_group.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/sighting.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/tag.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/taxonomy.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/user.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/user_setting.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/warninglist.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/workflow.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/models/workflow_blueprint.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/mypy.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/print_changes.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/db/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/actions.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/attribute_search_filter.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/attributes.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/logging.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/permissions.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/lib/uuid.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/plugins/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/compatibility_helpers.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/feed_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/attribute_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/auth_key_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/event_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/galaxy_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/identity_provider_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/noticelist_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/organisation_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/role_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/server_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/sharing_group_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/tag_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/taxonomy_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/user_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/user_setting_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/warninglist_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/workflow_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/object_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/sighting_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/tag_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/taxonomies_generator.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/util/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/util/crypto.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/util/models.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/util/partial.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/util/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/util/uuid.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/__init__.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/execution.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/fastapi.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/graph.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/input.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/legacy.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/misp_core_format.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/modules.py +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/workflows/py.typed +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp_lib.egg-info/dependency_links.txt +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp_lib.egg-info/requires.txt +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp_lib.egg-info/top_level.txt +0 -0
- {mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/tests/test_commandline_tool.py +0 -0
@@ -5,6 +5,7 @@ from pydantic import BaseModel
|
|
5
5
|
from mmisp.api_schemas.events import AddEditGetEventGalaxyClusterRelation, GetAllEventsGalaxyClusterGalaxy
|
6
6
|
from mmisp.api_schemas.galaxy_common import GetAllSearchGalaxiesAttributes
|
7
7
|
from mmisp.api_schemas.organisations import GetOrganisationResponse, Organisation
|
8
|
+
from mmisp.lib.distribution import DistributionLevels
|
8
9
|
|
9
10
|
|
10
11
|
class ExportGalaxyGalaxyElement(BaseModel):
|
@@ -27,13 +28,13 @@ class GetGalaxyClusterResponse(BaseModel):
|
|
27
28
|
authors: list[str]
|
28
29
|
version: str
|
29
30
|
distribution: str
|
30
|
-
sharing_group_id: str
|
31
|
+
sharing_group_id: str | None
|
31
32
|
org_id: str
|
32
33
|
orgc_id: str
|
33
34
|
default: bool
|
34
35
|
locked: bool
|
35
36
|
extends_uuid: str | None = None
|
36
|
-
extends_version: str
|
37
|
+
extends_version: str | None
|
37
38
|
published: bool
|
38
39
|
deleted: bool
|
39
40
|
Galaxy: GetAllSearchGalaxiesAttributes | None = None
|
@@ -78,3 +79,21 @@ class ExportGalaxyClusterResponse(BaseModel):
|
|
78
79
|
GalaxyClusterRelation: list[AddEditGetEventGalaxyClusterRelation] = []
|
79
80
|
Org: Organisation
|
80
81
|
Orgc: Organisation
|
82
|
+
|
83
|
+
|
84
|
+
class AddGalaxyElement(BaseModel):
|
85
|
+
key: str
|
86
|
+
value: str
|
87
|
+
|
88
|
+
|
89
|
+
class AddGalaxyClusterRequest(BaseModel):
|
90
|
+
value: str
|
91
|
+
description: str
|
92
|
+
source: str
|
93
|
+
authors: list[str]
|
94
|
+
distribution: DistributionLevels
|
95
|
+
GalaxyElement: list[AddGalaxyElement]
|
96
|
+
|
97
|
+
|
98
|
+
class AddGalaxyClusterResponse(BaseModel):
|
99
|
+
pass
|
@@ -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
|
@@ -13,7 +13,7 @@ class GalaxyCluster(Base):
|
|
13
13
|
|
14
14
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, nullable=False)
|
15
15
|
uuid: Mapped[str] = mapped_column(String(255), unique=True, default=uuid, index=True)
|
16
|
-
collection_uuid: Mapped[str] = mapped_column(String(255), nullable=False, index=True, default="
|
16
|
+
collection_uuid: Mapped[str] = mapped_column(String(255), nullable=False, index=True, default="")
|
17
17
|
type: Mapped[str] = mapped_column(String(255), nullable=False, index=True)
|
18
18
|
value: Mapped[str] = mapped_column(Text, nullable=False)
|
19
19
|
tag_name: Mapped[str] = mapped_column(String(255), nullable=False, default="", index=True)
|
@@ -25,13 +25,13 @@ class GalaxyCluster(Base):
|
|
25
25
|
authors: Mapped[str] = mapped_column(Text, nullable=False)
|
26
26
|
version: Mapped[int] = mapped_column(Integer, default=0, index=True)
|
27
27
|
distribution: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
|
28
|
-
sharing_group_id: Mapped[int] = mapped_column(Integer, index=True, default=
|
28
|
+
sharing_group_id: Mapped[int] = mapped_column(Integer, index=True, nullable=True, default=None)
|
29
29
|
org_id: Mapped[int] = mapped_column(Integer, nullable=False, index=True, default=0)
|
30
30
|
orgc_id: Mapped[int] = mapped_column(Integer, nullable=False, index=True, default=0)
|
31
31
|
default: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False, index=True)
|
32
32
|
locked: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
33
33
|
extends_uuid: Mapped[str] = mapped_column(String(40), index=True)
|
34
|
-
extends_version: Mapped[int] = mapped_column(Integer,
|
34
|
+
extends_version: Mapped[int] = mapped_column(Integer, index=True, nullable=True, default=None)
|
35
35
|
published: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
36
36
|
deleted: Mapped[bool] = mapped_column(Boolean, nullable=False, default=False)
|
37
37
|
|
@@ -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
|
+
)
|
@@ -15,3 +15,7 @@ def parse_galaxy_authors(str_authors: str) -> list[str]:
|
|
15
15
|
assert isinstance(parsed_author, list)
|
16
16
|
|
17
17
|
return parsed_author
|
18
|
+
|
19
|
+
|
20
|
+
def galaxy_tag_name(galaxy_type: str, galaxy_cluster_uuid: str) -> str:
|
21
|
+
return f'misp-galaxy:{galaxy_type}="{galaxy_cluster_uuid}"'
|
@@ -13,6 +13,7 @@ from mmisp.db.models.attribute import Attribute
|
|
13
13
|
from mmisp.db.models.galaxy import Galaxy
|
14
14
|
from mmisp.db.models.galaxy_cluster import GalaxyCluster, GalaxyElement
|
15
15
|
from mmisp.db.models.tag import Tag
|
16
|
+
from mmisp.lib.galaxies import galaxy_tag_name
|
16
17
|
from mmisp.util.crypto import hash_secret
|
17
18
|
from mmisp.util.uuid import uuid
|
18
19
|
|
@@ -460,12 +461,18 @@ async def auth_key(db, site_admin_user):
|
|
460
461
|
await db.commit()
|
461
462
|
|
462
463
|
|
463
|
-
|
464
|
-
|
464
|
+
@pytest.fixture
|
465
|
+
def galaxy_cluster_collection_uuid():
|
466
|
+
return uuid()
|
465
467
|
|
466
468
|
|
467
469
|
@pytest.fixture
|
468
|
-
def
|
470
|
+
def galaxy_default_cluster_one_uuid():
|
471
|
+
return uuid()
|
472
|
+
|
473
|
+
|
474
|
+
@pytest.fixture
|
475
|
+
def galaxy_default_cluster_two_uuid():
|
469
476
|
return uuid()
|
470
477
|
|
471
478
|
|
@@ -479,6 +486,118 @@ def galaxy_cluster_two_uuid():
|
|
479
486
|
return uuid()
|
480
487
|
|
481
488
|
|
489
|
+
@pytest_asyncio.fixture
|
490
|
+
async def test_default_galaxy(db, galaxy_default_cluster_one_uuid, galaxy_default_cluster_two_uuid):
|
491
|
+
galaxy = Galaxy(
|
492
|
+
namespace="misp",
|
493
|
+
name="test galaxy",
|
494
|
+
type="test galaxy type",
|
495
|
+
description="test",
|
496
|
+
version="1",
|
497
|
+
kill_chain_order=None,
|
498
|
+
uuid=uuid(),
|
499
|
+
enabled=True,
|
500
|
+
local_only=False,
|
501
|
+
)
|
502
|
+
|
503
|
+
db.add(galaxy)
|
504
|
+
await db.commit()
|
505
|
+
await db.refresh(galaxy)
|
506
|
+
|
507
|
+
galaxy_cluster = GalaxyCluster(
|
508
|
+
uuid=galaxy_default_cluster_one_uuid,
|
509
|
+
collection_uuid="",
|
510
|
+
type="test galaxy type",
|
511
|
+
value="test",
|
512
|
+
tag_name=galaxy_tag_name("test galaxy type", galaxy_default_cluster_one_uuid),
|
513
|
+
description="test",
|
514
|
+
galaxy_id=galaxy.id,
|
515
|
+
source="me",
|
516
|
+
authors='["Konstantin Zangerle", "Test Writer"]',
|
517
|
+
version=1,
|
518
|
+
distribution=3,
|
519
|
+
sharing_group_id=None,
|
520
|
+
org_id=0,
|
521
|
+
orgc_id=0,
|
522
|
+
default=0,
|
523
|
+
locked=0,
|
524
|
+
extends_uuid=None,
|
525
|
+
extends_version=None,
|
526
|
+
published=True,
|
527
|
+
deleted=False,
|
528
|
+
)
|
529
|
+
galaxy_cluster2 = GalaxyCluster(
|
530
|
+
uuid=galaxy_default_cluster_two_uuid,
|
531
|
+
collection_uuid="",
|
532
|
+
type="test galaxy type",
|
533
|
+
value="test",
|
534
|
+
tag_name=galaxy_tag_name("test galaxy type", galaxy_default_cluster_two_uuid),
|
535
|
+
description="test",
|
536
|
+
galaxy_id=galaxy.id,
|
537
|
+
source="me",
|
538
|
+
authors='["Konstantin Zangerle", "Test Writer"]',
|
539
|
+
version=1,
|
540
|
+
distribution=3,
|
541
|
+
sharing_group_id=None,
|
542
|
+
org_id=0,
|
543
|
+
orgc_id=0,
|
544
|
+
default=0,
|
545
|
+
locked=0,
|
546
|
+
extends_uuid=None,
|
547
|
+
extends_version=None,
|
548
|
+
published=True,
|
549
|
+
deleted=False,
|
550
|
+
)
|
551
|
+
|
552
|
+
db.add(galaxy_cluster)
|
553
|
+
db.add(galaxy_cluster2)
|
554
|
+
|
555
|
+
await db.commit()
|
556
|
+
await db.refresh(galaxy_cluster)
|
557
|
+
await db.refresh(galaxy_cluster2)
|
558
|
+
|
559
|
+
galaxy_element = GalaxyElement(
|
560
|
+
galaxy_cluster_id=galaxy_cluster.id, key="refs", value="http://test-one-one.example.com"
|
561
|
+
)
|
562
|
+
galaxy_element2 = GalaxyElement(
|
563
|
+
galaxy_cluster_id=galaxy_cluster.id, key="refs", value="http://test-one-two.example.com"
|
564
|
+
)
|
565
|
+
|
566
|
+
galaxy_element21 = GalaxyElement(
|
567
|
+
galaxy_cluster_id=galaxy_cluster2.id, key="refs", value="http://test-two-one.example.com"
|
568
|
+
)
|
569
|
+
galaxy_element22 = GalaxyElement(
|
570
|
+
galaxy_cluster_id=galaxy_cluster2.id, key="refs", value="http://test-two-two.example.com"
|
571
|
+
)
|
572
|
+
|
573
|
+
db.add(galaxy_element)
|
574
|
+
db.add(galaxy_element2)
|
575
|
+
|
576
|
+
db.add(galaxy_element21)
|
577
|
+
db.add(galaxy_element22)
|
578
|
+
|
579
|
+
await db.commit()
|
580
|
+
|
581
|
+
yield {
|
582
|
+
"galaxy": galaxy,
|
583
|
+
"galaxy_cluster": galaxy_cluster,
|
584
|
+
"galaxy_cluster2": galaxy_cluster2,
|
585
|
+
"galaxy_element": galaxy_element,
|
586
|
+
"galaxy_element2": galaxy_element2,
|
587
|
+
"galaxy_element21": galaxy_element21,
|
588
|
+
"galaxy_element22": galaxy_element22,
|
589
|
+
}
|
590
|
+
|
591
|
+
await db.delete(galaxy_element22)
|
592
|
+
await db.delete(galaxy_element21)
|
593
|
+
await db.delete(galaxy_element2)
|
594
|
+
await db.delete(galaxy_element)
|
595
|
+
await db.delete(galaxy_cluster2)
|
596
|
+
await db.delete(galaxy_cluster)
|
597
|
+
await db.delete(galaxy)
|
598
|
+
await db.commit()
|
599
|
+
|
600
|
+
|
482
601
|
@pytest_asyncio.fixture
|
483
602
|
async def test_galaxy(db, instance_owner_org, galaxy_cluster_one_uuid, galaxy_cluster_two_uuid):
|
484
603
|
galaxy = Galaxy(
|
@@ -502,7 +621,7 @@ async def test_galaxy(db, instance_owner_org, galaxy_cluster_one_uuid, galaxy_cl
|
|
502
621
|
collection_uuid="",
|
503
622
|
type="test galaxy type",
|
504
623
|
value="test",
|
505
|
-
tag_name=
|
624
|
+
tag_name=galaxy_tag_name("test galaxy type", galaxy_cluster_one_uuid),
|
506
625
|
description="test",
|
507
626
|
galaxy_id=galaxy.id,
|
508
627
|
source="me",
|
@@ -524,7 +643,7 @@ async def test_galaxy(db, instance_owner_org, galaxy_cluster_one_uuid, galaxy_cl
|
|
524
643
|
collection_uuid="",
|
525
644
|
type="test galaxy type",
|
526
645
|
value="test",
|
527
|
-
tag_name=
|
646
|
+
tag_name=galaxy_tag_name("test galaxy type", galaxy_cluster_two_uuid),
|
528
647
|
description="test",
|
529
648
|
galaxy_id=galaxy.id,
|
530
649
|
source="me",
|
@@ -594,7 +713,7 @@ async def test_galaxy(db, instance_owner_org, galaxy_cluster_one_uuid, galaxy_cl
|
|
594
713
|
@pytest_asyncio.fixture()
|
595
714
|
async def galaxy_cluster_one_tag(db, galaxy_cluster_one_uuid):
|
596
715
|
tag = Tag(
|
597
|
-
name=
|
716
|
+
name=galaxy_tag_name("test galaxy type", galaxy_cluster_one_uuid),
|
598
717
|
colour="#123456",
|
599
718
|
exportable=True,
|
600
719
|
hide_tag=False,
|
@@ -74,10 +74,13 @@ src/mmisp/lib/__init__.py
|
|
74
74
|
src/mmisp/lib/actions.py
|
75
75
|
src/mmisp/lib/attribute_search_filter.py
|
76
76
|
src/mmisp/lib/attributes.py
|
77
|
+
src/mmisp/lib/distribution.py
|
78
|
+
src/mmisp/lib/fallbacks.py
|
77
79
|
src/mmisp/lib/galaxies.py
|
78
80
|
src/mmisp/lib/logging.py
|
79
81
|
src/mmisp/lib/permissions.py
|
80
82
|
src/mmisp/lib/py.typed
|
83
|
+
src/mmisp/lib/serialisation_helper.py
|
81
84
|
src/mmisp/lib/uuid.py
|
82
85
|
src/mmisp/plugins/py.typed
|
83
86
|
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
|
File without changes
|
File without changes
|
{mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/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
|
{mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/event_generator.py
RENAMED
File without changes
|
{mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/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.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/role_generator.py
RENAMED
File without changes
|
{mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/server_generator.py
RENAMED
File without changes
|
File without changes
|
{mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/src/mmisp/tests/generators/model_generators/tag_generator.py
RENAMED
File without changes
|
File without changes
|
{mmisp_lib-0.6.0 → mmisp_lib-0.6.2}/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
|