Skip to content

Commit 147e2eb

Browse files
authored
Reverted DIE changes and upgraded to 0.4.0. Closes #2735 (#2794)
* Reverted DIE changes and upgraded to 0.4.0 * Removed conditional import * Updated uWSGi dependency
1 parent 72b4214 commit 147e2eb

File tree

4 files changed

+9
-30
lines changed

4 files changed

+9
-30
lines changed

api_app/analyzers_manager/file_analyzers/detectiteasy.py

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import json
22
import logging
33

4-
from api_app.analyzers_manager.exceptions import AnalyzerRunException
5-
6-
try:
7-
import die
8-
except ImportError:
9-
die = None
4+
import die
105

116
from api_app.analyzers_manager.classes import FileAnalyzer
127
from tests.mock_utils import MockUpResponse
@@ -22,20 +17,12 @@ def update(self):
2217
def run(self):
2318
logger.info(f"Running DIE on {self.filepath} for {self.md5}")
2419

25-
if die:
26-
json_report = die.scan_file(
27-
self.filepath,
28-
die.ScanFlags.RESULT_AS_JSON,
29-
str(die.database_path / "db"),
30-
)
31-
result = json.loads(json_report)
32-
else:
33-
message = "DIE package not imported because incompatible in ARM"
34-
self.report.errors.append(message)
35-
result = {"errors": message}
36-
raise AnalyzerRunException(message)
37-
38-
return result
20+
json_report = die.scan_file(
21+
self.filepath,
22+
die.ScanFlags.RESULT_AS_JSON,
23+
str(die.database_path / "db"),
24+
)
25+
return json.loads(json_report)
3926

4027
@staticmethod
4128
def mocked_docker_analyzer_get(*args, **kwargs):

docker/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ RUN apt-get update \
4848
&& pip3 install --no-cache-dir --upgrade pip
4949

5050
COPY requirements/project-requirements.txt $PYTHONPATH/project-requirements.txt
51-
COPY requirements/amd-only-requirements.txt $PYTHONPATH/amd-only-requirements.txt
5251
COPY requirements/certego-requirements.txt $PYTHONPATH/certego-requirements.txt
5352
WORKDIR $PYTHONPATH
5453

@@ -70,11 +69,6 @@ RUN touch ${LOG_PATH}/django/api_app.log ${LOG_PATH}/django/api_app_errors.log \
7069
# download github stuff
7170
&& ${PYTHONPATH}/api_app/analyzers_manager/repo_downloader.sh
7271

73-
# last step cause there is an if that could invalidate the cache
74-
RUN if [[ "$TARGETARCH" == "amd64" ]]; \
75-
then pip3 install --no-cache-dir --compile -r amd-only-requirements.txt; \
76-
else echo "skipping installation of AMD only requirements"; fi
77-
7872
FROM backend-build
7973

8074
COPY --from=frontend-build /build /var/www/reactapp

requirements/amd-only-requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements/project-requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dataclasses==0.6
2929
# https://github.com/advisories/GHSA-q4qm-xhf9-4p8f
3030
# unpatched CVE: noproblem, we just use this for debugging purposes
3131
flower==2.0.0
32-
uWSGI==2.0.22
32+
uWSGI==2.0.28
3333
uwsgitop==0.12
3434
whitenoise==6.9.0
3535
daphne==4.1.0
@@ -89,6 +89,7 @@ pylnk3==0.4.2
8989
androguard==3.4.0a1 # version >=4.x of androguard raises a dependency conflict with quark-engine==25.1.1
9090
wad==0.4.6
9191
debloat==1.6.4
92+
die-python==0.4.0
9293

9394
# httpx required for HTTP/2 support (Mullvad DNS rejects HTTP/1.1 with protocol errors)
9495
httpx[http2]==0.28.1

0 commit comments

Comments
 (0)