Skip to content

Commit

Permalink
Adding binaries directory which allows for hosting binaries incase of…
Browse files Browse the repository at this point in the history
… a instance without internet access.

Binaries are cracker binaries or any other binaries that need to be downloaded by the agents
  • Loading branch information
zyronix committed Aug 11, 2023
1 parent 9f48878 commit 2cdd93e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions 000-default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@
<Directory /var/www/html/src/api/v2>
AllowOverride All
</Directory>

Alias /binaries ${HASHTOPOLIS_BINARIES_PATH}
<Directory ${HASHTOPOLIS_BINARIES_PATH}>
Require all granted
</Directory>
</VirtualHost>
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ENV HASHTOPOLIS_FILES_PATH=${HASHTOPOLIS_PATH}/files
ENV HASHTOPOLIS_IMPORT_PATH=${HASHTOPOLIS_PATH}/import
ENV HASHTOPOLIS_LOG_PATH=${HASHTOPOLIS_PATH}/log
ENV HASHTOPOLIS_CONFIG_PATH=${HASHTOPOLIS_PATH}/config
ENV HASHTOPOLIS_BINARIES_PATH=${HASHTOPOLIS_PATH}/binaries

# Add support for TLS inspection corporate setups, see .env.sample for details
ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
Expand Down Expand Up @@ -66,7 +67,10 @@ RUN mkdir -p ${HASHTOPOLIS_DOCUMENT_ROOT} \
&& chmod g+w ${HASHTOPOLIS_LOG_PATH} \
&& mkdir -p ${HASHTOPOLIS_CONFIG_PATH} \
&& chown www-data:www-data ${HASHTOPOLIS_CONFIG_PATH} \
&& chmod g+w ${HASHTOPOLIS_CONFIG_PATH}
&& chmod g+w ${HASHTOPOLIS_CONFIG_PATH} \
&& mkdir -p ${HASHTOPOLIS_BINARIES_PATH} \
&& chown www-data:www-data ${HASHTOPOLIS_BINARIES_PATH} \
&& chmod g+w ${HASHTOPOLIS_BINARIES_PATH}

COPY --from=preprocess /HEA[D] ${HASHTOPOLIS_DOCUMENT_ROOT}/../.git/

Expand All @@ -78,7 +82,7 @@ COPY docker-entrypoint.sh /usr/local/bin

# Setting the hashtopolis document root is done at build time. Because the www-data user cannot write to the apache config folder.
COPY 000-default.conf /tmp/
RUN envsubst '${HASHTOPOLIS_DOCUMENT_ROOT}' < /tmp/000-default.conf > /etc/apache2/sites-available/000-default.conf && rm /tmp/000-default.conf
RUN envsubst '${HASHTOPOLIS_DOCUMENT_ROOT} ${HASHTOPOLIS_BINARIES_PATH}' < /tmp/000-default.conf > /etc/apache2/sites-available/000-default.conf && rm /tmp/000-default.conf

ENTRYPOINT [ "docker-entrypoint.sh" ]
# ----END----
Expand Down
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ fi
if [ ! -d ${HASHTOPOLIS_IMPORT_PATH} ];then
mkdir -p ${HASHTOPOLIS_IMPORT_PATH} && chown www-data:www-data ${HASHTOPOLIS_IMPORT_PATH}
fi
if [ ! -d ${HASHTOPOLIS_BINARIES_PATH} ];then
mkdir -p ${HASHTOPOLIS_BINARIES_PATH} && chown www-data:www-data ${HASHTOPOLIS_BINARIES_PATH}
fi

# required to trigger the initialization
echo "Start initialization process..."
Expand Down

0 comments on commit 2cdd93e

Please sign in to comment.