Skip to content

Commit

Permalink
conpot/glastopf - merge
Browse files Browse the repository at this point in the history
glastopf broke merge.
  • Loading branch information
Spenser Reinhardt committed Dec 21, 2014
1 parent ce791c5 commit 2888f9f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 68 deletions.
39 changes: 14 additions & 25 deletions conpot/Dockerfile
Expand Up @@ -6,39 +6,28 @@ MAINTAINER Spenser Reinhardt
ENV DEBIAN_FRONTEND noninteractive
ENV logfile /var/log/install.log

RUN echo "Creating new Docker container for Conpot.." | tee -a "${logfile}"
RUN echo $(date) | tee -a "${logfile}"

#apt-get sources
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse' /etc/apt/sources.list

#dependencies
RUN echo "Installing prereqs" | tee -a "${logfile}"
RUN apt-get update -y 2>&1 | tee -a "${logfile}"
RUN apt-get install libsmi2ldbl snmp-mibs-downloader -y 2>&1 | tee -a "${logfile}"
RUN apt-get update && \
apt-get install git-core python python-dev libmysqlclient-dev libxslt1-dev libsmi2ldbl snmp-mibs-downloader -y && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

#Build here
WORKDIR /opt/
RUN git clone git@github.com:glastopf/conpot.git 2>&1 | tee -a "${logfile}"
WORKDIR conpot/
RUN python setup.py install 2>&1 | tee -a "${logfile}"

#Finished
RUN echo "Finished build correctly - Enjoy!" | tee -a "${logfile}"
RUN echo $(date) | tee -a "${logfile}"
RUN if [[ ! -d /opt/conpot/ ]] || [[ ! -d /opt/conpot/var/ ]]; then mkdir -p /opt/conpot/var/; fi
RUN cd /opt/ && \
git clone https://github.com/glastopf/conpot.git && \
cd conpot/ && \
python setup.py install

#Add config
ADD conpot.cfg /opt/conpot/conpot.cfg

#cleanup
RUN if [[ -f $logfile ]]; then mv "${logfile}" /opt/thug/install.log; else echo "No log, use docker's"; fi
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

EXPOSE 80 161 503
EXPOSE 80 102 161 503
WORKDIR /opt/conpot
VOLUME /opt/conpot/var/
CMD ["conpot", "-c /opt/conpot/conpot.cfg", ">> var/conpot.log"]
ENTRYPOINT ["/usr/bin/python"]
CMD ["/opt/conpot/bin/conpot", "-c", "/opt/conpot/conpot.cfg", "-t", "/opt/conpot/conpot/templates/default/", "-l", "/opt/conpot/var/conpot.log"]
15 changes: 15 additions & 0 deletions conpot/conpot.cfg
@@ -1,21 +1,35 @@
[session]
timeout = 30

[sqlite]
enabled = False

[syslog]
enabled = True
device = /opt/conpot/var/conpot.log
host = localhost
port = 514
facility = local0
socket = dev ; udp (sends to host:port), dev (sends to device)

[mysql]
enabled = False
device = /tmp/mysql.sock
host = localhost
port = 3306
db = conpot
username = conpot
passphrase = conpot
socket = dev ; tcp (sends to host:port), dev (sends to mysql device/socket file)

[hpfriends]
enabled = False
host = hpfriends.honeycloud.net
port = 20000
ident = 3Ykf9Znv
secret = 4nFRhpm44QkG9cvD
channels = ["conpot.events", ]

[taxii]
enabled = False
host = taxiitest.mitre.org
Expand All @@ -24,6 +38,7 @@ inbox_path = /services/inbox/default/
use_https = False
contact_name = conpot
contact_domain = http://conpot.org/stix-1

[fetch_public_ip]
enabled = True
urls = ["http://www.telize.com/ip", "http://queryip.net/ip/", "http://ifconfig.me/ip"]
Expand Down
71 changes: 28 additions & 43 deletions glastopf/Dockerfile
@@ -1,69 +1,54 @@
#glastopf
#start with ubuntu
# glastopf
# start with ubuntu
FROM ubuntu:latest

