mirror of
https://github.com/Oxbian/SIDPS.git
synced 2025-05-17 14:08:14 +02:00
feat: new networking partition + schema + test everything works
This commit is contained in:
parent
09abb7e20f
commit
6377eae0ae
@ -2,9 +2,13 @@ FROM python:alpine3.20
|
|||||||
|
|
||||||
# Installation des paquets nécessaires pour scapy
|
# Installation des paquets nécessaires pour scapy
|
||||||
RUN apk -U upgrade && \
|
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
|
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
|
# Copier le script d'attaque
|
||||||
#COPY attack.py /attack.py
|
#COPY attack.py /attack.py
|
||||||
|
|
||||||
|
@ -2,9 +2,12 @@ FROM python:alpine3.20
|
|||||||
|
|
||||||
# Installation des paquets nécessaires pour scapy
|
# Installation des paquets nécessaires pour scapy
|
||||||
RUN apk -U upgrade && \
|
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
|
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
|
# Copier le script de détection d'attaques
|
||||||
#COPY cible.py /cible.py
|
#COPY cible.py /cible.py
|
||||||
|
|
||||||
|
@ -2,9 +2,13 @@ FROM python:alpine3.20
|
|||||||
|
|
||||||
# Installation des paquets nécessaires pour scapy
|
# Installation des paquets nécessaires pour scapy
|
||||||
RUN apk -U upgrade && \
|
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
|
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
|
# Copier le script de l'idps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
@ -14,9 +18,7 @@ COPY idps /app/idps
|
|||||||
# Copie du fichier de configuration
|
# Copie du fichier de configuration
|
||||||
COPY config.json /app/config.json
|
COPY config.json /app/config.json
|
||||||
|
|
||||||
# Autres commandes nécessaires pour ton projet
|
# Utiliser le script comme point d'entrée
|
||||||
# Par exemple, pour installer des dépendances :
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
# RUN pip install -r /app/idps/requirements.txt (si applicable)
|
|
||||||
|
|
||||||
# Commande par défaut
|
# Commande par défaut
|
||||||
CMD ["python", "/app/idps/main.py"]
|
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 "$@"
|
6
Demo/deploy.sh
Executable file
6
Demo/deploy.sh
Executable file
@ -0,0 +1,6 @@
|
|||||||
|
#/bin/sh
|
||||||
|
docker compose build
|
||||||
|
docker compose stop
|
||||||
|
#docker rm ids idps
|
||||||
|
docker rm attaquant1 attaquant2 ids idps cible alert_db
|
||||||
|
docker compose up -d
|
@ -7,6 +7,8 @@ services:
|
|||||||
dockerfile: Demo/Dockerfiles/Dockerfile.attaquant
|
dockerfile: Demo/Dockerfiles/Dockerfile.attaquant
|
||||||
container_name: attaquant1
|
container_name: attaquant1
|
||||||
command: sleep infinity
|
command: sleep infinity
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
networks:
|
networks:
|
||||||
net_public:
|
net_public:
|
||||||
ipv4_address: 172.20.1.2
|
ipv4_address: 172.20.1.2
|
||||||
@ -27,15 +29,19 @@ services:
|
|||||||
ipv4_address: 172.20.1.3
|
ipv4_address: 172.20.1.3
|
||||||
net_private:
|
net_private:
|
||||||
ipv4_address: 172.20.2.2
|
ipv4_address: 172.20.2.2
|
||||||
|
net_data:
|
||||||
|
ipv4_address: 172.20.3.2
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
# Cible
|
# Cible
|
||||||
cible:
|
cible:
|
||||||
build:
|
build:
|
||||||
context: Dockerfiles/.
|
context: ..
|
||||||
dockerfile: Dockerfile.cible
|
dockerfile: Demo/Dockerfiles/Dockerfile.cible
|
||||||
container_name: cible
|
container_name: cible
|
||||||
command: sleep infinity
|
command: sleep infinity
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
networks:
|
networks:
|
||||||
net_private:
|
net_private:
|
||||||
ipv4_address: 172.20.2.3
|
ipv4_address: 172.20.2.3
|
||||||
@ -44,10 +50,12 @@ services:
|
|||||||
# Attaquant 2
|
# Attaquant 2
|
||||||
atk2:
|
atk2:
|
||||||
build:
|
build:
|
||||||
context: Dockerfiles/.
|
context: ..
|
||||||
dockerfile: Dockerfile.attaquant
|
dockerfile: Demo/Dockerfiles/Dockerfile.attaquant
|
||||||
container_name: attaquant2
|
container_name: attaquant2
|
||||||
command: sleep infinity
|
command: sleep infinity
|
||||||
|
cap_add:
|
||||||
|
- NET_ADMIN
|
||||||
networks:
|
networks:
|
||||||
net_private:
|
net_private:
|
||||||
ipv4_address: 172.20.2.4
|
ipv4_address: 172.20.2.4
|
||||||
@ -81,8 +89,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
networks:
|
networks:
|
||||||
net_private:
|
net_data:
|
||||||
ipv4_address: 172.20.2.10
|
ipv4_address: 172.20.3.10
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
@ -96,3 +104,8 @@ networks:
|
|||||||
ipam:
|
ipam:
|
||||||
config:
|
config:
|
||||||
- subnet: 172.20.2.0/24
|
- subnet: 172.20.2.0/24
|
||||||
|
net_data:
|
||||||
|
driver: bridge
|
||||||
|
ipam:
|
||||||
|
config:
|
||||||
|
- subnet: 172.20.3.0/24
|
||||||
|
14
config.json
14
config.json
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"rules_dirpath": "/app/idps/rules",
|
"rules_dirpath": "/app/idps/rules",
|
||||||
"ifaces": ["eth0", "eth1"],
|
"ifaces": ["eth1"],
|
||||||
"db_host": "172.20.2.10",
|
"db_host": "172.20.3.10",
|
||||||
"db_database": "sidps",
|
"db_database": "sidps",
|
||||||
"db_user": "sidps",
|
"db_user": "sidps",
|
||||||
"db_password": "SUPERPASSWORD",
|
"db_password": "SUPERPASSWORD",
|
||||||
@ -13,5 +13,13 @@
|
|||||||
"synscan_time": 180,
|
"synscan_time": 180,
|
||||||
"synscan_count": 5,
|
"synscan_count": 5,
|
||||||
"tcpconnectscan_time": 180,
|
"tcpconnectscan_time": 180,
|
||||||
"tcpconnectscan_count": 5
|
"tcpconnectscan_count": 5,
|
||||||
|
"ackscan_time": 180,
|
||||||
|
"ackscan_count": 5,
|
||||||
|
"finscan_time": 180,
|
||||||
|
"finscan_count": 5,
|
||||||
|
"nullscan_time": 180,
|
||||||
|
"nullscan_count": 5,
|
||||||
|
"xmasscan_time": 180,
|
||||||
|
"xmasscan_count": 5
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user