Skip to content

Commit 5b35d87

Browse files
committed
finalize uv migration restore ruff config and migrate integrations
1 parent 9c38afc commit 5b35d87

12 files changed

Lines changed: 66 additions & 164 deletions

File tree

integrations/bbot/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.12-slim
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23

34
# Environment variables
45
ENV PROJECT_PATH=/opt/deploy/bbot
@@ -17,9 +18,8 @@ WORKDIR ${PROJECT_PATH}
1718
# Copy application files and requirements
1819
COPY requirements.txt app.py ./
1920

20-
# Upgrade pip and install Python packages
21-
RUN pip install --no-cache-dir --upgrade pip && \
22-
pip install --no-cache-dir -r requirements.txt
21+
# Install Python packages
22+
RUN uv pip install --system -r requirements.txt
2323

2424
# Pre-install BBOT dependencies & Make script executable
2525
RUN bbot --install-all-deps -y --force && \

integrations/malware_tools_analyzers/Dockerfile

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.11-slim
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23

34
ARG TARGETARCH
45

@@ -42,8 +43,7 @@ WORKDIR ${PYTHONPATH}/stringsifter
4243
COPY ./requirements/stringsifter-requirements.txt ./stringsifter/wrapper.py ./
4344
# Installed at system level because virtualenv does not work as expected
4445
# ModuleNotFoundError: No module named 'pybind11' while trying to build
45-
RUN pip3 install --no-cache-dir --upgrade pip \
46-
&& pip3 install --no-cache-dir -r stringsifter-requirements.txt \
46+
RUN uv pip install --system -r stringsifter-requirements.txt \
4747
&& chmod +x wrapper.py
4848

4949
# Build Qiling
@@ -53,44 +53,41 @@ COPY ./requirements/qiling-requirements.txt ./qiling/analyze.py ./
5353
RUN if [[ $TARGETARCH == "amd64" ]]; then \
5454
python3 -m venv venv \
5555
&& . venv/bin/activate \
56-
&& pip3 install --no-cache-dir --upgrade pip \
57-
&& pip3 install --no-cache-dir -r qiling-requirements.txt; fi
56+
&& uv pip install --system -r qiling-requirements.txt; fi
5857

5958
# Then Build every possible other Python application inside its virtual environment
6059
# Build guelfo's PEFrame
6160
WORKDIR ${PYTHONPATH}/peframe
6261
COPY ./requirements/peframe-requirements.txt ./
6362
RUN python3 -m venv venv \
6463
&& . venv/bin/activate \
65-
&& pip3 install --no-cache-dir --upgrade pip \
66-
&& pip3 install --no-cache-dir -r peframe-requirements.txt --no-cache-dir
64+
&& uv pip install --system -r peframe-requirements.txt --no-cache-dir
6765

6866
# Install guelfo's artifacts
6967
# there is no version management on this project so we just pull the most recent changes
7068
WORKDIR ${PYTHONPATH}/artifacts
7169
RUN python3 -m venv venv \
7270
&& . venv/bin/activate \
73-
&& pip3 install --no-cache-dir --upgrade pip \
71+
7472
&& git clone https://github.com/guelfoweb/artifacts.git \
7573
&& cd artifacts \
76-
&& pip install --no-cache-dir -r requirements.txt \
74+
&& uv pip install -r requirements.txt \
7775
&& chmod +x artifacts.py
7876

7977
# Build APKiD
8078
WORKDIR ${PYTHONPATH}/apkid
8179
COPY ./requirements/apkid-requirements.txt ./
8280
RUN python3 -m venv venv \
8381
&& . venv/bin/activate \
84-
&& pip3 install --no-cache-dir --upgrade pip \
85-
&& pip3 install --no-cache-dir -r apkid-requirements.txt
82+
&& uv pip install --system -r apkid-requirements.txt
8683

