mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-07-02 04:52:11 +00:00
image builder, tweaking
This commit is contained in:
parent
14a9b09f74
commit
328139d9b9
18 changed files with 105 additions and 25 deletions
|
@ -20,7 +20,7 @@ fi
|
||||||
# Main
|
# Main
|
||||||
mkdir -p /root/.docker/cli-plugins/
|
mkdir -p /root/.docker/cli-plugins/
|
||||||
cd /root/.docker/cli-plugins/
|
cd /root/.docker/cli-plugins/
|
||||||
wget https://github.com/docker/buildx/releases/download/v0.7.1/buildx-v0.7.1.linux-amd64 -O docker-buildx
|
wget https://github.com/docker/buildx/releases/download/v0.8.1/buildx-v0.8.1.linux-amd64 -O docker-buildx
|
||||||
chmod +x docker-buildx
|
chmod +x docker-buildx
|
||||||
|
|
||||||
docker buildx ls
|
docker buildx ls
|
||||||
|
|
79
docker/builder.sh
Executable file
79
docker/builder.sh
Executable file
|
@ -0,0 +1,79 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Setup Vars
|
||||||
|
myPLATFORMS="linux/amd64,linux/arm64"
|
||||||
|
myHUBORG="dtagdevsec"
|
||||||
|
myTAG="2203"
|
||||||
|
myIMAGESBASE="adbhoney ciscoasa citrixhoneypot conpot cowrie ddospot dicompot dionaea elasticpot endlessh ewsposter fatt glutton hellpot heralding honeypots honeytrap ipphoney log4pot mailoney medpot nginx p0f redishoneypot sentrypeer spiderfoot suricata wordpot"
|
||||||
|
myIMAGESELK="elasticsearch kibana logstash map"
|
||||||
|
myIMAGESTANNER="phpox redis snare tanner"
|
||||||
|
myBUILDERLOG="builder.log"
|
||||||
|
myBUILDERERR="builder.err"
|
||||||
|
myBUILDCACHE="/buildcache"
|
||||||
|
|
||||||
|
# Got root?
|
||||||
|
myWHOAMI=$(whoami)
|
||||||
|
if [ "$myWHOAMI" != "root" ]
|
||||||
|
then
|
||||||
|
echo "Need to run as root ..."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for Buildx
|
||||||
|
docker buildx > /dev/null 2>&1
|
||||||
|
if [ "$?" == "1" ];
|
||||||
|
then
|
||||||
|
echo "### Build environment not setup. Run bin/setup_builder.sh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Only run with command switch
|
||||||
|
if [ "$1" == "" ]; then
|
||||||
|
echo "### T-Pot Multi Arch Image Builder."
|
||||||
|
echo "## Usage: builder.sh [build, push]"
|
||||||
|
echo "## build - Just build images, do not push."
|
||||||
|
echo "## push - Build and push images."
|
||||||
|
echo "## Pushing requires an active docker login."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
fuBUILDIMAGES () {
|
||||||
|
local myPATH="$1"
|
||||||
|
local myIMAGELIST="$2"
|
||||||
|
local myPUSHOPTION="$3"
|
||||||
|
|
||||||
|
for myREPONAME in $myIMAGELIST;
|
||||||
|
do
|
||||||
|
echo -n "Now building: $myREPONAME in $myPATH$myREPONAME/."
|
||||||
|
docker buildx build --cache-from "type=local,src=$myBUILDCACHE" --cache-to "type=local,dest=$myBUILDCACHE" --platform $myPLATFORMS -t $myHUBORG/$myREPONAME:$myTAG $myPUSHOPTION $myPATH$myREPONAME/. >> $myBUILDERLOG 2>&1
|
||||||
|
if [ "$?" != "0" ];
|
||||||
|
then
|
||||||
|
echo " [ ERROR ] - Check logs!"
|
||||||
|
echo "Error building $myREPONAME" >> "$myBUILDERERR"
|
||||||
|
else
|
||||||
|
echo " [ OK ]"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Just build images
|
||||||
|
if [ "$1" == "build" ];
|
||||||
|
then
|
||||||
|
mkdir -p $myBUILDCACHE
|
||||||
|
rm -f "$myBUILDERLOG" "$myBUILDERERR"
|
||||||
|
echo "### Building images ..."
|
||||||
|
fuBUILDIMAGES "" "$myIMAGESBASE" ""
|
||||||
|
fuBUILDIMAGES "elk/" "$myIMAGESELK" ""
|
||||||
|
fuBUILDIMAGES "tanner/" "$myIMAGESTANNER" ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build and push images
|
||||||
|
if [ "$1" == "push" ];
|
||||||
|
then
|
||||||
|
mkdir -p $myBUILDCACHE
|
||||||
|
rm -f "$myBUILDERLOG" "$myBUILDERERR"
|
||||||
|
echo "### Building and pushing images ..."
|
||||||
|
fuBUILDIMAGES "" "$myIMAGESBASE" "--push"
|
||||||
|
fuBUILDIMAGES "elk/" "$myIMAGESELK" "--push"
|
||||||
|
fuBUILDIMAGES "tanner/" "$myIMAGESTANNER" "--push"
|
||||||
|
fi
|
||||||
|
|
|
@ -26,6 +26,7 @@ RUN apk --no-cache -U upgrade && \
|
||||||
git clone https://github.com/cymmetria/ciscoasa_honeypot && \
|
git clone https://github.com/cymmetria/ciscoasa_honeypot && \
|
||||||
cd ciscoasa_honeypot && \
|
cd ciscoasa_honeypot && \
|
||||||
git checkout d6e91f1aab7fe6fc01fabf2046e76b68dd6dc9e2 && \
|
git checkout d6e91f1aab7fe6fc01fabf2046e76b68dd6dc9e2 && \
|
||||||
|
sed -i "s/git+git/git+https/g" requirements.txt && \
|
||||||
pip3 install --no-cache-dir -r requirements.txt && \
|
pip3 install --no-cache-dir -r requirements.txt && \
|
||||||
cp /root/dist/asa_server.py /opt/ciscoasa_honeypot && \
|
cp /root/dist/asa_server.py /opt/ciscoasa_honeypot && \
|
||||||
chown -R ciscoasa:ciscoasa /opt/ciscoasa_honeypot && \
|
chown -R ciscoasa:ciscoasa /opt/ciscoasa_honeypot && \
|
||||||
|
|
|
@ -176,7 +176,7 @@ services:
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
ewsposter:
|
ewsposter:
|
||||||
build: ews/.
|
build: ewsposter/.
|
||||||
image: "dtagdevsec/ewsposter:2203"
|
image: "dtagdevsec/ewsposter:2203"
|
||||||
|
|
||||||
# Nginx service
|
# Nginx service
|
||||||
|
@ -192,4 +192,4 @@ services:
|
||||||
# Map Web Service
|
# Map Web Service
|
||||||
map_web:
|
map_web:
|
||||||
build: elk/map/.
|
build: elk/map/.
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
|
@ -82,7 +82,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
depends_on:
|
depends_on:
|
||||||
- map_redis
|
- map_redis
|
||||||
|
|
||||||
|
@ -96,6 +96,6 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
depends_on:
|
depends_on:
|
||||||
- map_redis
|
- map_redis
|
||||||
|
|
|
@ -27,7 +27,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
depends_on:
|
depends_on:
|
||||||
- map_redis
|
- map_redis
|
||||||
|
|
||||||
|
@ -41,6 +41,6 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
depends_on:
|
depends_on:
|
||||||
- map_redis
|
- map_redis
|
||||||
|
|
|
@ -184,7 +184,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -199,7 +199,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -87,7 +87,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -102,7 +102,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Nginx service
|
# Nginx service
|
||||||
|
|
|
@ -355,7 +355,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -370,7 +370,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -174,7 +174,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -189,7 +189,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -168,7 +168,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -183,7 +183,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -193,7 +193,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -208,7 +208,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -499,7 +499,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -514,7 +514,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -578,7 +578,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -593,7 +593,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
|
@ -211,7 +211,7 @@ services:
|
||||||
tty: true
|
tty: true
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:64299:64299"
|
- "127.0.0.1:64299:64299"
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
|
|
||||||
## Map Data Service
|
## Map Data Service
|
||||||
map_data:
|
map_data:
|
||||||
|
@ -226,7 +226,7 @@ services:
|
||||||
- /opt/tpot/etc/compose/elk_environment
|
- /opt/tpot/etc/compose/elk_environment
|
||||||
stop_signal: SIGKILL
|
stop_signal: SIGKILL
|
||||||
tty: true
|
tty: true
|
||||||
image: "dtagdevsec/map_server:2203"
|
image: "dtagdevsec/map:2203"
|
||||||
#### /ELK
|
#### /ELK
|
||||||
|
|
||||||
# Ewsposter service
|
# Ewsposter service
|
||||||
|
|
Loading…
Reference in a new issue