Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
RicYaben committed Jun 19, 2022
1 parent c9db2e1 commit bbca374
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 220 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -41,3 +41,6 @@ configs/keys/*

# Remove the riotpot binary
riotpot

# Remove the local samples
local
163 changes: 84 additions & 79 deletions README.md

Large diffs are not rendered by default.

File renamed without changes
16 changes: 11 additions & 5 deletions build/docker/Dockerfile
Expand Up @@ -25,17 +25,23 @@ RUN tar -xzf glider_0.15.0_linux_amd64.tar.gz && cd glider_0.15.0_linux_amd64 &&
RUN apt-get update && apt-get install -y netcat

# Copy everything into the image
# TODO: this can be optimized to copy just the necessary files!
COPY . .
# Copy only the app files in the image
COPY internal internal/
COPY tools tools/
COPY pkg pkg/
COPY cmd cmd/
COPY configs configs/
COPY build/docker/entrypoint.sh ./

# Run the command from the Makefile to build all the plugins
# and build the project
# -- Comment this line when on development if you know you have a ready to go version built --
# Disclaimer: if you comment this line, be 100% sure that the binary can be run on linux
RUN make riotpot-builder
COPY Makefile .
RUN make builder

# give permissions to the entrypoint to run the file
RUN chmod +x build/docker/entrypoint.sh
RUN chmod +x ./entrypoint.sh

# Run RIoTPot
ENTRYPOINT [ "./build/docker/entrypoint.sh" ]
ENTRYPOINT [ "./entrypoint.sh" ]
7 changes: 3 additions & 4 deletions build/docker/entrypoint.sh
@@ -1,16 +1,15 @@
#!/bin/sh


# wait for the database to be up
# Wait for the database to be up
if [ $DB_HOST ]
then
echo "Waiting for mongodb..."
echo "Waiting for database..."

while ! nc -z $DB_HOST $DB_PORT; do
sleep 0.1
done

echo "MongoDB started"
echo "database started"
fi

# run riotpot
Expand Down
5 changes: 3 additions & 2 deletions build/env/.env
Expand Up @@ -2,5 +2,6 @@ AUTOD=false
DB_HOST=mongodb
DB_USER=superuser
DB_PASS=password
DB_NAME=mongodb
DB_PORT=27017
DB_NAME=db
DB_PORT=27017
DB_ENGINE=mongodb
4 changes: 2 additions & 2 deletions configs/samples/profile.yml
Expand Up @@ -8,9 +8,9 @@ greet:
# Keep in mind that the initial message contains some waiting time,
# which is helpful in docker images to give time to the database
# to be set-up before starting the application!
initial : false
initial: false

# Terminal options and configuration
terminal:
# Color of the terminal path and headers
color: #eb4034
color: "#eb4034"
Empty file removed dataset/sample.pcap
Empty file.
99 changes: 0 additions & 99 deletions deployments/docker-compose-template.yml

This file was deleted.

1 change: 1 addition & 0 deletions deployments/docker-compose.prod.yml
Expand Up @@ -36,6 +36,7 @@ services:
- "7:7"
- "22:22"
- "23:23"
#- "80:80"
- "502:502"
- "8080:8080"
- "1883:1883"
Expand Down
46 changes: 17 additions & 29 deletions deployments/docker-compose.yml
Expand Up @@ -2,19 +2,6 @@
# environment for testing.
# This environment includes a fake local network, a local database and
# a volume mounted with the code to see changes on the go.
version: "3.8"

volumes:
postgres_data:
mongodb_data:

networks:
honeypot:
name: honeypot
ipam:
config:
- subnet: 10.5.0.0/16

services:

# Tcpdump host that stores all the stuff that happens
Expand All @@ -39,11 +26,11 @@ services:

# RIoTPot is the container for the central node
riotpot:
container_name: riotpot
build:
context: ..
dockerfile: ./build/docker/Dockerfile
image: riotpot:development
#command:
restart: always
ports:
# Ports under 60 might see errors when unquoted
Expand All @@ -52,6 +39,7 @@ services:
# - "22:22"
- "23:23"
- "502:502"
#- "80:80"
- "8080:8080"
- "1883:1883"
- "5683:5683"
Expand All @@ -64,24 +52,13 @@ services:
# and attack it seamlessly
ipv4_address: 10.5.0.6

postgres:
image: postgres:latest
environment:
- POSTGRES_USER=superuser
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
honeypot:

mongodb:
image: mongo
container_name: mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: superuser
MONGO_INITDB_ROOT_PASSWORD: password
MONGO_INITDB_DATABASE: mongodb
MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-superuser}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASS:-password}
MONGO_INITDB_DATABASE: ${DB_NAME:-db}
volumes:
- mongodb_data:/data/db/
networks:
Expand All @@ -96,4 +73,15 @@ services:
volumes:
- ../test/pkg/services/mqtt:/riotpot/
networks:
honeypot:
honeypot:

volumes:
postgres_data:
mongodb_data:

networks:
honeypot:
name: honeypot
ipam:
config:
- subnet: 10.5.0.0/16

0 comments on commit bbca374

Please sign in to comment.