Date : 2026-03-21
Auteur : Daniel Caron
Version OS : Debian 12 (Bookworm) — kernel 6.1.0-44-cloud-amd64
Rôle : Publication de la CRL (Certificate Revocation List) — HTTP
VLAN : 60 (Serveurs)
IP : 10.21.60.15
FQDN : whvd9998.home.carontech.net
URL CRL : http://pki.home.carontech.net/crl/intermediate.crl
whvd9998 est le serveur de publication de la CRL CaronTech. Il sert le fichier CRL via HTTP (non HTTPS — standard PKI) et le synchronise automatiquement depuis la CA intermédiaire whvd9999 toutes les 30 minutes via rsync.
whvd9999 (CA intermédiaire)
└── /opt/pki/intermediate-ca/crl/intermediate.crl
│
│ rsync toutes les 30 min (clé id_ed25519_crl_rsync)
▼
whvd9998 (serveur CRL)
└── /var/www/crl/intermediate.crl
│
│ HTTP (Nginx)
▼
http://pki.home.carontech.net/crl/intermediate.crl
Note : La CRL est servie en HTTP et non HTTPS — c'est le standard PKI. Les clients vérifient la CRL avant d'établir une connexion TLS, ils ne peuvent donc pas utiliser TLS pour récupérer la CRL elle-même.
whvd9998⚠️ Note : Ce template utilise la clé SSH de l'hôte Proxmox par défaut. Après le clone, se connecter depuis le shell Proxmox et ajouter la clé
vmadminmanuellement. Voir Runbook — Création VM.
| Type | Nom | Valeur |
|---|---|---|
| A | whvd9998.home.carontech.net |
10.21.60.15 |
| CNAME | pki.home.carontech.net |
whvd9998.home.carontech.net |
sudo apt update && sudo apt upgrade -y
sudo apt install -y nginx
sudo systemctl enable nginx
sudo systemctl start nginx
sudo mkdir -p /var/www/crl
sudo chown www-data:www-data /var/www/crl
sudo chmod 755 /var/www/crl
sudo nano /etc/nginx/sites-available/pki.home.carontech.net
server {
listen 80;
server_name pki.home.carontech.net;
server_tokens off;
# URL exacte du CDP défini dans les certificats
# http://pki.home.carontech.net/crl/intermediate.crl
location /crl/ {
alias /var/www/crl/;
add_header Content-Type application/pkix-crl;
add_header Cache-Control "public, max-age=3600";
add_header X-Content-Type-Options nosniff;
expires 1h;
}
# Bloquer tout le reste
location / {
return 404;
}
access_log /var/log/nginx/crl_access.log;
error_log /var/log/nginx/crl_error.log warn;
}
sudo ln -s /etc/nginx/sites-available/pki.home.carontech.net /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
Note : Le fichier
defaultdanssites-enabledpeut être conservé comme catch-all — il ne répond qu'aux requêtes sansserver_namecorrespondant.
La synchronisation CRL utilise une clé SSH dédiée id_ed25519_crl_rsync — séparée de la clé vmadmin standard.
sudo ssh-keygen -t ed25519 -f /root/.ssh/id_ed25519_crl_rsync -C "crl-rsync@whvd9998" -N ""
Note : Pas de passphrase — la clé est utilisée par un cron automatique (root).
sudo cat /root/.ssh/id_ed25519_crl_rsync.pub
Sur whvd9999, ajouter dans ~/.ssh/authorized_keys de debianadmin :
# Sur whvd9999
echo "ssh-ed25519 AAAA.... crl-rsync@whvd9998" >> /home/debianadmin/.ssh/authorized_keys
sudo ssh -i /root/.ssh/id_ed25519_crl_rsync [email protected] "echo OK"
sudo nano /etc/cron.d/crl-sync
# Sync toutes les 30 minutes depuis la CA
*/30 * * * * root rsync -az --delete \
-e "ssh -i /root/.ssh/id_ed25519_crl_rsync" \
[email protected]:/opt/pki/intermediate-ca/crl/intermediate.crl \
/var/www/crl/intermediate.crl \
&& chown www-data:www-data /var/www/crl/intermediate.crl
# Vérification expiration CRL tous les jours à 8h
0 8 * * * root /usr/local/bin/check-crl-expiry.sh
sudo nano /usr/local/bin/check-crl-expiry.sh
#!/bin/bash
CRL_FILE="/var/www/crl/intermediate.crl"
if [ ! -f "$CRL_FILE" ]; then
logger -t crl-check "ERREUR: Fichier CRL introuvable : $CRL_FILE"
exit 1
fi
# Vérifier si le CRL est au format DER, convertir si nécessaire
file_type=$(openssl crl -in "$CRL_FILE" -text -noout 2>/dev/null && echo "PEM" || echo "DER")
if [ "$file_type" = "DER" ]; then
NEXT_UPDATE=$(openssl crl -in "$CRL_FILE" -inform DER -noout -nextupdate 2>/dev/null | cut -d= -f2)
else
NEXT_UPDATE=$(openssl crl -in "$CRL_FILE" -noout -nextupdate 2>/dev/null | cut -d= -f2)
fi
EXPIRY_EPOCH=$(date -d "$NEXT_UPDATE" +%s)
NOW_EPOCH=$(date +%s)
DIFF=$(( (EXPIRY_EPOCH - NOW_EPOCH) / 3600 ))
if [ "$DIFF" -lt 24 ]; then
MSG="ALERTE: CRL intermediate expire dans ${DIFF}h ! URI: http://pki.home.carontech.net/crl/intermediate.crl"
echo "$MSG" | mail -s "[PKI] CRL EXPIRY WARNING - carontech.net" [email protected]
logger -t crl-check "WARNING: $MSG"
elif [ "$DIFF" -lt 72 ]; then
logger -t crl-check "INFO: CRL expire dans ${DIFF}h - surveillance active"
fi
echo "CRL valide encore ${DIFF} heures (prochaine mise à jour : $NEXT_UPDATE)"
sudo chmod +x /usr/local/bin/check-crl-expiry.sh
| Source | Destination | Port | Action |
|---|---|---|---|
| VLAN 60 (Serveurs) | whvd9998 (10.21.60.15) |
80 | Allow |
whvd9998 |
whvd9999 (10.21.60.13) |
22 | Allow |
Note : La CRL est accessible en HTTP depuis la zone Serveurs uniquement — les clients vérifient la CRL lors de la validation des certificats internes.
sudo systemctl status nginx
curl -I http://pki.home.carontech.net/crl/intermediate.crl
ls -lh /var/www/crl/intermediate.crl
openssl crl -in /var/www/crl/intermediate.crl -noout -text
sudo /usr/local/bin/check-crl-expiry.sh
sudo grep crl-sync /var/log/syslog | tail -20
sudo tail -f /var/log/nginx/crl_access.log
sudo tail -f /var/log/nginx/crl_error.log
| Priorité | Amélioration | Notes |
|---|---|---|
| 🟡 Moyenne | Configurer mailutils pour les alertes email |
Requis pour check-crl-expiry.sh |
| 🟢 Basse | Monitoring accès CRL | Alertes si aucune requête depuis X heures |