Skip to content

Commit

Permalink
Cleanup and fixes for build
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaferrera committed Jun 18, 2020
1 parent dcf6b11 commit ebd9193
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ ENV USER stoq
ENV GROUP stoq
ENV STOQ_HOME /home/$USER/.stoq
ENV STOQ_TMP /tmp/stoq
ENV XORSEARCH_VER 1_11_2
ENV EXIFTOOL_VER 11.91
ENV XORSEARCH_VER 1_11_3
ENV EXIFTOOL_VER 12.00

RUN groupadd -r $GROUP && \
useradd -r -g $GROUP $USER && \
Expand All @@ -32,22 +32,26 @@ RUN apt-get update && \
swig \
lib32ncurses6 && \
apt-get clean -y && \
pip install six
rm -rf /var/lib/apt/lists/*

COPY . ${STOQ_TMP}

WORKDIR ${STOQ_TMP}

# Install stoQ
RUN python3 setup.py install

# Install stoQ plugins and related binaries
RUN git clone --depth 1 -b v3 https://github.com/PUNCH-Cyber/stoq-plugins-public ${STOQ_TMP}/stoq-plugins-public && \
# Install stoQ and plugins
RUN pip install --no-cache-dir six && \
python3 setup.py install && \
git clone --depth 1 -b v3 https://github.com/PUNCH-Cyber/stoq-plugins-public ${STOQ_TMP}/stoq-plugins-public && \
cd ${STOQ_TMP}/stoq-plugins-public && \
for plugin in $(ls -d */); do stoq install $plugin; done

# Ensure the latest version of the IANA TLDs are in the appropriate place for the iocextract plugin
ADD https://data.iana.org/TLD/tlds-alpha-by-domain.txt $STOQ_HOME/plugins/iocextract/

RUN chmod 644 $STOQ_HOME/plugins/iocextract/tlds-alpha-by-domain.txt

# Install xorsearch
RUN wget -O XORSearch.zip "https://didierstevens.com/files/software/XORSearch_V${XORSEARCH_VER}.zip" && \
RUN wget -O XORSearch.zip "https://github.com/DidierStevens/FalsePositives/blob/master/XORSearch_V${XORSEARCH_VER}.zip?raw=true" && \
unzip -qq XORSearch -d XORSearch && \
gcc -o /usr/local/bin/xorsearch XORSearch/XORSearch.c

Expand All @@ -67,13 +71,9 @@ RUN wget -O trid_linux_64.zip "http://mark0.net/download/trid_linux_64.zip" && \
wget -O triddefs.zip "http://mark0.net/download/triddefs.zip" && \
unzip -qq triddefs -d $STOQ_HOME/plugins/trid

# Ensure the latest version of the IANA TLDs are in the appropriate place for the iocextract plugin
ADD https://data.iana.org/TLD/tlds-alpha-by-domain.txt $STOQ_HOME/plugins/iocextract/

RUN chmod 644 $STOQ_HOME/plugins/iocextract/tlds-alpha-by-domain.txt

# Clean up
RUN rm -rf /var/lib/apt/lists/* $STOQ_TMP /tmp/* /var/tmp/*
RUN rm -rf $STOQ_TMP /tmp/* /var/tmp/*

WORKDIR $STOQ_HOME
USER $USER
ENTRYPOINT ["stoq"]

1 comment on commit ebd9193

@malvidin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I separated the stoQ and stoQ plugins installation because they are managed in different projects.
Would it be appropriate to add a Dockerfile for just stoQ, and then add a Dockerfile in the stoQ plugins project that does the plugin installation with the binary dependencies?

Please sign in to comment.