8784
# Install DroidLysis
8885
WORKDIR "${PYTHONPATH}/droidlysis"
8986
COPY ./requirements/droidlysis-requirements.txt ./
9087
RUN python3 -m venv venv \
9188
&& . venv/bin/activate \
92-
&& pip3 install --no-cache-dir --upgrade pip \
93-
&& pip3 install --no-cache-dir -r droidlysis-requirements.txt --no-cache-dir \
89+
90+
&& uv pip install -r droidlysis-requirements.txt --no-cache-dir \
9491
&& mkdir -p ~/softs \
9592
&& cd ~/softs \
9693
&& wget -q https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.9.3.jar \
@@ -102,7 +99,7 @@ RUN python3 -m venv venv \
10299
&& mkdir -p "${PYTHONPATH}/droidlysis/out" "${PYTHONPATH}/droidlysis/conf" /root/.cache/droidlysis \
103100
&& chown -R ${USER}:${USER} /root/.cache/droidlysis \
104101
&& chmod 711 /root/ \
105-
&& DROIDLYSIS_PATH="$(pip3 show droidlysis | grep Location | cut -d ' ' -f 2)" \
102+
&& DROIDLYSIS_PATH="$(uv pip show droidlysis | grep Location | cut -d ' ' -f 2)" \
106103
&& cp "${DROIDLYSIS_PATH}/conf/"*.conf "${PYTHONPATH}/droidlysis/conf/" \
107104
&& rm -f "${PYTHONPATH}/droidlysis/conf/general.conf"
108105
COPY ./droidlysis/general.conf ${PYTHONPATH}/droidlysis/conf/general.conf
@@ -112,8 +109,7 @@ WORKDIR ${PYTHONPATH}/mobsf
112109
COPY ./requirements/mobsf-requirements.txt ./
113110
RUN python3 -m venv venv \
114111
&& . venv/bin/activate \
115-
&& pip3 install --no-cache-dir --upgrade pip \
116-
&& pip3 install --no-cache-dir -r mobsf-requirements.txt \
112+
&& uv pip install --system -r mobsf-requirements.txt \
117113
&& mkdir -p /root/.semgrep/ \
118114
&& chown -R ${USER}:${USER} /root/.semgrep \
119115
&& chmod 711 /root
@@ -130,8 +126,7 @@ WORKDIR ${PYTHONPATH}/flask
130126
COPY app.py ./requirements/flask-requirements.txt entrypoint.sh ./
131127
RUN python3 -m venv venv \
132128
&& . venv/bin/activate \
133-
&& pip3 install --no-cache-dir --upgrade pip \
134-
&& pip3 install --no-cache-dir -r flask-requirements.txt \
129+
&& uv pip install --system -r flask-requirements.txt \
135130
&& chmod +x entrypoint.sh
136131

137132
# Cleanup

integrations/nuclei_analyzer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM projectdiscovery/nuclei:v3.7.0
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23

