-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
58 lines (52 loc) · 2.32 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
FROM python:3.7
LABEL maintainer="Team Stingar <[email protected]>"
LABEL name="cowrie"
LABEL version="1.9.2"
LABEL release="1"
LABEL summary="Cowrie HoneyPot container"
LABEL description="Cowrie is a medium interaction SSH and Telnet honeypot designed to log brute force attacks and the shell interaction performed by the attacker."
LABEL authoritative-source-url="https://github.com/CommunityHoneyNetwork/cowrie"
LABEL changelog-url="https://github.com/CommunityHoneyNetwork/cowrie/commits/master"
# Set DOCKER var - used by Cowrie init to determine logging
ENV DOCKER "yes"
ENV COWRIE_VERS "v2.2.0"
ENV DEBIAN_FRONTEND "noninteractive"
# hadolint ignore=DL3008,DL3005
RUN mkdir /code
COPY requirements.txt /code/
RUN useradd cowrie
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install --no-install-recommends -y gcc python3-dev libssl-dev git authbind jq libsnappy-dev rustc cargo \
&& python3 -m pip install --upgrade pip setuptools wheel \
&& python3 -m pip install poetry==1.0.8 \
&& python3 -m pip install --no-build-isolation pendulum==2.1.0 \
&& python3 -m pip install -r /code/requirements.txt \
&& cd /opt \
&& git clone --branch "${COWRIE_VERS}" http://github.com/cowrie/cowrie \
&& python3 -m pip install -r /opt/cowrie/requirements.txt \
&& python3 -m pip install -r /opt/cowrie/requirements-output.txt \
&& cp /opt/cowrie/etc/userdb.example /opt/cowrie/etc/userdb.txt \
&& bash -c "touch /etc/authbind/byport/{1..1024}" \
&& chmod 755 /etc/authbind/byport/* \
&& mkdir /data/ /etc/cowrie \
&& chgrp -R 0 /data \
&& chmod -R g=u /data \
&& chown -R cowrie /data \
&& chgrp -R 0 /opt/cowrie \
&& chmod -R g=u /opt/cowrie \
&& chown -R cowrie /opt/cowrie \
&& chown -R cowrie /etc/cowrie \
&& rm -rf /opt/cowrie/.git \
&& apt-get remove -y git libssl-dev gcc python3-dev rustc cargo \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm /opt/cowrie/src/cowrie/output/hpfeeds.py
COPY patches/src_cowrie_ssh_transport.py /opt/cowrie/src/cowrie/ssh/transport.py
COPY output/hpfeeds3.py /opt/cowrie/src/cowrie/output/
COPY cowrie.reference.cfg /code/cowrie.reference.cfg
COPY entrypoint.sh /code/
RUN chown -R cowrie /usr/local/lib/python3.7/site-packages/twisted/plugins/
VOLUME /data
USER cowrie
ENTRYPOINT ["/code/entrypoint.sh"]