Skip to content

Commit

Permalink
Merge a2ab6dc into ce943bb
Browse files Browse the repository at this point in the history
  • Loading branch information
wintermute101 committed Oct 15, 2018
2 parents ce943bb + a2ab6dc commit cbc60d8
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 55 deletions.
38 changes: 0 additions & 38 deletions Dockerfile

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ Navigate to ``http://MY_IP_ADDRESS`` to confirm the setup.
#### Build docker image from source

1. Install [Docker](https://docs.docker.com/engine/installation/)
2. Clone this repo with `git clone https://github.com/mushorg/conpot.git` and `cd conpot`
2. Clone this repo with `git clone https://github.com/mushorg/conpot.git` and `cd conpot/docker`
3. Run `docker build -t conpot .`
4. Run `docker run -it -p 80:80 -p 102:102 -p 502:502 -p 161:161/udp --network=bridge conpot`
4. Run `docker run -it -p 80:8800 -p 102:10201 -p 502:5020 -p 161:16100/udp -p 47808:47808 -p 623:6230 -p 21:2121 -p 69:6969/udp --network=bridge conpot`

Navigate to `http://MY_IP_ADDRESS` to confirm the setup.

#### Build from source and run with docker-compose

1. Install [docker-compose](https://docs.docker.com/compose/install/)
2. Clone this repo with `git clone https://github.com/mushorg/conpot.git` and `cd conpot`
2. Clone this repo with `git clone https://github.com/mushorg/conpot.git` and `cd conpot/docker`
3. Build the image with `docker-compose build`
4. Test if everything is running correctly with `docker-compose up`
5. Permanently run as a daemon with `docker-compose up -d`
Expand Down
14 changes: 0 additions & 14 deletions docker-compose.yml

This file was deleted.

62 changes: 62 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM debian:stretch

ENV DEBIAN_FRONTEND noninteractive

# Add non-free packages, needed for snmp-mibs-downloader
RUN sed -i -e 's/main/main non-free contrib/g' /etc/apt/sources.list

# Install dependencies
RUN apt-get update -y -qq && apt-get install -y -qq \
ipmitool \
supervisor \
tcpdump \
git \
python3-pip \
python3 \
python3-dev \
wget &&\
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Copy the app from the host folder (probably a cloned repo) to the container
RUN useradd -m conpot
WORKDIR /opt/
RUN git clone https://github.com/mushorg/conpot.git
RUN chown conpot:conpot -R /opt/conpot

# Install Python requirements
USER conpot
ENV PATH=$PATH:/home/conpot/.local/bin
WORKDIR /opt/conpot
RUN pip3 install --user --no-cache-dir coverage
RUN pip3 install --user --no-cache-dir -r requirements.txt

# Run test cases
RUN py.test -v

# Install the Conpot application
RUN python3.5 setup.py install --user --prefix=
USER root
WORKDIR /
RUN rm -rf /opt/conpot /tmp/* /var/tmp/*
RUN mkdir -p /etc/conpot /var/log/conpot /usr/share/wireshark && \
wget https://github.com/wireshark/wireshark/raw/master/manuf -o /usr/share/wireshark/manuf

# Create directories
RUN mkdir -p /var/log/conpot/
RUN mkdir -p /data/tftp/
RUN chown conpot:conpot /var/log/conpot
RUN chown conpot:conpot -R /data

# Clean
RUN apt-get remove --purge -y git wget build-essential python3-dev python3-pip && \
apt-get autoremove -y --purge && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#EXPOSE 80 102 161/udp 502 21 69/udp
USER conpot
WORKDIR /home/conpot
ENV USER=conpot

CMD ["/home/conpot/.local/bin/conpot", "--template", "default", "--logfile", "/var/log/conpot/conpot.log", "-f", "--temp_dir", "/tmp" ]
16 changes: 16 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "3"
services:
conpot:
build: ./
ports:
- "80:8800" #SCADA UI, http
- "102:10201" #S7Comm
- "502:5020" #Modbus
- "161:16100/udp" #SNMP
- "47808:47808" #Bacnet
- "623:6230" #IPMI
- "21:2121" #FTP
- "69:6969/udp" #TFTP
volumes:
- ./log:/var/log/conpot
restart: always

0 comments on commit cbc60d8

Please sign in to comment.