-
Notifications
You must be signed in to change notification settings - Fork 202
Expand file tree
/
Copy pathDockerfile
More file actions
112 lines (90 loc) · 2.79 KB
/
Dockerfile
File metadata and controls
112 lines (90 loc) · 2.79 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Build Iris
FROM golang:1.17 AS build
# Set Go modules to "on" to avoid issues with GOPATH
ENV GO111MODULE=on
ENV GOPATH=""
COPY iris/go.mod ./
COPY iris/go.sum ./
RUN go mod download
COPY iris/cmd ./cmd
COPY iris/pkg ./pkg
RUN go build -o /iris/iris cmd/peercli.go
FROM ubuntu:22.04
# To avoid user interaction when installing libraries
ENV DEBIAN_FRONTEND=noninteractive
# Blocking module requirement to avoid using sudo
ENV IS_IN_A_DOCKER_CONTAINER=True
# destionation dir for slips inside the container
ENV SLIPS_DIR=/StratosphereLinuxIPS
ENV NODE_VERSION=22.5.0
ENV NVM_DIR=/root/.nvm
# use bash instead of sh
SHELL ["/bin/bash", "-c"]
RUN apt update && apt install -y --no-install-recommends \
wget \
ca-certificates \
git \
curl \
gnupg \
lsb-release \
software-properties-common \
build-essential \
file \
lsof \
iptables \
iproute2 \
nfdump \
tshark \
whois \
yara \
net-tools \
vim \
less \
unzip \
golang \
python3-certifi \
python3-dev \
python3-tzlocal \
python3-pip \
nano \
tree \
tmux \
arp-scan \
&& echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_22.04/ /' | tee /etc/apt/sources.list.d/security:zeek.list \
&& curl -fsSL https://download.opensuse.org/repositories/security:zeek/xUbuntu_22.04/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/security_zeek.gpg > /dev/null \
&& apt update \
&& apt install -y --no-install-recommends --fix-missing \
zeek \
npm \
&& ln -s /opt/zeek/bin/zeek /usr/local/bin/bro \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - \
&& export NVM_DIR="$HOME/.nvm" \
&& [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" \
&& nvm install 22
# why are we compiling redis instead od just using apt?
# to support running slips on the rpi (arm64). the rpi uses jemmalloc by default, which expects a different page size
# than the default on x86_64
RUN pip3 install --no-cache-dir --upgrade pip \
&& git clone https://github.com/redis/redis \
&& cd redis \
&& make distclean \
&& make MALLOC=libc
ENV PATH="$PATH:/redis/src"
# Switch to Slips installation dir on login.
WORKDIR ${SLIPS_DIR}
COPY . $SLIPS_DIR
# Retrieve Iris
COPY --from=build /iris/iris ./modules/irisModule
RUN pip install --ignore-installed --no-cache-dir -r install/requirements.txt \
&& chmod 774 slips.py \
&& git init \
&& git remote add origin https://github.com/stratosphereips/StratosphereLinuxIPS.git \
&& cd modules/kalipso \
&& npm install \
&& cd ../../p2p4slips \
&& go build
ENV PATH="$PATH:/StratosphereLinuxIPS/p2p4slips/"
WORKDIR ${SLIPS_DIR}
CMD /bin/bash