mirror of
https://github.com/Oxbian/SIDPS.git
synced 2025-07-07 04:14:46 +02:00
feat: new networking partition + schema + test everything works
This commit is contained in:
@ -2,9 +2,13 @@ FROM python:alpine3.20
|
||||
|
||||
# Installation des paquets nécessaires pour scapy
|
||||
RUN apk -U upgrade && \
|
||||
apk add --no-cache libpcap libpcap-dev gcc musl-dev libffi-dev nmap
|
||||
apk add --no-cache libpcap libpcap-dev gcc musl-dev libffi-dev nmap iproute2
|
||||
RUN pip install scapy
|
||||
|
||||
COPY Demo/Dockerfiles/attaquant-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
# Copier le script d'attaque
|
||||
#COPY attack.py /attack.py
|
||||
|
||||
|
@ -2,9 +2,12 @@ FROM python:alpine3.20
|
||||
|
||||
# Installation des paquets nécessaires pour scapy
|
||||
RUN apk -U upgrade && \
|
||||
apk add --no-cache libpcap libpcap-dev gcc musl-dev libffi-dev
|
||||
apk add --no-cache libpcap libpcap-dev gcc musl-dev libffi-dev iproute2
|
||||
RUN pip install scapy
|
||||
|
||||
COPY Demo/Dockerfiles/cible-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
# Copier le script de détection d'attaques
|
||||
#COPY cible.py /cible.py
|
||||
|
||||
|
@ -2,9 +2,13 @@ FROM python:alpine3.20
|
||||
|
||||
# Installation des paquets nécessaires pour scapy
|
||||
RUN apk -U upgrade && \
|
||||
apk add --no-cache libpcap libpcap-dev gcc musl-dev libffi-dev
|
||||
apk add --no-cache libpcap libpcap-dev gcc musl-dev libffi-dev iptables iproute2
|
||||
RUN pip install scapy mysql-connector-python
|
||||
|
||||
# Copier le script de démarrage
|
||||
COPY Demo/Dockerfiles/idps-entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Copier le script de l'idps
|
||||
WORKDIR /app
|
||||
|
||||
@ -14,9 +18,7 @@ COPY idps /app/idps
|
||||
# Copie du fichier de configuration
|
||||
COPY config.json /app/config.json
|
||||
|
||||
# Autres commandes nécessaires pour ton projet
|
||||
# Par exemple, pour installer des dépendances :
|
||||
# RUN pip install -r /app/idps/requirements.txt (si applicable)
|
||||
|
||||
# Utiliser le script comme point d'entrée
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
# Commande par défaut
|
||||
CMD ["python", "/app/idps/main.py"]
|
||||
|
6
Demo/Dockerfiles/attaquant-entrypoint.sh
Normal file
6
Demo/Dockerfiles/attaquant-entrypoint.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
ip route add 172.20.2.0/24 via 172.20.1.3 dev eth0
|
||||
|
||||
# Lancer l'application IDPS
|
||||
exec "$@"
|
6
Demo/Dockerfiles/cible-entrypoint.sh
Normal file
6
Demo/Dockerfiles/cible-entrypoint.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
ip route add 172.20.1.0/24 via 172.20.2.2 dev eth0
|
||||
|
||||
# Lancer l'application IDPS
|
||||
exec "$@"
|
14
Demo/Dockerfiles/idps-entrypoint.sh
Normal file
14
Demo/Dockerfiles/idps-entrypoint.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Activer l'acheminement des paquets
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
||||
|
||||
# Configurer les règles iptables
|
||||
ip route add 172.20.2.0/24 via 172.20.2.2 dev eth1
|
||||
ip route add 172.20.1.0/24 via 172.20.1.3 dev eth2
|
||||
|
||||
iptables -A FORWARD -i eth1 -o eth2 -j ACCEPT
|
||||
iptables -A FORWARD -i eth2 -o eth1 -j ACCEPT
|
||||
|
||||
# Lancer l'application IDPS
|
||||
exec "$@"
|
Reference in New Issue
Block a user