34
ENV LOG_PATH=/var/log/intel_owl/nuclei_analyzer
45
ENV USER=nuclei-user
@@ -17,8 +18,7 @@ WORKDIR /app
1718
COPY app.py requirements.txt entrypoint.sh ./
1819
RUN python3 -m venv venv \
1920
&& . venv/bin/activate \
20-
&& pip3 install --no-cache-dir --upgrade pip \
21-
&& pip3 install --no-cache-dir -r requirements.txt \
21+
&& uv pip install -r requirements.txt \
2222
&& rm -rf ~/.cache/pip/*
2323

2424
# Create log directory with proper permissions

integrations/pcap_analyzers/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# https://github.com/jasonish/docker-suricata/tree/master/7.0
22
FROM jasonish/suricata:7.0
3+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
34

45
ENV PROJECT_PATH=/opt/deploy
56
ENV LOG_PATH=/var/log/intel_owl/pcap_analyzers
@@ -18,7 +19,7 @@ COPY crontab /etc/cron.d/suricata
1819
COPY config/suricata/etc/* /etc/suricata/
1920
COPY config/suricata/rules/* /var/lib/suricata/rules/
2021

21-
RUN pip3 install -r requirements.txt --no-cache-dir \
22+
RUN uv pip install --system -r requirements.txt \
2223
&& chown -R ${USER}:${USER} . /etc/suricata /var/lib/suricata \
2324
&& mkdir -p ${LOG_PATH}/suricata/ \
2425
&& touch /var/log/cron.log ${LOG_PATH}/suricata/suricata.log \

integrations/phishing_analyzers/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.12.3
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23

34
ENV PROJECT_PATH=/opt/deploy
45
ENV LOG_PATH=/var/log/intel_owl/phishing_analyzers
@@ -13,7 +14,6 @@ RUN useradd -ms /bin/bash ${USER}
1314
RUN DEBIAN_FRONTEND=noninteractive apt-get update -qq \
1415
&& apt-get install -y --no-install-recommends \
1516
libvulkan1 libu2f-udev fonts-liberation gosu \
16-
&& pip3 install --no-cache-dir --upgrade pip \
1717
# Cleanup
1818
&& apt-get remove --purge -y gcc \
1919
&& apt-get clean \
@@ -26,7 +26,7 @@ WORKDIR ${PROJECT_PATH}/phishing_analyzers
2626
COPY --chown=${USER}:${USER} app.py requirements.txt entrypoint.sh ./
2727
COPY --chown=${USER}:${USER} analyzers/* ./analyzers/
2828
RUN chmod u+x entrypoint.sh \
29-
&& pip3 install -r requirements.txt --no-cache-dir \
29+
&& uv pip install --system -r requirements.txt \
3030
&& playwright install chromium --with-deps \
3131
&& chmod -R o+rX /ms-playwright
3232

integrations/phunter/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.12-slim
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23

34
# Install dependencies
45
RUN apt-get update && apt-get install -y --no-install-recommends git
@@ -12,10 +13,8 @@ WORKDIR /app
1213
# Copy requirements file and app.py to the working directory
1314
COPY requirements.txt app.py ./
1415

15-
# Upgrade pip and install Python packages
16-
RUN pip install --no-cache-dir --upgrade pip && \
17-
pip install --no-cache-dir -r requirements.txt && \
18-
pip install --no-cache-dir -r /app/Phunter/requirements.txt
16+
# Install Python packages
17+
RUN uv pip install --system -r requirements.txt -r /app/Phunter/requirements.txt
1918

2019
# Expose port
2120
EXPOSE 5612

integrations/thug/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This base image is the one currently (02/2025) updated by the maintainer
22
# but it does not support ARM
33
FROM thughoneyclient/thug:v6.20
4+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
45

56
USER root
67
ENV PROJECT_PATH=/opt/deploy
@@ -16,7 +17,7 @@ RUN apt-get update -qq \
1617
WORKDIR ${PROJECT_PATH}/flask
1718
COPY app.py requirements.txt entrypoint.sh ./
1819

19-
RUN pip3 install -r requirements.txt --no-cache-dir \
20+
RUN uv pip install --system -r requirements.txt \
2021
&& mkdir -p ${PROJECT_PATH}/thug \
2122
&& chown -R ${USER}:${USER} . ${PROJECT_PATH}/thug \
2223
&& chmod +x entrypoint.sh

integrations/tor_analyzers/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM python:3.14-slim
2+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
23

34
ENV PROJECT_PATH=/opt/deploy
45
ENV LOG_PATH=/var/log/intel_owl/tor_analyzers
@@ -28,7 +29,7 @@ RUN apt-get remove --purge -y git gcc \
2829
WORKDIR ${PROJECT_PATH}/tor-flask
2930
COPY app.py requirements.txt entrypoint.sh ./
3031

31-
RUN pip3 install -r requirements.txt --no-cache-dir \
32+
RUN uv pip install --system -r requirements.txt \
3233
&& chown -R ${USER}:${USER} . \
3334
&& chmod +x entrypoint.sh
3435

pyproject.toml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,16 @@ managed = true
153153
line-length = 110
154154
target-version = "py311"
155155

156+
exclude = [
157+
"venv",
158+
"frontend",
159+
"node_modules",
160+
"migrations",
161+
"docs",
162+
"virtualenv",
163+
"configuration/ldap_config.py",
164+
]
165+
156166
[tool.ruff.lint]
157167
select = [
158168
"E", # pycodestyle errors
@@ -163,22 +173,45 @@ select = [
163173
"C4", # flake8-comprehensions
164174
"DJ", # flake8-django
165175
]
176+
166177
ignore = [
167178
"E231", # missing whitespace after ','
168179
"E501", # line too long - handled by formatter, remaining are strings/comments
169180
"W605", # invalid escape sequence
170-
"UP", # pyupgrade
171-
"C4", # flake8-comprehensions
172181
"UP006", # Use `list` instead of `List` for type annotation
173182
"UP035", # deprecated imports from typing module
174-
"DJ012",
175-
"DJ001",
176-
"DJ008",
183+
"UP007", # Use `X | Y` for type annotations instead of Optional/Union (defer to follow-up)
184+
"UP010", # Unnecessary `from __future__ import` (defer to follow-up)
185+
"UP015", # Unnecessary mode argument in open() (defer to follow-up)
186+
"UP017", # Use `datetime.UTC` alias (defer to follow-up)
187+
"UP032", # Use f-string instead of format() (defer to follow-up)
188+
"UP034", # Extraneous parentheses (defer to follow-up)
189+
"UP037", # Remove quotes from type annotation (defer to follow-up)
190+
"UP041", # Replace aliased errors with TimeoutError (defer to follow-up)
191+
"UP045", # Use `X | None` instead of Optional[X] (defer to follow-up)
192+
"C403", # Unnecessary list comprehension - set (defer to follow-up)
193+
"C408", # Unnecessary dict() call (defer to follow-up)
194+
"C417", # Unnecessary map() usage (defer to follow-up)
195+
"C420", # Unnecessary dict comprehension (defer to follow-up)
177196
]
178197

198+
[tool.ruff.lint.per-file-ignores]
199+
"__init__.py" = ["F401"] # unused imports in __init__ files
200+
"api_app/decorators.py" = ["N801"] # classproperty names are intentionally lowercase
201+
"api_app/models.py" = ["DJ012", "DJ001", "DJ008"]
202+
"api_app/analyzables_manager/models.py" = ["DJ001"]
203+
"api_app/analyzers_manager/models.py" = ["DJ008"]
204+
"api_app/visualizers_manager/models.py" = ["DJ008", "DJ001"]
205+
"authentication/models.py" = ["DJ008"]
206+
"api_app/data_model_manager/models.py" = ["DJ008", "DJ012"]
207+
"api_app/user_events_manager/**" = ["DJ012", "DJ001", "DJ008"]
208+
179209
[tool.ruff.lint.isort]
180210
known-first-party = ["certego_saas"]
181211

182212
[tool.ruff.format]
183213
quote-style = "double"
184214
indent-style = "space"
215+
216+
[tool.codereviewdoctor]
217+
disable = ["missing-reverse-migration"]

requirements/certego-requirements.txt

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

0 commit comments

Comments
 (0)