forked from target/strelka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
84 lines (80 loc) · 2.23 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Strelka container is based on Ubuntu Bionic LTS
FROM ubuntu:18.04
LABEL maintainer "Target Brands, Inc. [email protected]"
ARG YARA_VERSION=3.8.1
ARG YARA_PYTHON_VERSION=3.8.1
# Copy Strelka files
COPY . /opt/strelka/
# Update packages
RUN apt-get -qq update && \
apt-get install --no-install-recommends -qq \
# Install build packages
automake \
build-essential \
curl \
gcc \
git \
libtool \
make \
protobuf-compiler \
python3-dev \
python3-pip \
python3-wheel \
# Install runtime packages
antiword \
libarchive-dev \
libfuzzy-dev \
libimage-exiftool-perl \
libmagic-dev \
libssl-dev \
python3-setuptools \
tesseract-ocr \
unrar \
upx \
jq && \
# Install Python packages
pip3 install -r /opt/strelka/requirements.txt && \
# Install YARA
cd /tmp/ && \
curl -OL https://github.com/VirusTotal/yara/archive/v$YARA_VERSION.tar.gz && \
tar -zxvf v$YARA_VERSION.tar.gz && \
cd yara-$YARA_VERSION/ && \
./bootstrap.sh && \
./configure --with-crypto --enable-dotnet --enable-magic && \
make && make install && make check && \
# Install yara-python
cd /tmp/ && \
curl -OL https://github.com/VirusTotal/yara-python/archive/v$YARA_PYTHON_VERSION.tar.gz && \
tar -zxvf v$YARA_PYTHON_VERSION.tar.gz && \
cd yara-python-$YARA_PYTHON_VERSION/ && \
python3 setup.py build --dynamic-linking && \
python3 setup.py install && \
# Compile protobuf
cd /opt/strelka/server/ && \
protoc --python_out=. strelka.proto && \
# Install Strelka
cd /opt/strelka/ && \
python3 setup.py -q build && \
python3 setup.py -q install && \
python3 setup.py -q clean --all && \
# Remove build packages
apt-get autoremove -qq --purge \
automake \
build-essential \
curl \
gcc \
git \
libtool \
make \
protobuf-compiler \
python3-dev \
python3-pip \
python3-wheel && \
apt-get purge -qq python3-setuptools && \
apt-get clean -qq && \
rm -rf /var/lib/apt/lists/* opt/strelka/ /tmp/yara* && \
# Assign permissions to Strelka scan result logging directory
mkdir /var/log/strelka/ && \
chgrp -R 0 /var/log/strelka/ && \
chmod -R g=u /var/log/strelka/
USER 1001