mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 01:27:27 -04:00
bump cowrie to v2.0.0
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
FROM alpine
|
||||
|
||||
#
|
||||
# Include dist
|
||||
ADD dist/ /root/dist/
|
||||
|
||||
#
|
||||
# Get and install dependencies & packages
|
||||
RUN apk -U --no-cache add \
|
||||
RUN apk -U add \
|
||||
bash \
|
||||
build-base \
|
||||
git \
|
||||
@ -15,38 +15,37 @@ RUN apk -U --no-cache add \
|
||||
mpfr-dev \
|
||||
openssl \
|
||||
openssl-dev \
|
||||
python \
|
||||
python-dev \
|
||||
py-bcrypt \
|
||||
py-mysqldb \
|
||||
py-pip \
|
||||
py-requests \
|
||||
py-setuptools && \
|
||||
|
||||
python3 \
|
||||
python3-dev \
|
||||
py3-bcrypt \
|
||||
py3-mysqlclient \
|
||||
py3-requests \
|
||||
py3-setuptools && \
|
||||
#
|
||||
# Setup user
|
||||
addgroup -g 2000 cowrie && \
|
||||
adduser -S -s /bin/ash -u 2000 -D -g 2000 cowrie && \
|
||||
|
||||
#
|
||||
# Install cowrie
|
||||
mkdir -p /home/cowrie && \
|
||||
cd /home/cowrie && \
|
||||
git clone --depth=1 https://github.com/micheloosterhof/cowrie -b 1.5.3 && \
|
||||
git clone --depth=1 https://github.com/micheloosterhof/cowrie -b v2.0.0 && \
|
||||
cd cowrie && \
|
||||
mkdir -p log && \
|
||||
pip install --upgrade pip && \
|
||||
pip install --upgrade -r requirements.txt && \
|
||||
|
||||
pip3 install --upgrade pip && \
|
||||
pip3 install --upgrade -r requirements.txt && \
|
||||
#
|
||||
# Setup configs
|
||||
setcap cap_net_bind_service=+ep /usr/bin/python2.7 && \
|
||||
setcap cap_net_bind_service=+ep /usr/bin/python3.7 && \
|
||||
cp /root/dist/cowrie.cfg /home/cowrie/cowrie/cowrie.cfg && \
|
||||
chown cowrie:cowrie -R /home/cowrie/* /usr/lib/python2.7/site-packages/twisted/plugins && \
|
||||
|
||||
chown cowrie:cowrie -R /home/cowrie/* /usr/lib/python3.7/site-packages/twisted/plugins && \
|
||||
#
|
||||
# Start Cowrie once to prevent dropin.cache errors upon container start caused by read-only filesystem
|
||||
su - cowrie -c "export PYTHONPATH=/home/cowrie/cowrie:/home/cowrie/cowrie/src && \
|
||||
cd /home/cowrie/cowrie && \
|
||||
/usr/bin/twistd --uid=2000 --gid=2000 -y cowrie.tac --pidfile cowrie.pid cowrie &" && \
|
||||
sleep 10 && \
|
||||
|
||||
#
|
||||
# Clean up
|
||||
apk del --purge build-base \
|
||||
git \
|
||||
@ -56,13 +55,12 @@ RUN apk -U --no-cache add \
|
||||
mpc1-dev \
|
||||
mpfr-dev \
|
||||
openssl-dev \
|
||||
python-dev \
|
||||
py-mysqldb \
|
||||
py-pip && \
|
||||
rm -rf /root/* && \
|
||||
python3-dev \
|
||||
py3-mysqlclient && \
|
||||
rm -rf /root/* /tmp/* && \
|
||||
rm -rf /var/cache/apk/* && \
|
||||
rm -rf /home/cowrie/cowrie/cowrie.pid
|
||||
|
||||
#
|
||||
# Start cowrie
|
||||
ENV PYTHONPATH /home/cowrie/cowrie:/home/cowrie/cowrie/src
|
||||
WORKDIR /home/cowrie/cowrie
|
||||
|
Reference in New Issue
Block a user