· Henning Scholand · Proxmox  · 2 Min. Lesezeit

Proxmox Cluster-Sicherheit — Corosync, Zertifikate und Audit-Logging

Cluster-Kommunikation verschlüsseln, TLS-Zertifikate automatisieren und mit auditd nachvollziehen wer was wann gemacht hat — Sicherheit auf Node-Ebene.

Cluster-Kommunikation verschlüsseln, TLS-Zertifikate automatisieren und mit auditd nachvollziehen wer was wann gemacht hat — Sicherheit auf Node-Ebene.

Ein Proxmox-Cluster ohne Härtung der Cluster-Kommunikation ist wie ein verschlossenes Haus mit offenem Kellerfenster. Corosync, die Cluster-Kommunikationsschicht, und die API-Zertifikate sind Angriffspunkte die oft übersehen werden.

Corosync-Verschlüsselung

Corosync authentifiziert Cluster-Nodes per symmetrischem Schlüssel. Der Schlüssel wird beim Cluster-Erstellen generiert und liegt unter /etc/corosync/authkey.

# Aktuellen Key prüfen
ls -la /etc/corosync/authkey
# Sollte 400 sein, owner root

# Schlüssel auf Gültigkeit prüfen
corosync-keygen --help
# Neuen Key generieren (alle Nodes danach neu joinen lassen!)
corosync-keygen -k /etc/corosync/authkey

Corosync-Konfiguration mit aktivierter Verschlüsselung:

# /etc/corosync/corosync.conf

totem {
    version: 2
    cluster_name: proxmox-prod
    transport: knet

    # Verschlüsselung: immer aktivieren
    crypto_cipher: aes256
    crypto_hash: sha256

    # Cluster-Netz: dediziertes Management-Interface
    interface {
        ringnumber: 0
        bindnetaddr: 10.0.0.0
        mcastport: 5405
        ttl: 1
    }
}

nodelist {
    node {
        ring0_addr: 10.0.0.10
        name: pve01
        nodeid: 1
    }
    node {
        ring0_addr: 10.0.0.11
        name: pve02
        nodeid: 2
    }
}

quorum {
    provider: corosync_votequorum
    expected_votes: 2
    wait_for_all: 1
}
systemctl restart corosync
# Verschlüsselung verifizieren
corosync-cfgtool -s

Dediziertes Cluster-Netz

Corosync-Traffic sollte niemals über das VM-Interface laufen:

# Cluster-Link auf dediziertes Interface setzen
pvecm add 10.0.0.11 --link0 10.0.0.10
# --link0 = IP des lokalen Interfaces für Cluster-Kommunikation

TLS-Zertifikate mit ACME automatisieren

Proxmox nutzt per Default ein selbst-signiertes Zertifikat. ACME (Let’s Encrypt) löst das automatisch:

# ACME-Account anlegen
pvesh create /nodes/pve01/acme/account \
  --contact admin@henningscho.land \
  --name default \
  --tos_url https://letsencrypt.org/documents/LE-SA-v1.3-September-21-2022.pdf

# DNS-Plugin konfigurieren (hier: Cloudflare)
pvesh create /cluster/acme/plugins \
  --id cloudflare \
  --type dns \
  --api cf \
  --data "CF_Token=<dein-cloudflare-api-token>"

# Domain für Node konfigurieren und Zertifikat ausstellen
pvenode acme cert order

# Auto-Renewal: läuft automatisch via systemd timer
systemctl status proxmox-daily-update.timer

Audit-Logging mit auditd

apt install auditd audispd-plugins -y
# /etc/audit/rules.d/proxmox.rules

# Konfigurationsänderungen überwachen
-w /etc/pve/ -p wa -k proxmox-config
-w /etc/ssh/sshd_config -p wa -k ssh-config
-w /etc/corosync/ -p wa -k corosync-config

# Privilegierte Befehle
-a always,exit -F arch=b64 -S execve -F uid=0 -k root-commands

# Login-Ereignisse
-w /var/log/auth.log -p wa -k auth-log

# Systemcalls die auf Privilege-Escalation hindeuten
-a always,exit -F arch=b64 -S setuid -S setgid -k priv-escalation
augenrules --load
systemctl enable --now auditd

# Logs auswerten
ausearch -k proxmox-config --interpret
aureport --summary

Cluster-Quorum absichern

Ein 2-Node-Cluster hat ein inhärentes Quorum-Problem: fällt ein Node aus, verliert der andere das Quorum und setzt VMs an.

# QDevice für 2-Node-Cluster (dritter Voter, z.B. auf PBS-Host)
apt install corosync-qdevice  # auf dem QDevice-Host
pvecm qdevice setup 10.20.0.50  # IP des QDevice-Hosts

Im nächsten Teil der Serie richten wir Role-Based Access Control ein und binden Active Directory an.

Zum Blog

Ähnliche Artikel

Alle Artikel »