dictature 0.10.0__py3-none-any.whl → 0.10.1__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.
- dictature/backend/misp.py +10 -1
- dictature/backend/mock.py +1 -1
- {dictature-0.10.0.dist-info → dictature-0.10.1.dist-info}/METADATA +1 -1
- {dictature-0.10.0.dist-info → dictature-0.10.1.dist-info}/RECORD +7 -7
- {dictature-0.10.0.dist-info → dictature-0.10.1.dist-info}/LICENSE +0 -0
- {dictature-0.10.0.dist-info → dictature-0.10.1.dist-info}/WHEEL +0 -0
- {dictature-0.10.0.dist-info → dictature-0.10.1.dist-info}/top_level.txt +0 -0
dictature/backend/misp.py
CHANGED
@@ -3,7 +3,7 @@ from typing import Iterable, Optional
|
|
3
3
|
from .mock import DictatureTableMock, DictatureBackendMock, Value, ValueMode, ValueSerializer, ValueSerializerMode
|
4
4
|
|
5
5
|
try:
|
6
|
-
from pymisp import PyMISP, MISPEvent, MISPAttribute
|
6
|
+
from pymisp import PyMISP, MISPEvent, MISPAttribute, MISPTag
|
7
7
|
except ImportError as e:
|
8
8
|
raise ImportError("Please install the 'pymisp' package to use the 'DictatureBackendMISP' backend.") from e
|
9
9
|
|
@@ -92,6 +92,15 @@ class DictatureTableMISP(DictatureTableMock):
|
|
92
92
|
self.__event = event
|
93
93
|
break
|
94
94
|
else:
|
95
|
+
# Check if tag exists, create if not
|
96
|
+
existing_tags = self.__misp.search_tags(self.__tag, strict_tagname=True, pythonify=True)
|
97
|
+
if not type(existing_tags) is list or not existing_tags:
|
98
|
+
tag = MISPTag()
|
99
|
+
tag.name = self.__tag
|
100
|
+
tag.colour = '#000000'
|
101
|
+
tag.exportable = True
|
102
|
+
self.__misp.add_tag(tag)
|
103
|
+
|
95
104
|
event = MISPEvent()
|
96
105
|
event.info = self.__event_description
|
97
106
|
event.distribution = 0
|
dictature/backend/mock.py
CHANGED
@@ -74,7 +74,7 @@ class ValueSerializer:
|
|
74
74
|
if self.__mode == ValueSerializerMode.hex_only:
|
75
75
|
allowed_chars = hexdigits
|
76
76
|
elif self.__mode == ValueSerializerMode.filename_only:
|
77
|
-
allowed_chars = ascii_letters + digits + '_.'
|
77
|
+
allowed_chars = ascii_letters + digits + '-_.'
|
78
78
|
elif self.__mode in (ValueSerializerMode.any_string, ValueSerializerMode.ascii_only):
|
79
79
|
allowed_chars = None
|
80
80
|
else:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: dictature
|
3
|
-
Version: 0.10.
|
3
|
+
Version: 0.10.1
|
4
4
|
Summary: dictature -- A generic wrapper around dict-like interface with mulitple backends
|
5
5
|
Author-email: Adam Hlavacek <git@adamhlavacek.com>
|
6
6
|
Project-URL: Homepage, https://github.com/esoadamo/dictature
|
@@ -2,8 +2,8 @@ dictature/__init__.py,sha256=UCPJKHeyirRZ0pCYoyeat-rwXa8pDezOJ3UWCipDdyc,33
|
|
2
2
|
dictature/dictature.py,sha256=SHwG_XvGwm6qpvMt5OjeS8BoU5wLgJi_4jIBKFmYFyI,9330
|
3
3
|
dictature/backend/__init__.py,sha256=d5s6QCJOUzFglVNg8Cqqx_8b61S-AOTGjEUIF6FS69U,149
|
4
4
|
dictature/backend/directory.py,sha256=nPNJ-wRZOsuzaCOLxgGnNB093qID5LWw7VELAqi7kZc,3384
|
5
|
-
dictature/backend/misp.py,sha256=
|
6
|
-
dictature/backend/mock.py,sha256=
|
5
|
+
dictature/backend/misp.py,sha256=R9osuEJa79SoXErwByIwhViJ26cEfw2nKhWu8XxkO7Y,4860
|
6
|
+
dictature/backend/mock.py,sha256=jGGBU_IUPSxxpgQKajd05ckiMxpNW3rB1zLKNqQeOVQ,5890
|
7
7
|
dictature/backend/sqlite.py,sha256=zyphYEeLY4eGuBCor16i80_-brdipMpXZ3_kONwErsE,5237
|
8
8
|
dictature/backend/webdav.py,sha256=Y-3_WTcMyKVUnsVjiUZAxuy10FK0Yr-7Mgn13clg3po,5039
|
9
9
|
dictature/transformer/__init__.py,sha256=JIFJpXU6iB9hIUM8L7HL2o9Nqjm_YbMEuQBQC8ZJ6b4,124
|
@@ -13,8 +13,8 @@ dictature/transformer/hmac.py,sha256=vURsB0HlzRPn_Vkl7lGmZV9OKempQuds8AanmadDxIo
|
|
13
13
|
dictature/transformer/mock.py,sha256=7zu65ZqUV_AVRaPSzNd73cVMXixXt31SeuX9OKZxaJQ,948
|
14
14
|
dictature/transformer/passthrough.py,sha256=Pt3N6G_Qh6HJ_q75ETL5nfAwYHLB-SjkVwUwbbbMik8,344
|
15
15
|
dictature/transformer/pipeline.py,sha256=OaQaJeJ5NpICetJe08r8ontqstsXGuW8jDbKw1zxYs4,842
|
16
|
-
dictature-0.10.
|
17
|
-
dictature-0.10.
|
18
|
-
dictature-0.10.
|
19
|
-
dictature-0.10.
|
20
|
-
dictature-0.10.
|
16
|
+
dictature-0.10.1.dist-info/LICENSE,sha256=n1U9DKr8sM5EY2QHcvxSGiKTDWUT8MyXsOC79w94MT0,1072
|
17
|
+
dictature-0.10.1.dist-info/METADATA,sha256=qO1se3-rNcVMZulMWKxBUTe50f1FX7ymL6ObYSzXYIs,2937
|
18
|
+
dictature-0.10.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
19
|
+
dictature-0.10.1.dist-info/top_level.txt,sha256=-RO39WWCF44lqiXhSUcACVqbk6SkgReZTz7ZmHKH3-U,10
|
20
|
+
dictature-0.10.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|