assemblyline-v4-service 4.5.1.dev197__py3-none-any.whl → 4.5.1.dev200__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.
Potentially problematic release.
This version of assemblyline-v4-service might be problematic. Click here for more details.
- assemblyline_v4_service/VERSION +1 -1
- assemblyline_v4_service/common/task.py +10 -2
- assemblyline_v4_service/dev/run_service_once.py +2 -2
- {assemblyline_v4_service-4.5.1.dev197.dist-info → assemblyline_v4_service-4.5.1.dev200.dist-info}/METADATA +1 -1
- {assemblyline_v4_service-4.5.1.dev197.dist-info → assemblyline_v4_service-4.5.1.dev200.dist-info}/RECORD +8 -8
- {assemblyline_v4_service-4.5.1.dev197.dist-info → assemblyline_v4_service-4.5.1.dev200.dist-info}/LICENCE.md +0 -0
- {assemblyline_v4_service-4.5.1.dev197.dist-info → assemblyline_v4_service-4.5.1.dev200.dist-info}/WHEEL +0 -0
- {assemblyline_v4_service-4.5.1.dev197.dist-info → assemblyline_v4_service-4.5.1.dev200.dist-info}/top_level.txt +0 -0
assemblyline_v4_service/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.5.1.
|
|
1
|
+
4.5.1.dev200
|
|
@@ -9,6 +9,7 @@ from assemblyline_v4_service.common.helper import get_service_manifest
|
|
|
9
9
|
from assemblyline_v4_service.common.result import Result
|
|
10
10
|
|
|
11
11
|
from assemblyline.common import forge
|
|
12
|
+
from assemblyline.common.constants import MAX_INT
|
|
12
13
|
from assemblyline.common import log as al_log
|
|
13
14
|
from assemblyline.common.classification import Classification
|
|
14
15
|
from assemblyline.common.digests import get_digests_for_file, get_sha256_for_file
|
|
@@ -97,10 +98,17 @@ class Task:
|
|
|
97
98
|
self.log.info(f"Adding empty extracted or supplementary files is not allowed. "
|
|
98
99
|
f"Empty file ({name}) was ignored.")
|
|
99
100
|
return
|
|
101
|
+
elif os.path.getsize(path) > MAX_INT:
|
|
102
|
+
self.log.error(f"Adding file of size {os.path.getsize(path)} is impossible due to ElasticSearch "
|
|
103
|
+
f"limitations. File ({name}) was ignored.")
|
|
104
|
+
return
|
|
100
105
|
|
|
101
106
|
if parent_relation not in PARENT_RELATION.keys():
|
|
102
107
|
raise ValueError(
|
|
103
|
-
|
|
108
|
+
(
|
|
109
|
+
f"An invalid 'parent_relation' was provided: '{parent_relation}'. "
|
|
110
|
+
f"Possible values are: '{PARENT_RELATION.keys()}'"
|
|
111
|
+
)
|
|
104
112
|
)
|
|
105
113
|
|
|
106
114
|
# If file classification not provided, then use the default result classification
|
|
@@ -130,7 +138,7 @@ class Task:
|
|
|
130
138
|
# Allows the administrator to be selective about the types of hashes to lookup in the safelist
|
|
131
139
|
if safelist_interface and self.safelist_config.enabled and not (self.deep_scan or self.ignore_filtering):
|
|
132
140
|
# Ignore adding files that are known to the system to be safe
|
|
133
|
-
digests = get_digests_for_file(path, skip_fuzzy_hashes=True)
|
|
141
|
+
digests = get_digests_for_file(path, calculate_entropy=False, skip_fuzzy_hashes=True)
|
|
134
142
|
for hash_type in self.safelist_config.hash_types:
|
|
135
143
|
qhash = digests[hash_type]
|
|
136
144
|
resp = safelist_interface.lookup_safelist(qhash)
|
|
@@ -55,7 +55,7 @@ class RunService:
|
|
|
55
55
|
self.service.start_service()
|
|
56
56
|
|
|
57
57
|
# Identify the file
|
|
58
|
-
file_info = self.identify.fileinfo(FILE_PATH, skip_fuzzy_hashes=True)
|
|
58
|
+
file_info = self.identify.fileinfo(FILE_PATH, skip_fuzzy_hashes=True, calculate_entropy=False)
|
|
59
59
|
if file_info['type'] == "archive/cart" or file_info['magic'] == "custom: archive/cart":
|
|
60
60
|
original_file_name = get_metadata_only(FILE_PATH).get("name")
|
|
61
61
|
if original_file_name:
|
|
@@ -66,7 +66,7 @@ class RunService:
|
|
|
66
66
|
with open(FILE_PATH, 'rb') as ifile, open(original_temp, 'wb') as ofile:
|
|
67
67
|
unpack_stream(ifile, ofile)
|
|
68
68
|
|
|
69
|
-
file_info = self.identify.fileinfo(original_temp, skip_fuzzy_hashes=True)
|
|
69
|
+
file_info = self.identify.fileinfo(original_temp, skip_fuzzy_hashes=True, calculate_entropy=False)
|
|
70
70
|
target_file = os.path.join(tempfile.gettempdir(), file_info['sha256'])
|
|
71
71
|
shutil.move(original_temp, target_file)
|
|
72
72
|
LOG.info(f"File was a CaRT archive, it was un-CaRTed to {target_file} for processing")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
assemblyline_v4_service/VERSION,sha256=
|
|
1
|
+
assemblyline_v4_service/VERSION,sha256=lp_sJZFLCyVtwCxS-07bW_XrOZIReLh64tfzgNLGIuc,13
|
|
2
2
|
assemblyline_v4_service/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
assemblyline_v4_service/healthz.py,sha256=sS1cFkDLw8hUPMpj7tbHXFv8ZmHcazrwZ0l6oQDwwkQ,1575
|
|
4
4
|
assemblyline_v4_service/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -12,10 +12,10 @@ assemblyline_v4_service/common/ocr.py,sha256=3fV0PyY3oui_ucAM9dkolP0VRYKACKJuGY4
|
|
|
12
12
|
assemblyline_v4_service/common/ontology_helper.py,sha256=QpwerYoS5hXjWzpx3Pmwv6j2330PQVYqxYGamjcpW3I,7890
|
|
13
13
|
assemblyline_v4_service/common/request.py,sha256=W7fqC2xQE3i5i2jlCDyUDp3ZqJQQqSshNW0mQfJMkFg,11792
|
|
14
14
|
assemblyline_v4_service/common/result.py,sha256=9AqM6qCYiia_Bpyn_fBFhzNQMcqJbtFSiGjp57fXW2E,32713
|
|
15
|
-
assemblyline_v4_service/common/task.py,sha256=
|
|
15
|
+
assemblyline_v4_service/common/task.py,sha256=dJsvRpW0x88CCF_LW6w87jQ_UKTVaOs2Gb117IDNiU8,14233
|
|
16
16
|
assemblyline_v4_service/common/utils.py,sha256=k2__d-V5LjB6o2IKbjVe7tJWKcKuUHto5TyT5oKhIa0,3890
|
|
17
17
|
assemblyline_v4_service/dev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
|
-
assemblyline_v4_service/dev/run_service_once.py,sha256=
|
|
18
|
+
assemblyline_v4_service/dev/run_service_once.py,sha256=iEWkLnF4cWN0V3Mc6GhMKjDAPYfY0YjESmtReTAJg88,10506
|
|
19
19
|
assemblyline_v4_service/updater/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
20
|
assemblyline_v4_service/updater/__main__.py,sha256=9Os-u8Tf7MD73JSrUSPmOaErTgfvesNLiEeszU4ujXA,133
|
|
21
21
|
assemblyline_v4_service/updater/app.py,sha256=Mtmx4bkXfP4nFqqa5q15jW8QIXr4JK84lCovxAVyvPs,3317
|
|
@@ -38,8 +38,8 @@ test/test_common/test_request.py,sha256=Ceyds8BNO1O0f1kH1VEb84faJcaupvSjVKIrGdHe
|
|
|
38
38
|
test/test_common/test_result.py,sha256=6BiOKxEPrKBjOY44jv3TY-yiXm0qI1ok_CZBnjP9TM4,45447
|
|
39
39
|
test/test_common/test_task.py,sha256=P44mNcSe-3tJgDk9ppN3KbM7oN4LBVIuhONG-Gveh74,19007
|
|
40
40
|
test/test_common/test_utils.py,sha256=TbnBxqpS_ZC5ptXR9XJX3xtbItD0mTbtiBxxdyP8J5k,5904
|
|
41
|
-
assemblyline_v4_service-4.5.1.
|
|
42
|
-
assemblyline_v4_service-4.5.1.
|
|
43
|
-
assemblyline_v4_service-4.5.1.
|
|
44
|
-
assemblyline_v4_service-4.5.1.
|
|
45
|
-
assemblyline_v4_service-4.5.1.
|
|
41
|
+
assemblyline_v4_service-4.5.1.dev200.dist-info/LICENCE.md,sha256=NSkYo9EH8h5oOkzg4VhjAHF4339MqPP2cQ8msTPgl-c,1396
|
|
42
|
+
assemblyline_v4_service-4.5.1.dev200.dist-info/METADATA,sha256=Jt2HMvuXExX3bqvSsHuDDDP9L_gD_BdqxUZH0OM7cb4,9499
|
|
43
|
+
assemblyline_v4_service-4.5.1.dev200.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
44
|
+
assemblyline_v4_service-4.5.1.dev200.dist-info/top_level.txt,sha256=LpTOEaVCatkrvbVq3EZseMSIa2PQZU-2rhuO_FTpZgY,29
|
|
45
|
+
assemblyline_v4_service-4.5.1.dev200.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|