From b2f77ea6d336a5c7ac613b705402d67f603474da Mon Sep 17 00:00:00 2001 From: Davide Arcuri Date: Thu, 16 May 2024 14:05:35 +0200 Subject: [PATCH 1/9] ldap fix --- config/settings/base.py | 43 +++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/config/settings/base.py b/config/settings/base.py index 0ae5f334..9c2905ab 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -94,19 +94,12 @@ "guardian.backends.ObjectPermissionBackend", ] - -if use_ldap := env.bool("USE_LDAP", False): - AUTHENTICATION_BACKENDS = [ - "django_auth_ldap.backend.LDAPBackend" - "django.contrib.auth.backends.ModelBackend", - "guardian.backends.ObjectPermissionBackend", - ] -else: - AUTHENTICATION_BACKENDS = [ - "django.contrib.auth.backends.ModelBackend", - "allauth.account.auth_backends.AuthenticationBackend", - "guardian.backends.ObjectPermissionBackend", - ] +AUTHENTICATION_BACKENDS = [ + "django_auth_ldap.backend.LDAPBackend", + "django.contrib.auth.backends.ModelBackend", + "guardian.backends.ObjectPermissionBackend", + "allauth.account.auth_backends.AuthenticationBackend", +] AUTH_USER_MODEL = "users.User" LOGIN_REDIRECT_URL = "users:redirect" @@ -248,6 +241,7 @@ "root": {"level": DEBUG_LEVEL, "handlers": ["console"]}, "loggers": { "distributed": {"level": DEBUG_LEVEL, "handlers": ["console"]}, + "django_auth_ldap": {"level": DEBUG_LEVEL, "handlers": ["console"]}, }, } @@ -255,8 +249,8 @@ # ------------------------------------------------------------------------------ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) ACCOUNT_AUTHENTICATION_METHOD = "username" -ACCOUNT_EMAIL_REQUIRED = True -ACCOUNT_EMAIL_VERIFICATION = "mandatory" +ACCOUNT_EMAIL_REQUIRED = False +ACCOUNT_EMAIL_VERIFICATION = "optional" ACCOUNT_ADAPTER = "orochi.users.adapters.AccountAdapter" SOCIALACCOUNT_ADAPTER = "orochi.users.adapters.SocialAccountAdapter" @@ -285,16 +279,15 @@ # LDAP # ------------------------------------------------------------------------------ -if use_ldap: - AUTH_LDAP_SERVER_URI = env("AUTH_LDAP_SERVER_URI") - AUTH_LDAP_BIND_DN = env("AUTH_LDAP_BIND_DN") - AUTH_LDAP_BIND_PASSWORD = env("AUTH_LDAP_BIND_PASSWORD") - AUTH_LDAP_USER_SEARCH = LDAPSearch( - env("AUTH_LDAP_USER_SEARCH_DN"), - ldap.SCOPE_SUBTREE, - env("AUTH_LDAP_USER_SEARCH_ALIAS"), - ) - AUTH_LDAP_USER_ATTR_MAP = env.dict("AUTH_LDAP_USER_ATTR_MAP") +AUTH_LDAP_SERVER_URI = env("AUTH_LDAP_SERVER_URI") +AUTH_LDAP_BIND_DN = env("AUTH_LDAP_BIND_DN") +AUTH_LDAP_BIND_PASSWORD = env("AUTH_LDAP_BIND_PASSWORD") +AUTH_LDAP_USER_SEARCH = LDAPSearch( + env("AUTH_LDAP_USER_SEARCH_DN"), + ldap.SCOPE_SUBTREE, + env("AUTH_LDAP_USER_SEARCH_ALIAS"), +) +AUTH_LDAP_USER_ATTR_MAP = env.dict("AUTH_LDAP_USER_ATTR_MAP") # REST FRAMEWORK # ------------------------------------------------------------------------------- From 21833b855d6553c3656caa62998a4ea992e10723 Mon Sep 17 00:00:00 2001 From: Davide Arcuri Date: Tue, 4 Jun 2024 13:17:47 +0200 Subject: [PATCH 2/9] fix __init__ --- compose/local/__init__.py | 16 ++++++++++------ version.py | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/compose/local/__init__.py b/compose/local/__init__.py index fa92a296..bd93e7bd 100644 --- a/compose/local/__init__.py +++ b/compose/local/__init__.py @@ -44,8 +44,8 @@ # We use the SemVer 2.0.0 versioning scheme VERSION_MAJOR = 2 # Number of releases of the library with a breaking change -VERSION_MINOR = 5 # Number of changes that only add to the interface -VERSION_PATCH = 2 # Number of changes that do not change the interface +VERSION_MINOR = 7 # Number of changes that only add to the interface +VERSION_PATCH = 0 # Number of changes that do not change the interface VERSION_SUFFIX = "" # TODO: At version 2.0.0, remove the symbol_shift feature @@ -59,14 +59,18 @@ AUTOMAGIC_CONFIG_PATH = "automagic" """The root section within the context configuration for automagic values""" +LOGLEVEL_INFO = 20 +"""Logging level for information data, showed when use the requests any logging: -v""" +LOGLEVEL_DEBUG = 10 +"""Logging level for debugging data, showed when the user requests more logging detail: -vv""" LOGLEVEL_V = 9 -"""Logging level for a single -v""" +"""Logging level for the lowest "extra" level of logging: -vvv""" LOGLEVEL_VV = 8 -"""Logging level for -vv""" +"""Logging level for two levels of detail: -vvvv""" LOGLEVEL_VVV = 7 -"""Logging level for -vvv""" +"""Logging level for three levels of detail: -vvvvv""" LOGLEVEL_VVVV = 6 -"""Logging level for -vvvv""" +"""Logging level for four levels of detail: -vvvvvv""" CACHE_PATH = os.path.join(os.path.expanduser("~"), ".cache", "volatility3") """Default path to store cached data""" diff --git a/version.py b/version.py index 8a124bf6..ba51cedf 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -__version__ = "2.2.0" +__version__ = "2.2.2" From 0ccacd85f9a327f2ad6724a83aa83f7bab717037 Mon Sep 17 00:00:00 2001 From: garanews Date: Thu, 25 Jul 2024 15:11:38 +0200 Subject: [PATCH 3/9] Update Dockerfile --- compose/local/django/Dockerfile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index 31dc026a..fc6b61e6 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -54,10 +54,18 @@ RUN git clone --branch v4.3.x --recursive https://github.com/VirusTotal/yara-pyt WORKDIR /tmp/yara-python RUN python setup.py build -FROM base-builder as go-builder -WORKDIR / -RUN curl https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz --output go1.22.0.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz +FROM common-base AS go-builder +ARG TARGETPLATFORM + +RUN apt-get update && apt-get install -y curl +RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ + curl https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz --output go1.22.0.linux-amd64.tar.gz && \ + tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz; \ + elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ + curl https://dl.google.com/go/go1.22.0.linux-arm64.tar.gz --output go1.22.0.linux-arm64.tar.gz && \ + tar -C /usr/local -xzf go1.22.0.linux-arm64.tar.gz; \ + fi + RUN git clone https://github.com/volatilityfoundation/dwarf2json.git WORKDIR /dwarf2json RUN /usr/local/go/bin/go build From b7d4a37e17e3e8d78f072a598398210db3ae0ba8 Mon Sep 17 00:00:00 2001 From: garanews Date: Wed, 31 Jul 2024 09:56:38 +0200 Subject: [PATCH 4/9] Update Dockerfile --- compose/local/django/Dockerfile | 72 +++++++++++++++------------------ 1 file changed, 33 insertions(+), 39 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index fc6b61e6..fe81e696 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -1,51 +1,37 @@ -FROM python:3.12-slim-bookworm as common-base +# syntax=docker/dockerfile:1.3 +ARG TARGETPLATFORM +ARG BUILDPLATFORM + +FROM python:3.12-slim-bookworm AS common-base -ENV DJANGO_SETTINGS_MODULE config.settings.local -ENV PYTHONUNBUFFERED 1 -ENV PYTHONDONTWRITEBYTECODE 1 +ENV DJANGO_SETTINGS_MODULE=config.settings.local +ENV PYTHONUNBUFFERED=1 +ENV PYTHONDONTWRITEBYTECODE=1 ARG local_folder=/uploads RUN apt-get update \ - # dependencies for building Python packages && apt-get install -y --no-install-recommends build-essential \ - # ldap libsasl2-dev python3-dev libldap2-dev libssl-dev \ - # psycopg2 dependencies - libpq-dev \ - # archive - libmagic1 p7zip-full \ - # Translations dependencies - gettext \ - # git from yara cloning - git \ + libpq-dev libmagic1 p7zip-full gettext git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# App running in /app RUN mkdir -p /app -FROM common-base as base-builder +FROM common-base AS base-builder RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - # utils - curl unzip \ - # requirement to compile yara + && apt-get install --no-install-recommends -y curl unzip \ automake libtool make gcc pkg-config flex bison libssl-dev libjansson-dev libmagic-dev \ - # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* -# Build yara and yara-python from sources -FROM base-builder as yara-builder +FROM base-builder AS yara-builder WORKDIR /tmp RUN git clone --recursive https://github.com/VirusTotal/yara.git WORKDIR /tmp/yara RUN ./bootstrap.sh \ - && ./configure --enable-cuckoo \ - --enable-magic \ - --enable-dotnet \ - --with-crypto \ + && ./configure --enable-cuckoo --enable-magic --enable-dotnet --with-crypto \ && make \ && make install \ && echo "Install yara-python..." @@ -56,20 +42,28 @@ RUN python setup.py build FROM common-base AS go-builder ARG TARGETPLATFORM - RUN apt-get update && apt-get install -y curl -RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ - curl https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz --output go1.22.0.linux-amd64.tar.gz && \ - tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz; \ +RUN echo "Building for platform: $TARGETPLATFORM" \ + && if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ + apt-get install -y gcc-multilib \ + && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go.tar.gz \ + && rm go.tar.gz \ + && git clone https://github.com/volatilityfoundation/dwarf2json.git \ + && cd dwarf2json \ + && CC=gcc /usr/local/go/bin/go build; \ elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ - curl https://dl.google.com/go/go1.22.0.linux-arm64.tar.gz --output go1.22.0.linux-arm64.tar.gz && \ - tar -C /usr/local -xzf go1.22.0.linux-arm64.tar.gz; \ + apt-get install -y gcc-aarch64-linux-gnu \ + && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-arm64.tar.gz \ + && tar -C /usr/local -xzf go.tar.gz \ + && rm go.tar.gz \ + && git clone https://github.com/volatilityfoundation/dwarf2json.git \ + && cd dwarf2json \ + && CC=aarch64-linux-gnu-gcc /usr/local/go/bin/go build; \ + else \ + echo "Unsupported platform: $TARGETPLATFORM" && exit 1; \ fi -RUN git clone https://github.com/volatilityfoundation/dwarf2json.git -WORKDIR /dwarf2json -RUN /usr/local/go/bin/go build - FROM common-base WORKDIR / COPY ./requirements /requirements @@ -92,8 +86,8 @@ RUN sed -i 's/\r$//g' /start RUN chmod +x /start COPY --from=go-builder /dwarf2json/dwarf2json /dwarf2json/dwarf2json -# Install yara-python -COPY --from=yara-builder /tmp/yara-python/ /tmp/ + +COPY --from=yara-builder /tmp/yara-python/ /tmp/ WORKDIR /tmp RUN python setup.py install From 6375f6a53b7d29b044856d6a1fc8f42a8185f591 Mon Sep 17 00:00:00 2001 From: garanews Date: Thu, 1 Aug 2024 14:16:43 +0200 Subject: [PATCH 5/9] Update Dockerfile --- compose/local/django/Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index fe81e696..97940e03 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -1,8 +1,6 @@ # syntax=docker/dockerfile:1.3 -ARG TARGETPLATFORM -ARG BUILDPLATFORM - -FROM python:3.12-slim-bookworm AS common-base +FROM --platform=$BUILDPLATFORM python:3.12-slim-bookworm AS common-base +ARG TARGETARCH ENV DJANGO_SETTINGS_MODULE=config.settings.local ENV PYTHONUNBUFFERED=1 @@ -41,10 +39,10 @@ WORKDIR /tmp/yara-python RUN python setup.py build FROM common-base AS go-builder -ARG TARGETPLATFORM +ARG TARGETARCH RUN apt-get update && apt-get install -y curl -RUN echo "Building for platform: $TARGETPLATFORM" \ - && if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \ +RUN echo "Building for platform: $TARGETARCH" \ + && if [ "$TARGETARCH" = "amd64" ]; then \ apt-get install -y gcc-multilib \ && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz \ && tar -C /usr/local -xzf go.tar.gz \ @@ -52,7 +50,7 @@ RUN echo "Building for platform: $TARGETPLATFORM" \ && git clone https://github.com/volatilityfoundation/dwarf2json.git \ && cd dwarf2json \ && CC=gcc /usr/local/go/bin/go build; \ - elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \ + elif [ "$TARGETARCH" = "arm64" ]; then \ apt-get install -y gcc-aarch64-linux-gnu \ && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-arm64.tar.gz \ && tar -C /usr/local -xzf go.tar.gz \ @@ -61,7 +59,7 @@ RUN echo "Building for platform: $TARGETPLATFORM" \ && cd dwarf2json \ && CC=aarch64-linux-gnu-gcc /usr/local/go/bin/go build; \ else \ - echo "Unsupported platform: $TARGETPLATFORM" && exit 1; \ + echo "Unsupported platform: $TARGETARCH" && exit 1; \ fi FROM common-base From 719be50bbfcae57e3947f678d7c7198873cdeb8e Mon Sep 17 00:00:00 2001 From: garanews Date: Wed, 7 Aug 2024 15:52:38 +0200 Subject: [PATCH 6/9] Update Dockerfile --- compose/local/django/Dockerfile | 84 +++++++++++++-------------------- 1 file changed, 32 insertions(+), 52 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index 97940e03..ce323516 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -1,75 +1,59 @@ -# syntax=docker/dockerfile:1.3 -FROM --platform=$BUILDPLATFORM python:3.12-slim-bookworm AS common-base -ARG TARGETARCH +FROM python:3.12.4-slim-bookworm as common-base -ENV DJANGO_SETTINGS_MODULE=config.settings.local -ENV PYTHONUNBUFFERED=1 -ENV PYTHONDONTWRITEBYTECODE=1 +ENV DJANGO_SETTINGS_MODULE config.settings.local +ENV PYTHONUNBUFFERED 1 +ENV PYTHONDONTWRITEBYTECODE 1 ARG local_folder=/uploads RUN apt-get update \ + # dependencies for building Python packages && apt-get install -y --no-install-recommends build-essential \ + # ldap libsasl2-dev python3-dev libldap2-dev libssl-dev \ - libpq-dev libmagic1 p7zip-full gettext git \ + # psycopg2 dependencies + libpq-dev \ + # archive + libmagic1 p7zip-full \ + # Translations dependencies + gettext \ + # git for cloning + git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# App running in /app RUN mkdir -p /app -FROM common-base AS base-builder +FROM common-base as base-builder RUN apt-get update \ - && apt-get install --no-install-recommends -y curl unzip \ - automake libtool make gcc pkg-config flex bison libssl-dev libjansson-dev libmagic-dev \ + && apt-get install --no-install-recommends -y \ + # utils + curl unzip \ + # cleaning up unused files && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* -FROM base-builder AS yara-builder -WORKDIR /tmp -RUN git clone --recursive https://github.com/VirusTotal/yara.git -WORKDIR /tmp/yara -RUN ./bootstrap.sh \ - && ./configure --enable-cuckoo --enable-magic --enable-dotnet --with-crypto \ - && make \ - && make install \ - && echo "Install yara-python..." -WORKDIR /tmp -RUN git clone --branch v4.3.x --recursive https://github.com/VirusTotal/yara-python -WORKDIR /tmp/yara-python -RUN python setup.py build - -FROM common-base AS go-builder -ARG TARGETARCH -RUN apt-get update && apt-get install -y curl -RUN echo "Building for platform: $TARGETARCH" \ - && if [ "$TARGETARCH" = "amd64" ]; then \ - apt-get install -y gcc-multilib \ - && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf go.tar.gz \ - && rm go.tar.gz \ - && git clone https://github.com/volatilityfoundation/dwarf2json.git \ - && cd dwarf2json \ - && CC=gcc /usr/local/go/bin/go build; \ - elif [ "$TARGETARCH" = "arm64" ]; then \ - apt-get install -y gcc-aarch64-linux-gnu \ - && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-arm64.tar.gz \ - && tar -C /usr/local -xzf go.tar.gz \ - && rm go.tar.gz \ - && git clone https://github.com/volatilityfoundation/dwarf2json.git \ - && cd dwarf2json \ - && CC=aarch64-linux-gnu-gcc /usr/local/go/bin/go build; \ - else \ - echo "Unsupported platform: $TARGETARCH" && exit 1; \ - fi +FROM golang:alpine3.20 as go-builder +RUN apk add git +WORKDIR / +RUN git clone https://github.com/volatilityfoundation/dwarf2json.git +WORKDIR /dwarf2json +RUN /usr/local/go/bin/go build FROM common-base WORKDIR / COPY ./requirements /requirements -RUN pip install uv==0.1.21 -e git+https://github.com/volatilityfoundation/volatility3.git@55dd39f2ba60ffdd2126b7ea011940f0df42815a#egg=volatility3 \ +RUN pip install uv==0.2.31 -e git+https://github.com/dadokkio/volatility3.git@f740146f692ba288f376a939b24b1c1a8f7cf5e2#egg=volatility3 \ && uv pip install --no-cache --system -r /requirements/base.txt COPY ./compose/local/__init__.py /src/volatility3/volatility3/framework/constants/__init__.py +#EXPERIMENTAL SUPPORT FOR ARM64 +COPY ./compose/local/linux.py /src/volatility3/volatility3/framework/automagic/linux.py +COPY ./compose/local/arm.py /src/volatility3/volatility3/framework/layers/arm.py +RUN sed -i 's/\["Intel32", "Intel64"\]/\["Intel32", "Intel64", "AArch64"\]/g' /src/volatility3/volatility3/framework/plugins/linux/*.py + RUN mkdir -p $local_folder /maxmind COPY ./compose/local/maxmind /maxmind @@ -85,9 +69,5 @@ RUN chmod +x /start COPY --from=go-builder /dwarf2json/dwarf2json /dwarf2json/dwarf2json -COPY --from=yara-builder /tmp/yara-python/ /tmp/ -WORKDIR /tmp -RUN python setup.py install - WORKDIR /app ENTRYPOINT ["/entrypoint"] From 9c4f7a0ff02791d4bf2071e3f2caafb2419e7083 Mon Sep 17 00:00:00 2001 From: garanews Date: Wed, 7 Aug 2024 15:58:13 +0200 Subject: [PATCH 7/9] Update Dockerfile --- compose/local/django/Dockerfile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index ce323516..c4cded92 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -49,11 +49,6 @@ RUN pip install uv==0.2.31 -e git+https://github.com/dadokkio/volatility3.git@f7 COPY ./compose/local/__init__.py /src/volatility3/volatility3/framework/constants/__init__.py -#EXPERIMENTAL SUPPORT FOR ARM64 -COPY ./compose/local/linux.py /src/volatility3/volatility3/framework/automagic/linux.py -COPY ./compose/local/arm.py /src/volatility3/volatility3/framework/layers/arm.py -RUN sed -i 's/\["Intel32", "Intel64"\]/\["Intel32", "Intel64", "AArch64"\]/g' /src/volatility3/volatility3/framework/plugins/linux/*.py - RUN mkdir -p $local_folder /maxmind COPY ./compose/local/maxmind /maxmind From 8ae127a3d60fe874dd6d87a1e1970e811602e693 Mon Sep 17 00:00:00 2001 From: Davide Arcuri Date: Wed, 7 Aug 2024 16:36:51 +0200 Subject: [PATCH 8/9] #1100 --- orochi/website/management/commands/import_local.py | 9 ++------- orochi/website/management/commands/plugins_sync.py | 9 ++------- version.py | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/orochi/website/management/commands/import_local.py b/orochi/website/management/commands/import_local.py index 85dbfdf4..581e3f92 100644 --- a/orochi/website/management/commands/import_local.py +++ b/orochi/website/management/commands/import_local.py @@ -6,13 +6,8 @@ from django.core.management.base import BaseCommand from django.db import transaction -from orochi.website.models import ( - RESULT_STATUS_NOT_STARTED, - RESULT_STATUS_RUNNING, - Dump, - Result, - UserPlugin, -) +from orochi.website.defaults import RESULT_STATUS_NOT_STARTED, RESULT_STATUS_RUNNING +from orochi.website.models import Dump, Result, UserPlugin from orochi.website.views import index_f_and_f diff --git a/orochi/website/management/commands/plugins_sync.py b/orochi/website/management/commands/plugins_sync.py index de683c10..34ae3297 100644 --- a/orochi/website/management/commands/plugins_sync.py +++ b/orochi/website/management/commands/plugins_sync.py @@ -4,13 +4,8 @@ from volatility3 import framework from volatility3.framework import contexts -from orochi.website.models import ( - RESULT_STATUS_NOT_STARTED, - Dump, - Plugin, - Result, - UserPlugin, -) +from orochi.website.defaults import RESULT_STATUS_NOT_STARTED +from orochi.website.models import Dump, Plugin, Result, UserPlugin class Command(BaseCommand): diff --git a/version.py b/version.py index ba51cedf..f394e699 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -__version__ = "2.2.2" +__version__ = "2.2.3" From 7935eddd9bc9dfb45d378d0c82fa55d42bcd1828 Mon Sep 17 00:00:00 2001 From: Davide Arcuri Date: Thu, 8 Aug 2024 20:10:48 +0200 Subject: [PATCH 9/9] 2.2.3 --- compose/local/django/Dockerfile | 79 ++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index c4cded92..3626b268 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -1,50 +1,71 @@ -FROM python:3.12.4-slim-bookworm as common-base +# syntax=docker/dockerfile:1.3 +FROM --platform=$BUILDPLATFORM python:3.12-slim-bookworm AS common-base +ARG TARGETARCH -ENV DJANGO_SETTINGS_MODULE config.settings.local -ENV PYTHONUNBUFFERED 1 -ENV PYTHONDONTWRITEBYTECODE 1 +ENV DJANGO_SETTINGS_MODULE=config.settings.local +ENV PYTHONUNBUFFERED=1 +ENV PYTHONDONTWRITEBYTECODE=1 ARG local_folder=/uploads RUN apt-get update \ - # dependencies for building Python packages && apt-get install -y --no-install-recommends build-essential \ - # ldap libsasl2-dev python3-dev libldap2-dev libssl-dev \ - # psycopg2 dependencies - libpq-dev \ - # archive - libmagic1 p7zip-full \ - # Translations dependencies - gettext \ - # git for cloning - git \ + libpq-dev libmagic1 p7zip-full gettext git \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# App running in /app RUN mkdir -p /app -FROM common-base as base-builder +FROM common-base AS base-builder RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - # utils - curl unzip \ - # cleaning up unused files + && apt-get install --no-install-recommends -y curl unzip \ + automake libtool make gcc pkg-config flex bison libssl-dev libjansson-dev libmagic-dev \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* -FROM golang:alpine3.20 as go-builder -RUN apk add git -WORKDIR / -RUN git clone https://github.com/volatilityfoundation/dwarf2json.git -WORKDIR /dwarf2json -RUN /usr/local/go/bin/go build +FROM base-builder AS yara-builder +WORKDIR /tmp +RUN git clone --recursive https://github.com/VirusTotal/yara.git +WORKDIR /tmp/yara +RUN ./bootstrap.sh \ + && ./configure --enable-cuckoo --enable-magic --enable-dotnet --with-crypto \ + && make \ + && make install \ + && echo "Install yara-python..." +WORKDIR /tmp +RUN git clone --branch v4.3.x --recursive https://github.com/VirusTotal/yara-python +WORKDIR /tmp/yara-python +RUN python setup.py build + +FROM common-base AS go-builder +ARG TARGETARCH +RUN apt-get update && apt-get install -y curl +RUN echo "Building for platform: $TARGETARCH" \ + && if [ "$TARGETARCH" = "amd64" ]; then \ + apt-get install -y gcc-multilib \ + && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz \ + && tar -C /usr/local -xzf go.tar.gz \ + && rm go.tar.gz \ + && git clone https://github.com/volatilityfoundation/dwarf2json.git \ + && cd dwarf2json \ + && CC=gcc /usr/local/go/bin/go build; \ + elif [ "$TARGETARCH" = "arm64" ]; then \ + apt-get install -y gcc-aarch64-linux-gnu \ + && curl -Lo go.tar.gz https://dl.google.com/go/go1.22.0.linux-arm64.tar.gz \ + && tar -C /usr/local -xzf go.tar.gz \ + && rm go.tar.gz \ + && git clone https://github.com/volatilityfoundation/dwarf2json.git \ + && cd dwarf2json \ + && CC=aarch64-linux-gnu-gcc /usr/local/go/bin/go build; \ + else \ + echo "Unsupported platform: $TARGETARCH" && exit 1; \ + fi FROM common-base WORKDIR / COPY ./requirements /requirements -RUN pip install uv==0.2.31 -e git+https://github.com/dadokkio/volatility3.git@f740146f692ba288f376a939b24b1c1a8f7cf5e2#egg=volatility3 \ +RUN pip install uv==0.1.21 -e git+https://github.com/volatilityfoundation/volatility3.git@55dd39f2ba60ffdd2126b7ea011940f0df42815a#egg=volatility3 \ && uv pip install --no-cache --system -r /requirements/base.txt COPY ./compose/local/__init__.py /src/volatility3/volatility3/framework/constants/__init__.py @@ -64,5 +85,9 @@ RUN chmod +x /start COPY --from=go-builder /dwarf2json/dwarf2json /dwarf2json/dwarf2json +COPY --from=yara-builder /tmp/yara-python/ /tmp/ +WORKDIR /tmp +RUN python setup.py install + WORKDIR /app ENTRYPOINT ["/entrypoint"]