Skip to content

Commit

Permalink
Merge pull request #330 from ryanohoro/warnings
Browse files Browse the repository at this point in the history
Address Warnings, Remove Redundant Python setup/requirements
  • Loading branch information
phutelmyer authored Feb 19, 2023
2 parents 5ca8668 + e3f2447 commit ce66caf
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 91 deletions.
12 changes: 5 additions & 7 deletions build/python/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,14 @@ RUN mkdir jtr && cd jtr && git init && git remote add origin https://github.com/
&& chmod -R 777 /jtr \
&& chown -R 1001:1001 /jtr

# Install Python packages
COPY ./build/python/backend/requirements.txt /strelka/requirements.txt
RUN pip3 install --no-cache-dir -r /strelka/requirements.txt && \
pip3 install --index-url https://lief-project.github.io/packages --trusted-host lief.quarkslab.com lief

# Copy Strelka files
COPY ./src/python/ /strelka/
COPY ./build/python/backend/setup.py /strelka/setup.py
COPY ./configs/python/backend/ /etc/strelka/

# Install Python packages
RUN pip3 install --no-cache-dir -r /strelka/requirements.txt && \
pip3 install --index-url https://lief-project.github.io/packages --trusted-host lief.quarkslab.com lief

# Install Strelka
RUN cd /strelka/ && \
python3 setup.py -q build && \
Expand Down Expand Up @@ -191,7 +189,7 @@ USER $USERNAME
# Run build checks
RUN echo '[+] Run build checks' && \
cd /strelka/strelka/ && \
python3 -m pytest -s tests/ && \
python3 -m pytest -p no:cacheprovider -s tests/ && \
if $CONFIG_TESTS; then python3 -m pytest -s tests_configuration/; fi && \
echo '[+] Done'

Expand Down
69 changes: 0 additions & 69 deletions build/python/backend/requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions build/python/backend/setup.py

This file was deleted.

1 change: 0 additions & 1 deletion src/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

setuptools.setup(
name="strelka",
namespace=strelka.__namespace__,
version=strelka.__version__,
author="Target Brands, Inc.",
description="strelka: container-based file analysis at scale",
Expand Down
4 changes: 4 additions & 0 deletions src/python/strelka/scanners/scan_encrypted_doc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import io
import logging
import os
import subprocess
import tempfile
Expand All @@ -7,6 +8,9 @@

from strelka import strelka

# Set logging level to INFO to prevent passwords from getting logged
logging.getLogger("msoffcrypto").setLevel(logging.INFO)


def crack_word(
self,
Expand Down
2 changes: 1 addition & 1 deletion src/python/strelka/scanners/scan_lsb.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class ScanLsb(strelka.Scanner):

def scan(self, data, file, options, expire_at):
try:
image = np.fromstring(data, np.uint8)
image = np.frombuffer(data, np.uint8)
image = cv2.imdecode(image, cv2.IMREAD_COLOR)
bits = self._get_bits(image)
bytes_ = self._get_bytes(bits)
Expand Down
2 changes: 1 addition & 1 deletion src/python/strelka/scanners/scan_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ScanNf(strelka.Scanner):
def scan(self, data, file, options, expire_at):
try:
# Convert image to HSV color space
np_array = np.fromstring(data, np.uint8)
np_array = np.frombuffer(data, np.uint8)
np_image = cv2.imdecode(
np_array, cv2.IMREAD_IGNORE_ORIENTATION | cv2.IMREAD_COLOR
)
Expand Down

0 comments on commit ce66caf

Please sign in to comment.