03 — Phase 1 : Durcissement OS Debian 13
Version : 0.2.0 Date : 2026-03-20 Statut : Rédaction initiale — Format CIS hybride Licence : CC BY-SA 4.0 Base de référence : CIS Debian Linux 13 Benchmark v1.0.0 (2025-12-16) Scénarios du threat model : S1, S2, S3, S6, S7
1.1 — Gestion des paquets et dépôts
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 1.2.1.1 — Ensure GPG keys are configured |
| CIS Controls v8 | 2.2 — Ensure Authorized Software is Currently Supported |
| MITRE ATT&CK | T1195.002 (Compromise Software Supply Chain), M1051 (Update Software) |
| ISO 27001:2022 | A.8.8 — Management of technical vulnerabilities, A.8.10 — Information deletion |
| PCI DSS v4.0 | 6.3.3 |
| Scénario threat model | S7 (supply chain) |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible. Sans abonnement, les mises à jour via le dépôt no-subscription sont fonctionnelles mais n'ont pas le même niveau de test que le dépôt enterprise.
🔍 Audit
Audit :
Vérifier que apt update fonctionne sans erreur
apt update 2>&1 | grep -E "Err:|401|Failed"
Résultat attendu : aucune sortie (pas d'erreurs)
Vérifier les clés GPG Proxmox
apt-key list 2>/dev/null | grep -A1 "proxmox" || \
ls /etc/apt/trusted.gpg.d/proxmox-*
Résultat attendu : clé Proxmox Release Key présente
Vérifier qu'aucun dépôt n'a AllowUnauthenticated
grep -r "AllowUnauthenticated\|AllowInsecureRepositories" /etc/apt/ 2>/dev/null
Résultat attendu : aucune sortie
**Remédiation** :
Avec abonnement enterprise (🏢🌐 recommandé) :
Vérifier /etc/apt/sources.list.d/pve-enterprise.list
cat /etc/apt/sources.list.d/pve-enterprise.list
Doit contenir : deb https://enterprise.proxmox.com/debian/pve trixie pve-enterprise
apt update # Doit fonctionner sans erreur 401
Sans abonnement (🏠) :
Désactiver le dépôt enterprise
sed -i 's/^deb/#deb/' /etc/apt/sources.list.d/pve-enterprise.list
Ajouter le dépôt no-subscription
echo "deb http://download.proxmox.com/debian/pve trixie pve-no-subscription" \
/etc/apt/sources.list.d/pve-no-subscription.list
apt update
**Valeur par défaut** : Dépôt enterprise activé (échoue sans licence). Clés GPG Proxmox installées.
**Rollback** :
sed -i 's/^#deb/deb/' /etc/apt/sources.list.d/pve-enterprise.list
rm -f /etc/apt/sources.list.d/pve-no-subscription.list
**Spécificité PVE** : Ne jamais ajouter de dépôts tiers non vérifiés sur un hyperviseur. Le dépôt enterprise est préférable en production (paquets testés plus rigoureusement, signés par Proxmox GmbH).
---
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 1.2.2.1 — Ensure updates, patches, and additional security software are installed |
| CIS Controls v8 | 7.3 — Perform Automated Operating System Patch Management |
| MITRE ATT&CK | T1190 (Exploit Public-Facing Application), M1051 (Update Software) |
| ISO 27001:2022 | A.8.8 — Management of technical vulnerabilities |
| PCI DSS v4.0 | 6.3.3 — Install security patches within one month |
| Scénario threat model | S3 (VM escape via CVE QEMU), S7 (supply chain) |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible. Les correctifs de sécurité Debian sont stables. Un reboot peut être nécessaire (kernel) mais Automatic-Reboot est désactivé.
🔍 Audit
Audit :
dpkg -l unattended-upgrades | grep -q "^ii" && echo "PASS: installé" || echo "FAIL: non installé"
systemctl is-enabled unattended-upgrades && echo "PASS: activé" || echo "FAIL: désactivé"
grep -v "^//" /etc/apt/apt.conf.d/50unattended-upgrades | grep -q "Debian-Security" \
&& echo "PASS: sécurité Debian configurée" || echo "FAIL: non configuré"
**Remédiation** :
apt install -y unattended-upgrades apt-listchanges
dpkg-reconfigure -plow unattended-upgrades
Contenu de `/etc/apt/apt.conf.d/50unattended-upgrades` :
Unattended-Upgrade::Origins-Pattern {
"origin=Debian,codename=${distro_codename}-security,label=Debian-Security";
// NE PAS ajouter de ligne pour les dépôts Proxmox
};
Unattended-Upgrade::Mail "admin@example.com";
Unattended-Upgrade::MailReport "on-change";
Unattended-Upgrade::Automatic-Reboot "false";
Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Remove-New-Unused-Dependencies "true";
Contenu de `/etc/apt/apt.conf.d/20auto-upgrades` :
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
**Valeur par défaut** : `unattended-upgrades` non installé.
**Rollback** : `apt purge unattended-upgrades`
**Spécificité PVE** : **Ne JAMAIS inclure les dépôts Proxmox dans unattended-upgrades.** Les mises à jour PVE (kernel, qemu-server, pve-manager) doivent être testées manuellement. Un kernel PVE qui ne démarre plus = downtime total. Procédure de mise à jour PVE manuelle → Phase 2 (2.4.1).
---
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 2.1.x — Ensure [service] is not installed |
| CIS Controls v8 | 4.8 — Uninstall or Disable Unnecessary Services |
| MITRE ATT&CK | T1543 (Create or Modify System Process), M1042 (Disable or Remove Feature or Program) |
| ISO 27001:2022 | A.8.9 — Configuration management |
| PCI DSS v4.0 | 2.2.4 — Only necessary services are enabled |
| Scénario threat model | S1, S3 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible.
🔍 Audit
Audit :
for pkg in telnet rsh-client rsh-server xinetd tftp-server nis \
avahi-daemon cups talk inetutils-talk postfix exim4; do
dpkg -l "$pkg" 2>/dev/null | grep -q "^ii" && echo "FAIL: $pkg installé" \
| echo "PASS: $pkg absent" |
done
**Remédiation** :
apt purge -y telnet rsh-client rsh-server xinetd tftp-server nis \
avahi-daemon cups cups-client talk inetutils-talk 2>/dev/null
apt autoremove -y
**Valeur par défaut** : Varie selon la méthode d'installation. L'installateur ISO PVE installe un minimum. L'installateur Debian peut inclure des paquets supplémentaires selon les sélections tasksel.
---
1.2 — Noyau et paramètres de démarrage
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏢🌐 |
| Réf. CIS Debian 13 | 1.4.1 — Ensure bootloader password is set |
| CIS Controls v8 | 4.1 |
| MITRE ATT&CK | T1542.003 (Bootkit), M1046 (Boot Integrity) |
| ISO 27001:2022 | A.8.5 — Secure authentication |
| PCI DSS v4.0 | 2.2.1 |
| Scénario threat model | S10 (accès physique) |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible. Le boot normal ne demande pas le mot de passe (paramètre --unrestricted). Le mot de passe n'est demandé que pour l'édition des entrées GRUB.
🔍 Audit
Audit :
grep -q "^set superusers" /boot/grub/grub.cfg && echo "PASS" || echo "FAIL"
grep -q "^password_pbkdf2" /boot/grub/grub.cfg && echo "PASS" || echo "FAIL"
**Remédiation** :
Générer le hash
grub-mkpasswd-pbkdf2
(saisir le mot de passe, noter le hash grub.pbkdf2.sha512.10000.XXXXX)
Configurer dans /etc/grub.d/40_custom :
cat >> /etc/grub.d/40_custom << 'EOF'
set superusers="grubadmin"
password_pbkdf2 grubadmin grub.pbkdf2.sha512.10000.<VOTRE_HASH>
EOF
Permettre le boot normal sans mot de passe
sed -i 's/class gnu-linux/class gnu-linux --unrestricted/' /etc/grub.d/10_linux
update-grub
**Valeur par défaut** : Pas de mot de passe GRUB.
**Rollback** : Supprimer les lignes ajoutées dans `/etc/grub.d/40_custom` et `update-grub`.
---
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 3.3.1 à 3.3.11 |
| CIS Controls v8 | 4.1, 4.8 |
| MITRE ATT&CK | T1557 (AitM), T1499 (Endpoint DoS), M1037 (Filter Network Traffic) |
| ISO 27001:2022 | A.8.20 — Network security, A.8.22 — Segregation of networks |
| PCI DSS v4.0 | 1.2.1, 1.3.1 |
| Scénario threat model | S1, S4, S9 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible. Exception critique : net.ipv4.ip_forward est nécessaire pour le réseau des VM. Ne PAS le désactiver si des VM ont un accès réseau.
🔍 Audit
Audit :
Vérifier les paramètres critiques
declare -A expected=(
["net.ipv4.conf.all.rp_filter"]="1"
["net.ipv4.conf.all.accept_redirects"]="0"
["net.ipv4.conf.all.send_redirects"]="0"
["net.ipv4.conf.all.accept_source_route"]="0"
["net.ipv4.conf.all.log_martians"]="1"
["net.ipv4.tcp_syncookies"]="1"
["net.ipv4.icmp_echo_ignore_broadcasts"]="1"
["net.ipv6.conf.all.accept_redirects"]="0"
["net.ipv6.conf.all.accept_source_route"]="0"
)
for key in "${!expected[@]}"; do
val=$(sysctl -n "$key" 2>/dev/null)
[ "$val" = "${expected[$key]}" ] && echo "PASS: $key = $val" \
| echo "FAIL: $key = $val (attendu: ${expected[$key]})" |
done
**Remédiation** :
Créer `/etc/sysctl.d/90-cis-network.conf` :
CIS 3.3.1 — Source routed packets
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.default.accept_source_route = 0
CIS 3.3.2 — ICMP redirects
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0
CIS 3.3.3 — Secure ICMP redirects
net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0
CIS 3.3.4 — Suspicious packets logged
net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1
CIS 3.3.5 — Broadcast ICMP requests
net.ipv4.icmp_echo_ignore_broadcasts = 1
CIS 3.3.6 — Bogus ICMP responses
net.ipv4.icmp_ignore_bogus_error_responses = 1
CIS 3.3.7 — Reverse path filtering
net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1
CIS 3.3.8 — TCP SYN cookies
net.ipv4.tcp_syncookies = 1
CIS 3.3.9 — IPv6 router advertisements
net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0
CIS 3.3.10 — Do not send ICMP redirects (not a router)
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
CIS 3.3.11 — IP forwarding
ATTENTION PVE : NE PAS DÉSACTIVER si les VM ont un accès réseau !
Proxmox gère ce paramètre — il DOIT être à 1 pour le réseau VM
net.ipv4.ip_forward = 0 # UNIQUEMENT si aucun réseau VM routé/NAT
sysctl --system
**Valeur par défaut** : La plupart de ces paramètres sont à des valeurs permissives (accept_redirects=1, log_martians=0, etc.). `ip_forward` est activé par Proxmox.
**Rollback** : `rm /etc/sysctl.d/90-cis-network.conf && sysctl --system`
**Spécificité PVE** : **`net.ipv4.ip_forward = 1` est requis par Proxmox** pour le réseau des VM (bridges, NAT). Ne le désactivez PAS. Le CIS recommande de le mettre à 0 « si le système n'est pas un routeur » mais un hyperviseur Proxmox EST effectivement un routeur pour ses VM.
---
| Profile Applicability | Level 2 — Server |
| Applicabilité PVE | 🏢🌐 |
| Réf. CIS Debian 13 | 1.5.1 à 1.5.4 |
| CIS Controls v8 | 4.1 |
| MITRE ATT&CK | T1068 (Exploitation for Privilege Escalation), M1050 (Exploit Protection) |
| ISO 27001:2022 | A.8.9 — Configuration management |
| PCI DSS v4.0 | 2.2.1 |
| Scénario threat model | S3 (VM escape), S6 (insider) |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible pour la plupart des workloads. ptrace_scope=2 empêche strace et gdb pour les utilisateurs non-root.
🔍 Audit
Audit :
declare -A expected=(
["kernel.kptr_restrict"]="2"
["kernel.dmesg_restrict"]="1"
["kernel.perf_event_paranoid"]="3"
["kernel.yama.ptrace_scope"]="2"
["kernel.unprivileged_bpf_disabled"]="1"
["kernel.kexec_load_disabled"]="1"
["fs.suid_dumpable"]="0"
)
for key in "${!expected[@]}"; do
val=$(sysctl -n "$key" 2>/dev/null)
[ "$val" = "${expected[$key]}" ] && echo "PASS: $key = $val" \
| echo "FAIL: $key = $val (attendu: ${expected[$key]})" |
done
**Remédiation** :
Créer `/etc/sysctl.d/90-cis-kernel.conf` :
Masquer les pointeurs kernel (prévient KASLR bypass)
kernel.kptr_restrict = 2
Restreindre dmesg aux privilégiés
kernel.dmesg_restrict = 1
Restreindre perf_event (profilage)
kernel.perf_event_paranoid = 3
Restreindre ptrace (debugging inter-processus)
kernel.yama.ptrace_scope = 2
Désactiver BPF non privilégié
kernel.unprivileged_bpf_disabled = 1
Durcir BPF JIT
net.core.bpf_jit_harden = 2
Désactiver kexec (chargement kernel à chaud)
kernel.kexec_load_disabled = 1
Restreindre userfaultfd
vm.unprivileged_userfaultfd = 0
Pas de core dumps des processus setuid
fs.suid_dumpable = 0
sysctl --system
**Valeur par défaut** : La plupart à 0 ou 1 (permissif). `kptr_restrict=0`, `dmesg_restrict=0`, `ptrace_scope=0`.
**Rollback** : `rm /etc/sysctl.d/90-cis-kernel.conf && sysctl --system`
---
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏢🌐 |
| Réf. CIS Debian 13 | 1.1.1.1 à 1.1.1.8 |
| CIS Controls v8 | 4.8 |
| MITRE ATT&CK | T1068 (Exploitation for Privilege Escalation), M1042 (Disable or Remove Feature) |
| ISO 27001:2022 | A.8.9 |
| PCI DSS v4.0 | 2.2.4 |
| Scénario threat model | S3, S10 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Faible. Ces modules ne sont pas utilisés sur un hyperviseur standard.
🔍 Audit
Audit :
for mod in cramfs freevxfs hfs hfsplus jffs2 udf dccp sctp rds tipc; do
result=$(modprobe -n -v "$mod" 2>&1)
echo "$result" | grep -q "install /bin/true\|install /bin/false" \
&& echo "PASS: $mod désactivé" || echo "FAIL: $mod chargeable"
done
**Remédiation** :
Créer `/etc/modprobe.d/cis-hardening.conf` :
CIS 1.1.1.1 — cramfs
install cramfs /bin/false
blacklist cramfs
CIS 1.1.1.2 — freevxfs
install freevxfs /bin/false
blacklist freevxfs
CIS 1.1.1.3 — hfs
install hfs /bin/false
blacklist hfs
CIS 1.1.1.4 — hfsplus
install hfsplus /bin/false
blacklist hfsplus
CIS 1.1.1.5 — jffs2
install jffs2 /bin/false
blacklist jffs2
CIS 1.1.1.7 — udf
install udf /bin/false
blacklist udf
Protocoles réseau obsolètes
install dccp /bin/false
blacklist dccp
install sctp /bin/false
blacklist sctp
install rds /bin/false
blacklist rds
install tipc /bin/false
blacklist tipc
Bluetooth (inutile sur un serveur)
install bluetooth /bin/false
blacklist bluetooth
Firewire
install firewire-core /bin/false
blacklist firewire-core
update-initramfs -u
**Valeur par défaut** : Modules chargeables à la demande.
**Rollback** : `rm /etc/modprobe.d/cis-hardening.conf && update-initramfs -u`
---
| Profile Applicability | Level 2 — Server |
| Applicabilité PVE | 🏢🌐 |
| Réf. CIS Debian 13 | Complémentaire (hardening kernel avancé) |
| CIS Controls v8 | 4.1 |
| MITRE ATT&CK | T1068, T1014 (Rootkit), M1050 (Exploit Protection) |
| ISO 27001:2022 | A.8.9 |
| Scénario threat model | S3 |
| Statut PVE 9 | ✅ Validé (paramètres listés), 🧪 Expérimental (lockdown=integrity) |
Description :
Description :
Rationale :
Rationale :
Impact : Surcoût performance ~1-5% selon le workload (principalement init_on_alloc/free).
🔧 Remédiation
Remédiation :
Dans /etc/default/grub :
GRUB_CMDLINE_LINUX_DEFAULT="quiet init_on_alloc=1 init_on_free=1 page_alloc.shuffle=1 slab_nomerge pti=on randomize_kstack_offset=on"
⚠️ NE PAS AJOUTER lockdown=integrity — ce paramètre empêche le chargement de modules kernel même par root. Il casse ZFS, Ceph, GPU passthrough et d'autres fonctionnalités Proxmox. Voir 12-experimental.md.
update-grub
NE PAS redémarrer immédiatement — tester d'abord les autres modifications
**Audit** :
cat /proc/cmdline | grep -o "init_on_alloc=1" && echo "PASS" || echo "FAIL"
**Valeur par défaut** : `quiet` uniquement.
---
1.3 — Comptes et authentification locale
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 5.3.1 — Configure PAM software packages, 5.4.1 — Ensure password creation requirements |
| CIS Controls v8 | 5.2 — Use Unique Passwords |
| MITRE ATT&CK | T1110 (Brute Force), M1027 (Password Policies) |
| ISO 27001:2022 | A.5.17 — Authentication information |
| PCI DSS v4.0 | 8.3.6 — Minimum password complexity |
| Scénario threat model | S1, S6 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
🔍 Audit
Audit :
grep -E "^minlen|^minclass|^dcredit|^ucredit" /etc/security/pwquality.conf 2>/dev/null
Résultat attendu : minlen = 14, minclass = 3
**Remédiation** :
apt install -y libpam-pwquality
Configurer `/etc/security/pwquality.conf` :
minlen = 14
minclass = 3
maxrepeat = 3
dictcheck = 1
dcredit = -1
ucredit = -1
lcredit = -1
ocredit = -1
**Valeur par défaut** : Aucune politique de complexité.
---
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 5.3.2 — Ensure lockout for failed password attempts |
| CIS Controls v8 | 5.6 — Centralize Account Management |
| MITRE ATT&CK | T1110 (Brute Force), M1036 (Account Use Policies) |
| ISO 27001:2022 | A.8.5 — Secure authentication |
| PCI DSS v4.0 | 8.3.4 — Lockout after 10 invalid attempts |
| Scénario threat model | S1 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
🔍 Audit
Audit :
grep -E "^deny|^unlock_time|^fail_interval" /etc/security/faillock.conf 2>/dev/null
**Remédiation** :
Configurer `/etc/security/faillock.conf` :
deny = 5
unlock_time = 900
fail_interval = 900
even_deny_root # PRUDENCE : peut bloquer les opérations cluster SSH
**Valeur par défaut** : Pas de verrouillage.
**Spécificité PVE** : **`even_deny_root` peut bloquer le cluster.** Les migrations et la réplication Proxmox utilisent SSH root entre les nœuds. Si l'authentification échoue plusieurs fois (ex : clé expirée), le compte root se verrouille sur le nœud distant → cluster cassé. Préférer Fail2Ban (Phase 3) pour la protection brute-force de root.
---
| Profile Applicability | Level 1 — Server |
| Réf. CIS Debian 13 | 5.5.5 — Ensure default user shell timeout is configured |
| CIS Controls v8 | 4.3 — Configure Automatic Session Locking |
| MITRE ATT&CK | T1078 (Valid Accounts) |
| ISO 27001:2022 | A.8.5 |
| Scénario threat model | S6 |
| Statut PVE 9 | ✅ Validé |
🔧 Remédiation
Remédiation :
Créer /etc/profile.d/cis-timeout.sh :
readonly TMOUT=900
export TMOUT
Valeur par défaut : Pas de timeout.
| Profile Applicability | Level 1 — Server |
| Réf. CIS Debian 13 | 1.7.1 à 1.7.6 |
| CIS Controls v8 | N/A |
| MITRE ATT&CK | N/A (contrôle juridique, pas technique) |
| ISO 27001:2022 | A.8.5 |
| PCI DSS v4.0 | 2.2.1 |
| Statut PVE 9 | ✅ Validé |
🔧 Remédiation
Remédiation :
cat > /etc/issue.net << 'EOF'
- Acces autorise uniquement. Toute activite est journalisee. *
- Les acces non autorises seront poursuivis conformement a la loi.*
EOF
cp /etc/issue.net /etc/issue
/etc/motd
**Valeur par défaut** : Informations système dans `/etc/issue` (version Debian, hostname).
---
1.4 — Journalisation et audit
| Profile Applicability | Level 2 — Server |
| Applicabilité PVE | 🏢🌐 (🟡 N2 pour 🏠) |
| Réf. CIS Debian 13 | 6.2.1 à 6.2.4 |
| CIS Controls v8 | 8.2 — Collect Audit Logs, 8.5 — Collect Detailed Audit Logs |
| MITRE ATT&CK | T1070 (Indicator Removal), T1078 (Valid Accounts), M1028 (Operating System Configuration) |
| ISO 27001:2022 | A.8.15 — Logging |
| PCI DSS v4.0 | 10.2.1 — Audit logs capture defined events |
| Scénario threat model | S1, S3, S6 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
Rationale :
Rationale :
Impact : Surcoût CPU ~2-4%, I/O supplémentaire selon le volume de logs. Surveiller la taille de /var/log/audit.
🔍 Audit
Audit :
systemctl is-active auditd && echo "PASS" || echo "FAIL"
auditctl -l | wc -l
Résultat attendu : > 0
**Remédiation** :
apt install -y auditd audispd-plugins
systemctl enable --now auditd
Créer `/etc/audit/rules.d/cis-hardening.rules` :
Purge des règles existantes
-D
Buffer
-b 8192
Action en cas d'erreur
-f 1
=== CIS 6.2.3.1-4 : Fichiers d'identité ===
-w /etc/passwd -p wa -k identity
-w /etc/shadow -p wa -k identity
-w /etc/group -p wa -k identity
-w /etc/gshadow -p wa -k identity
-w /etc/security/opasswd -p wa -k identity
=== CIS 6.2.3.5 : Réseau ===
-w /etc/hosts -p wa -k network
-w /etc/network/ -p wa -k network
=== CIS 6.2.3.6 : Sysctl ===
-w /etc/sysctl.conf -p wa -k sysctl
-w /etc/sysctl.d/ -p wa -k sysctl
=== CIS 6.2.3.7 : SSH ===
-w /etc/ssh/sshd_config -p wa -k sshd
-w /etc/ssh/sshd_config.d/ -p wa -k sshd
=== CIS 6.2.3.8 : PAM ===
-w /etc/pam.d/ -p wa -k pam
-w /etc/security/ -p wa -k pam
=== CIS 6.2.3.9 : Heure système ===
-a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change
=== CIS 6.2.3.10 : Cron ===
-w /etc/crontab -p wa -k cron
-w /etc/cron.d/ -p wa -k cron
-w /etc/cron.daily/ -p wa -k cron
-w /etc/cron.hourly/ -p wa -k cron
-w /etc/cron.weekly/ -p wa -k cron
-w /etc/cron.monthly/ -p wa -k cron
=== CIS 6.2.3.14 : Élévation de privilèges ===
-a always,exit -F arch=b64 -S execve -F euid=0 -F auid>=1000 -F auid!=4294967295 -k privilege_escalation
=== CIS 6.2.3.15 : Montage de filesystems ===
-a always,exit -F arch=b64 -S mount,umount2 -F auid>=1000 -F auid!=4294967295 -k mounts
=== CIS 6.2.3.17 : Suppression de fichiers ===
-a always,exit -F arch=b64 -S unlink,unlinkat,rename,renameat -F auid>=1000 -F auid!=4294967295 -k delete
=== CIS 6.2.3.19 : Modules kernel ===
-a always,exit -F arch=b64 -S init_module,finit_module,delete_module -k modules
-w /sbin/insmod -p x -k modules
-w /sbin/modprobe -p x -k modules
-w /sbin/rmmod -p x -k modules
=== SPÉCIFIQUE PROXMOX : Configuration PVE ===
-w /etc/pve/ -p wa -k proxmox-config
=== Verrouillage des règles (reboot requis pour modifier) ===
-e 2
augenrules --load
**Valeur par défaut** : `auditd` non installé.
**Rollback** : `systemctl stop auditd && apt purge auditd`
---
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 6.1.1 à 6.1.3 |
| CIS Controls v8 | 8.2 |
| MITRE ATT&CK | T1070.002 (Clear Linux Logs) |
| ISO 27001:2022 | A.8.15 |
| PCI DSS v4.0 | 10.2.1 |
| Scénario threat model | S6 |
| Statut PVE 9 | ✅ Validé |
🔧 Remédiation
Remédiation :
Dans /etc/systemd/journald.conf :
[Journal]
Storage=persistent
Compress=yes
SystemMaxUse=2G
SystemKeepFree=1G
ForwardToSyslog=yes
systemctl restart systemd-journald
Valeur par défaut : Storage=auto (persistant si /var/log/journal existe, sinon volatile).
1.5 — Services et processus
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 2.1.x à 2.3.x |
| CIS Controls v8 | 4.8 |
| MITRE ATT&CK | T1543 (Create or Modify System Process), M1042 |
| ISO 27001:2022 | A.8.9 |
| PCI DSS v4.0 | 2.2.4 |
| Scénario threat model | S1, S3 |
| Statut PVE 9 | ✅ Validé |
🔍 Audit
Audit :
Lister les ports en écoute
ss -tlnp | grep LISTEN
Résultat attendu : uniquement les ports PVE nécessaires
(22, 8006, 85, et selon le cas : 3128, 5405, 6789, 6800-7300)
**Remédiation** :
systemctl disable --now avahi-daemon.service 2>/dev/null
systemctl disable --now cups.service 2>/dev/null
systemctl disable --now rpcbind.service rpcbind.socket 2>/dev/null
| Profile Applicability | Level 2 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | Spécifique Proxmox (hors CIS) |
| CIS Controls v8 | 4.8 |
| MITRE ATT&CK | M1042 |
| Scénario threat model | S1, S3 |
| Statut PVE 9 | ✅ Validé |
Description :
Description :
🔧 Remédiation
Remédiation :
Si SPICE non utilisé (consoles VM) :
systemctl mask --now spiceproxy.service
Note : 'disable' ne suffit pas, pve-manager le réactive
Si Ceph non utilisé :
systemctl mask --now ceph.target
Note : 'disable' ne suffit pas, le service se réactive au reboot
Si ZFS non utilisé :
systemctl disable --now zfs-mount.service zfs-share.service zfs-zed.service
**Valeur par défaut** : Tous les services PVE actifs.
**Rollback** : `systemctl unmask <service>`
**Spécificité PVE** : Sur un nœud membre d'un cluster, ne JAMAIS masquer `corosync.service`, `pve-ha-lrm.service`, `pve-ha-crm.service`.
---
1.6 — AppArmor
| Profile Applicability | Level 1 — Server |
| Applicabilité PVE | 🏠🏢🌐 |
| Réf. CIS Debian 13 | 1.3.1.1 — Ensure AppArmor is installed, 1.3.1.2 — Ensure AppArmor is enabled |
| CIS Controls v8 | 4.1, 10.5 |
| MITRE ATT&CK | T1068 (Exploitation for Privilege Escalation), M1050 (Exploit Protection) |
| ISO 27001:2022 | A.8.7 — Protection against malware |
| PCI DSS v4.0 | 2.2.1 |
| Scénario threat model | S3 (VM escape) |
| Statut PVE 9 | ✅ Validé |
🔍 Audit
Audit :
aa-status --enabled && echo "PASS" || echo "FAIL"
aa-status 2>/dev/null | head -5
Résultat attendu : "apparmor module is loaded", X profiles, Y enforce
**Remédiation** :
apt install -y apparmor apparmor-utils
Vérifier la ligne de commande kernel
grep -qE "apparmor=1|security=apparmor" /proc/cmdline || {
sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="apparmor=1 security=apparmor /' /etc/default/grub
update-grub
echo "Reboot nécessaire pour activer AppArmor"
}
**Valeur par défaut** : AppArmor installé et actif sur Debian 13 et PVE 9.
**Spécificité PVE** : AppArmor est utilisé par PVE pour confiner les conteneurs LXC. Les profils par défaut sont fonctionnels. ⚠️ Régressions connues sur kernel 6.17 avec LXC nested — tester si nesting est utilisé.
---
1.7 — Checklist post-Phase 1
DÉPÔTS & PAQUETS
[ ] 1.1.1 — Dépôts Proxmox configurés, apt update sans erreur
[ ] 1.1.2 — unattended-upgrades configuré (sécurité Debian uniquement)
[ ] 1.1.3 — Paquets inutiles supprimés
KERNEL & BOOT
[ ] 1.2.1 — Mot de passe GRUB configuré (Level 2)
[ ] 1.2.2 — Sysctl réseau CIS 3.3.x appliqués
[ ] 1.2.3 — Sysctl kernel appliqués (Level 2)
[ ] 1.2.4 — Modules kernel inutiles blacklistés
[ ] 1.2.5 — Paramètres boot kernel appliqués (Level 2)
COMPTES & AUTH
[ ] 1.3.1 — Politique mots de passe (pwquality)
[ ] 1.3.2 — Verrouillage après échecs (faillock)
[ ] 1.3.3 — Timeout shell (TMOUT=900)
[ ] 1.3.4 — Bannière de connexion
JOURNALISATION
[ ] 1.4.1 — auditd installé + règles CIS + règle /etc/pve
[ ] 1.4.2 — journald en mode persistent
SERVICES
[ ] 1.5.1 — Services inutiles désactivés
[ ] 1.5.2 — Services PVE non utilisés masqués
APPARMOR
[ ] 1.6.1 — AppArmor actif et fonctionnel
VALIDATION
[ ] Reboot effectué
[ ] SSH fonctionnel
[ ] Web UI :8006 accessible
[ ] VM/CT de test démarrable
[ ] En cluster : migration live testée
[ ] ss -tlnp : uniquement les ports attendus
Navigation : ← 02-pre-installation.md | 04-proxmox-specifique.md →
-e