diff --git a/docs/prerequisites.md b/docs/prerequisites.md new file mode 100644 index 0000000..0e747bb --- /dev/null +++ b/docs/prerequisites.md @@ -0,0 +1,165 @@ +# Prérequis + +## Machine INFRA (Proxmox) + +### Système +- Proxmox VE 7.x ou 8.x +- Commandes `qm` et `pvesm` disponibles (standard Proxmox) + +### Template Rocky Linux 9 +Le template doit exister avec Cloud-Init activé : +```bash +# Vérifier +qm status 9000 +qm config 9000 | grep -E "template|cloudinit" +``` + +### Bridge réseau +`vmbr1` doit être configuré en mode trunk VLAN-aware : +``` +# /etc/network/interfaces +auto vmbr1 +iface vmbr1 inet manual + bridge-ports none + bridge-stp off + bridge-fd 0 + bridge-vlan-aware yes + bridge-vids 2-4094 +``` + +pfSense (VMID 200) doit être connecté à `vmbr1` en trunk : +```bash +qm config 200 | grep net1 +# Attendu : virtio=...,bridge=vmbr1,trunks=1-4094 +``` + +--- + +## Machine ADMIN (10.100.0.10) + +### Paquets requis +```bash +dnf install -y expect sshpass bind-utils nc openssh-clients +``` + +Vérification : +```bash +for cmd in expect sshpass dig nc ssh; do + command -v $cmd && echo "OK: $cmd" || echo "MANQUANT: $cmd" +done +``` + +### Accès SSH sans mot de passe + +La machine admin doit pouvoir se connecter sans mot de passe vers : + +**NS1** (pour `dns1maj.sh`) : +```bash +ssh -p 2260 root@ns1.adm echo OK +``` + +**pfSense** (pour `provision_pfsense_vlan_interactivev2.sh`) : +```bash +ssh -p 2266 admin@10.11.0.1 echo OK +``` + +Si l'accès échoue, copier la clé publique : +```bash +# Générer une clé si absente +[[ -f ~/.ssh/id_ed25519 ]] || ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" + +# Copier vers NS1 +ssh-copy-id -p 2260 root@ns1.adm + +# Pour pfSense : coller dans System → User Manager → admin → Authorized SSH Keys +cat ~/.ssh/id_ed25519.pub +``` + +### CA cert Vault +```bash +mkdir -p /root/admin_tools/pki + +# Récupérer depuis Vault +ssh root@10.100.0.42 -p 2242 \ + "vault read -field=certificate pki/cert/ca" \ + > /root/admin_tools/pki/root.crt + +chmod 644 /root/admin_tools/pki/root.crt + +# Vérifier +openssl x509 -in /root/admin_tools/pki/root.crt -noout -subject -dates +``` + +### Scripts admin_tools existants +Les scripts suivants doivent être présents et exécutables : + +```bash +ls -la /root/admin_tools/majdns/dns1maj.sh +ls -la /root/admin_tools/fwdeploy/provision_pfsense_vlan_interactivev2.sh +ls -la /root/admin_tools/deploy_splitdns_adminkey/deploy-dns-keyv3.sh +``` + +Structure complète attendue : +``` +/root/admin_tools/ +├── majdns/ +│ └── dns1maj.sh +├── fwdeploy/ +│ └── provision_pfsense_vlan_interactivev2.sh +├── deploy_splitdns_adminkey/ +│ └── deploy-dns-keyv3.sh +├── audit/ +│ └── inventory_machinesvtest.csv +└── pki/ + └── root.crt +``` + +--- + +## pfSense + +| Paramètre | Valeur | +|-----------|--------| +| IP | 10.11.0.1 | +| Port SSH | 2266 | +| User SSH | admin | +| Interface parente VLANs | vtnet1 | +| Interface WAN | wan | +| NAT mode | automatic | + +L'accès SSH doit être activé dans pfSense : **System → Advanced → Secure Shell → Enable SSH**. + +--- + +## OpenLDAP (iam-kc) + +| Paramètre | Valeur | +|-----------|--------| +| IP | 10.100.0.40 | +| Port | 389 (LDAP plain, accès interne) | +| Base DN | `dc=adm,dc=ephaitek,dc=com` | +| OU utilisateurs | `ou=people,dc=adm,dc=ephaitek,dc=com` | +| OU services | `ou=svc,dc=adm,dc=ephaitek,dc=com` | +| Compte SSSD | `uid=svc-radius,ou=svc,dc=adm,dc=ephaitek,dc=com` | +| Mot de passe | `Radius123!` | + +--- + +## HashiCorp Vault + +| Paramètre | Valeur | +|-----------|--------| +| IP | 10.100.0.42 | +| Port | 8200 | +| Port SSH | 2242 | + +--- + +## DNS (PowerDNS) + +| Serveur | IP ADM | IP SVC | Port SSH | +|---------|--------|--------|----------| +| ns1 | 10.100.0.60 | 10.60.0.10 | 2260 | +| ns2 | 10.100.0.61 | 10.60.0.11 | 2261 | + +Zones gérées : `svc.ephaitek.com`, `adm.ephaitek.com` \ No newline at end of file