taranis-models 1.2.0.dev4__tar.gz → 1.2.0.dev5__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.
- {taranis_models-1.2.0.dev4/taranis_models.egg-info → taranis_models-1.2.0.dev5}/PKG-INFO +1 -1
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/admin.py +1 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/types.py +41 -1
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5/taranis_models.egg-info}/PKG-INFO +1 -1
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/.dockerignore +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/.gitignore +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/LICENSE.md +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/README.md +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/__init__.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/assess.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/base.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/cache.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/dashboard.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/product.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/models/report.py +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/pyproject.toml +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/setup.cfg +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/SOURCES.txt +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/dependency_links.txt +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/requires.txt +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/top_level.txt +0 -0
- {taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/uv.lock +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from enum import StrEnum, auto, IntEnum
|
|
1
|
+
from enum import StrEnum, auto, IntEnum, nonmember
|
|
2
|
+
import contextlib
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class TLPLevel(StrEnum):
|
|
@@ -8,6 +9,45 @@ class TLPLevel(StrEnum):
|
|
|
8
9
|
AMBER = "amber"
|
|
9
10
|
RED = "red"
|
|
10
11
|
|
|
12
|
+
_ACCESSIBLE_NAMES = nonmember(
|
|
13
|
+
{
|
|
14
|
+
"RED": ["RED", "AMBER_STRICT", "AMBER", "GREEN", "CLEAR"],
|
|
15
|
+
"AMBER_STRICT": ["AMBER_STRICT", "AMBER", "GREEN", "CLEAR"],
|
|
16
|
+
"AMBER": ["AMBER", "GREEN", "CLEAR"],
|
|
17
|
+
"GREEN": ["GREEN", "CLEAR"],
|
|
18
|
+
"CLEAR": ["CLEAR"],
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
def get_accessible_levels(self) -> list[str]:
|
|
23
|
+
"""
|
|
24
|
+
Return the list of TLPLevel members this level can access.
|
|
25
|
+
"""
|
|
26
|
+
names = type(self)._ACCESSIBLE_NAMES.get(self.name, [])
|
|
27
|
+
return [type(self)[nm].value for nm in names]
|
|
28
|
+
|
|
29
|
+
@classmethod
|
|
30
|
+
def get_most_restrictive_tlp(cls, tlp_levels: list["TLPLevel"]) -> "TLPLevel":
|
|
31
|
+
"""
|
|
32
|
+
Get the most restrictive TLP level from a list of TLP levels.
|
|
33
|
+
If the list is empty, return the default TLP level (CLEAR).
|
|
34
|
+
"""
|
|
35
|
+
if not tlp_levels:
|
|
36
|
+
return cls.CLEAR
|
|
37
|
+
|
|
38
|
+
provided = {tlp.name for tlp in tlp_levels}
|
|
39
|
+
|
|
40
|
+
return next(
|
|
41
|
+
(cls[level_name] for level_name in cls._ACCESSIBLE_NAMES.keys() if level_name in provided),
|
|
42
|
+
cls.CLEAR,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def get_tlp_level(cls, tlp_level: str) -> "TLPLevel | None":
|
|
47
|
+
with contextlib.suppress(ValueError):
|
|
48
|
+
return TLPLevel(tlp_level)
|
|
49
|
+
return None
|
|
50
|
+
|
|
11
51
|
|
|
12
52
|
class ItemType(StrEnum):
|
|
13
53
|
OSINT_SOURCE = auto()
|
|
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
|
{taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/requires.txt
RENAMED
|
File without changes
|
{taranis_models-1.2.0.dev4 → taranis_models-1.2.0.dev5}/taranis_models.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|