MAINTAINER Spenser Reinhardt
ENV DEBIAN_FRONTEND noninteractive
ENV logfile /var/log/install.log

RUN echo "Creating new Docker container for Project Glastopf" | tee -a "${logfile}"
RUN echo $(date) | tee -a "${logfile}"

#sources
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse' /etc/apt/sources.list
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse' /etc/apt/sources.list
# sources
RUN sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty main restricted universe multiverse' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-updates main restricted universe multiverse' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-backports main restricted universe multiverse' /etc/apt/sources.list && \
sed -i '1ideb mirror://mirrors.ubuntu.com/mirrors.txt trusty-security main restricted universe multiverse' /etc/apt/sources.list

# updates and prereqs
RUN sudo apt-get update -y
RUN sudo apt-get install git lsb-release -y

#prereqs
RUN echo "Installing prereqs" | tee -a "${logfile}"
RUN apt-get install python2.7 python-openssl python-gevent libevent-dev python2.7-dev build-essential make \
RUN apt-get update -y && \
apt-get install git-core lsb-release python2.7 python-openssl python-gevent libevent-dev python2.7-dev build-essential make \
python-chardet python-requests python-sqlalchemy python-lxml python-beautifulsoup mongodb python-pip \
python-dev python-setuptools g++ git php5 php5-dev liblapack-dev gfortran libmysqlclient-dev libxml2-dev \
libxslt-dev -y 2>&1 | tee -a "${logfile}"
RUN pip install --upgrade distribute -y 2>&1 | tee -a "${logfile}"
libxslt-dev -y && \
pip install --upgrade distribute

#checout and build latest php sandbox
RUN echo "Cloning and building PHP sandbox" | tee -a "${logfile}"
WORKDIR /opt/
RUN git clone git://github.com/glastopf/BFR.git 2>&1 | tee -a "${logfile}"
WORKDIR BFR/
RUN phpize 2>&1 | tee -a "${logfile}"
RUN ./configure --enable-bfr 2>&1 | tee -a "${logfile}"
RUN make 2>&1 | tee -a "${logfile}"
RUN make install 2>&1 | tee -a "${logfile}"
RUN for i in $(find / -type f -name php.ini); do \

# checout and build latest php sandbox
RUN git clone git://github.com/glastopf/BFR.git && \
cd BFR/ && \
phpize && \
./configure --enable-bfr && \
make && \
make install && \
for i in $(find / -type f -name php.ini); do \
sed -i "/[PHP]/azend_extension=$(find /usr/lib/php5 -type f -name bfr.so)" $i; \
done

#Clone and build glastopf
RUN echo "Cloning and building Glastopf" | tee -a "${logfile}"
WORKDIR /opt/
RUN git clone https://github.com/glastopf/glastopf.git 2>&1 | tee -a "${logfile}"
WORKDIR glastopf/
RUN python setup.py install 2>&1 | tee -a "${logfile}"
# Clone and build glastopf
RUN git clone https://github.com/glastopf/glastopf.git glastopf && \
cd glastopf/ && \
python setup.py install

#Make dir for glastopf env
RUN echo "Making glastopf environment" | tee -a $loglfile
WORKDIR /opt/
# Make dir for glastopf env
RUN mkdir myhoneypot
WORKDIR myhoneypot/

#Initialize config - might be causing build timeout
# Initialize config - might be causing build timeout
#RUN glastopf-runner 2>&1 | tee -a "${logfile}"

#Finished
RUN echo "Finished build correctly - Enjoy!" | tee -a "${logfile}"
RUN echo $(date) | tee -a "${logfile}"
RUN if [[ -f $logfile ]]; then mv $logfile /opt/thug/install.log; else echo "No log, use docker's"; fi

# Finished
# Clean up when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ./install.sh

EXPOSE 80 443
VOLUME /opt/myhoneynet/log
WORKDIR /opt/myhoneypot
CMD ["glastopf-runner"]

0 comments on commit 2888f9f

Please sign in to comment.