🧱 1. Mise à jour DNS Active Directory
Étape | Action |
---|---|
🛠 | Ouvre dnsmgmt.msc sur ton DC |
✏️ | Modifie l’entrée A glpi.comptaplus.loc |
📌 | Nouvelle IP = 192.168.30.3 (DMZ) |
💡 | Vide le cache DNS : ipconfig /flushdns sur serveur et postes |
...
🔐 3. Configuration des règles OPNsense
📍 Interface LAN ➜ DMZ (accès internes : agents + utilisateurs)
Source | Destination | Ports | Description |
---|---|---|---|
LAN net | 192.168.30.3 | TCP 80, 443 | Accès Web GLPI |
...
📍 Interface DMZ ➜ SRV (LDAPS vers Active Directory)
Source | Destination | Port | Description |
---|---|---|---|
192.168.30.3 |
| TCP 636 | Authentification LDAP sécurisée |
...
📍 Interface WAN ➜ DMZ (accès Internet) =>
PORT FORWARD
Type | Détail | |||||||
---|---|---|---|---|---|---|---|---|
PAT | WAN | TCP/UDP | * | * | WAN net | http /https | 192.168.20.3 | http/https |
Firewall | Autoriser TCP 443 sur l’interface WAN (auto ou manuel) |
...
📍 Interface DMZ ➜ WAN (si GLPI a besoin d’Internet)
Déplacer ton serveur GLPI (
192.168.20.3
) dans une DMZTout en le rendant accessible depuis Internet via NAT
Conserver l’accès depuis le LAN (HTTPS)
Et qu’il continue à interroger l’Active Directory (LDAPS) sur l’interface SRV (192.168.20.x)
✅ Objectif : accès sécurisé, segmenté, clair
Je te prépare un tableau clair avec toutes les règles nécessaires, réparties par interface.
📋 Récapitulatif des flux GLPI attendus
Source | Destination | Port(s) | Protocole | Rôle |
---|---|---|---|---|
LAN (192.168.10.x) | GLPI (DMZ) | 443 | TCP | Accès Web interne |
Internet (WAN) | GLPI (DMZ) | 443 (via NAT) | TCP | Accès Web externe |
GLPI (DMZ) | AD (SRV) | 636 | TCP | Authentification LDAPS |
Admin (192.168.10.1) | GLPI (DMZ) | 80, 443 | TCP | Accès Admin HTTP/S |
GLPI | Internet | 53, 443 | TCP/UDP | Majs, DNS si nécessaire |
🛠 Règles à mettre en place dans OPNsense
🔸Interface LAN (192.168.10.0/24)
...
Source | Destination | Port(s) | Description |
---|
192.168. |
30. |
3 |
🔸Interface DMZ (où sera GLPI)
* | 53, 443 | DNS + MAJ, accès web externe |
...
📍 Interface DMZ ➜ Accès SSH depuis PC_ADM
Source | Destination | Port |
---|
Description |
---|
192.168.10.1 (PC_ADM) |
192.168. |
30. |
3 |
🔸Interface WAN (NAT)
Action | Source | Destination | Port(s) | Description |
---|---|---|---|---|
NAT + Pass | * | WAN IP → GLPI_DMZ | 443 | Accès Web depuis Internet |
Pass | WAN net | GLPI_DMZ | 443 | (Si pas auto-créée par le NAT) |
🔁 Règles NAT (Firewall > NAT > Port Forward)
Interface | Destination | Port | Redirect to | Description |
---|---|---|---|---|
WAN | WAN address | 443 | 192.168.X.X:443 | NAT HTTP(S) vers GLPI |
WAN | WAN address | 80 (optionnel) | 192.168.X.X:80 | Redirection HTTP vers HTTPS |
🚦 Exemple : IP GLPI en DMZ
...
TCP 22 | Administration SSH du serveur GLPI |
...
🧪 4. Vérifications à faire
Test | Commande ou action |
---|---|
Résolution DNS | nslookup glpi.comptaplus.loc ➔ doit donner 192.168.30.3 |
Agent GLPI | glpi-agent --debug --no-fork |
Accès Web | https://glpi.comptaplus.loc depuis LAN et depuis Internet |
LDAPS | Vérifie dans GLPI : connexion LDAP ➔ OK |
SSH | ssh glpi@192.168.30.3 depuis 192.168.10.1 |
...
✅ Optionnel : nettoyage
Action | Pourquoi |
---|---|
Supprimer ancienne règle vers 192.168.20.3 | GLPI n'est plus sur le réseau SRV |
Archiver l'ancienne conf GLPI | Bonnes pratiques post-migration |
REVERSE PROXY !!!!!!!!!
- Nouvelle vm en dmz 192.168.30.3
- user srv
- installer nginx
- configuration nginx avec reverse proxy
Objectif final :
GLPI reste installé sur ton serveur actuel SRV (
192.168.20.3
) dans le LAN
(Pas besoin de tout réinstaller).Ne déplaces pas GLPI physiquement (ça évite de tout casser côté LDAP/BD/GLPI).
Ajoutes un reverse proxy dans ta DMZ (ex:
192.168.30.3
) qui publie GLPI vers l’extérieur.Aucune ouverture directe du LAN vers le WAN.
✅ Plus propre, plus sécurisé, moins de galère.
...
🛠️ Architecture réseau après mise en place :
scss[WAN] ↓
[OPNsense NAT/Firewall]
↓
[DMZ] ↳ Reverse Proxy (Nginx, IP : 192.168.30.3)
n ↳ redirige vers 192.168.20.3 (GLPI)
[LAN] ↳ Serveur GLPI (SRV - IP : 192.168.20.3)
...
🔥 Détail des étapes :
1. Installer un Reverse Proxy (Nginx) en DMZ
VM ou serveur avec IP 192.168.30.3.
Installer Nginx.
Code Block # 1. Mettre à jour le système sudo apt update sudo apt upgrade -y # 2. Installer Nginx sudo apt install nginx -y # 3. Vérifier que Nginx est bien installé et actif sudo systemctl status nginx # 4. Démarrer Nginx si besoin sudo systemctl start nginx # 5. Activer Nginx pour qu’il se lance automatiquement au démarrage sudo systemctl enable nginx
Configurer un proxy_pass vers ton GLPI :
générer un certificat
Annexe 1 : Crée un certificat avec ADCS (pour un serveur web)
Code Block # Aller dans le dossier de config Nginx cd /etc/nginx/sites-available/ # Créer un nouveau fichier pour GLPI sudo nano glpi.conf
Code Block server { listen 80 default_server; server_name _; return 301 https://$host$request_uri; } server { listen 443 ssl default_server; server_name _ glpi.comptaplus.loc; ssl_certificate /etc/nginx/ssl/cert.pem; ssl_certificate_key /etc/nginx/ssl/key.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_prefer_server_ciphers on; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Frame-Options "DENY" always; add_header X-XSS-Protection "1; mode=block" always; location / { proxy_pass https://192.168.20.3; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
Code Block # Créer un lien symbolique dans sites-enabled sudo ln -s /etc/nginx/sites-available/glpi.conf /etc/nginx/sites-enabled/ # Tester la configuration Nginx pour être sûr qu’il n’y a pas d'erreurs sudo nginx -t # Recharger Nginx pour appliquer la nouvelle config sudo systemctl reload nginx
Ici Nginx en DMZ reçoit les requêtes HTTPS et renvoie proprement vers le serveur GLPI interne.
Sur OPNsense (pare-feu) :
1 règles NAT à faire :
Interface | Source | Port Destination | Redirection interne vers IP DMZ (Reverse Proxy) | Port interne |
---|---|---|---|---|
W AN | Any | 443 (HTTPS) | 192.168.30.3 (Reverse Proxy) | 443 |