|
| 1 | +FROM alpine |
| 2 | +MAINTAINER Patrick Copeland ptcnop |
| 3 | + |
| 4 | +ENV YARA_VERSION 3.8.1 |
| 5 | +ENV YARA_PY_VERSION 3.8.1 |
| 6 | +ENV SSDEEP ssdeep-2.13 |
| 7 | + |
| 8 | +COPY requirements.txt /opt/multiscanner/ |
| 9 | + |
| 10 | +RUN apk add --no-cache \ |
| 11 | + bash \ |
| 12 | + bison \ |
| 13 | + file \ |
| 14 | + jansson \ |
| 15 | + jpeg \ |
| 16 | + libffi \ |
| 17 | + python3 \ |
| 18 | + su-exec \ |
| 19 | + tini \ |
| 20 | + zip \ |
| 21 | + zlib \ |
| 22 | + && apk add --no-cache -t .build-deps \ |
| 23 | + autoconf \ |
| 24 | + automake \ |
| 25 | + build-base \ |
| 26 | + file-dev \ |
| 27 | + flex \ |
| 28 | + git \ |
| 29 | + jansson-dev \ |
| 30 | + jpeg-dev \ |
| 31 | + libc-dev \ |
| 32 | + libffi-dev \ |
| 33 | + libtool \ |
| 34 | + musl-dev \ |
| 35 | + postgresql-dev \ |
| 36 | + py3-pip \ |
| 37 | + python3-dev \ |
| 38 | + zlib-dev \ |
| 39 | + # ssdeep |
| 40 | + && echo "Install ssdeep from source..." \ |
| 41 | + && cd /tmp \ |
| 42 | + && wget -O /tmp/$SSDEEP.tar.gz https://downloads.sourceforge.net/project/ssdeep/$SSDEEP/$SSDEEP.tar.gz \ |
| 43 | + && tar zxvf $SSDEEP.tar.gz \ |
| 44 | + && cd $SSDEEP \ |
| 45 | + && ./configure \ |
| 46 | + && make \ |
| 47 | + && make install \ |
| 48 | + # yara |
| 49 | + && echo "Install Yara from source..." \ |
| 50 | + && cd /tmp/ \ |
| 51 | + && git clone --recursive --branch v$YARA_VERSION https://github.com/VirusTotal/yara.git \ |
| 52 | + && cd /tmp/yara \ |
| 53 | + && ./bootstrap.sh \ |
| 54 | + && sync \ |
| 55 | + && ./configure --with-crypto \ |
| 56 | + --enable-magic \ |
| 57 | + --enable-cuckoo \ |
| 58 | + --enable-dotnet \ |
| 59 | + && make \ |
| 60 | + && make install \ |
| 61 | + && echo "Install yara-python..." \ |
| 62 | + && cd /tmp/ \ |
| 63 | + && git clone --recursive --branch v$YARA_PY_VERSION https://github.com/VirusTotal/yara-python \ |
| 64 | + && cd yara-python \ |
| 65 | + && python3 setup.py build --dynamic-linking \ |
| 66 | + && python3 setup.py install \ |
| 67 | + && echo "Downloading yara signatures..." \ |
| 68 | + && git clone --depth 1 https://github.com/Yara-Rules/rules.git /opt/multiscanner/etc/yarasigs/Yara-Rules \ |
| 69 | + # install ms dependencies |
| 70 | + && cd /opt/multiscanner \ |
| 71 | + && pip3 install --upgrade pip \ |
| 72 | + && pip3 install -r requirements.txt \ |
| 73 | + # clean up |
| 74 | + && rm -rf /tmp/* \ |
| 75 | + && apk del --purge .build-deps |
| 76 | + |
| 77 | +COPY . /opt/multiscanner |
| 78 | +COPY ./docker_utils/*.ini /opt/multiscanner/ |
| 79 | +COPY ./etc/pdf_config.json /opt/multiscanner/ |
| 80 | +COPY ./etc/ember_model_2017.txt /opt/multiscanner/etc/ember/ |
| 81 | + |
| 82 | +WORKDIR /opt/multiscanner |
| 83 | + |
| 84 | +RUN pip3 install . |
| 85 | + |
| 86 | +RUN wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -O /wait-for-it.sh \ |
| 87 | + && chmod +x /wait-for-it.sh |
| 88 | + |
| 89 | +# Run script |
| 90 | +CMD multiscanner |
0 commit comments