Host Revocation (KRL) Sync
OpenSSH servers check incoming user certificates against a local Key Revocation List (KRL) configured via the RevokedKeys directive in /etc/ssh/sshd_config.
Muljax ID provides an automated endpoint that outputs standard binary OpenSSH Key Revocation Lists (PROTOCOL.krl) ready for direct consumption by sshd:
GET /api/ssh/ca/revoked-keys?format=krlAlternatively, you can query ?format=raw for newline-delimited text specifications (serial: <id>) or JSON (default).
Deployment Options
Section titled “Deployment Options”Run this complete setup block as root on your target server (replace https://api.example.com with your API domain):
# 1. Create systemd servicesudo tee /etc/systemd/system/ssh-revoked-keys.service > /dev/null << 'EOF'[Unit]Description=Sync OpenSSH Revoked KeysAfter=network-online.targetWants=network-online.target
[Service]Type=oneshotExecStart=/bin/sh -c 'curl -fsSL "https://api.example.com/api/ssh/ca/revoked-keys?format=krl" -o /etc/ssh/revoked_keys.tmp && chmod 644 /etc/ssh/revoked_keys.tmp && mv /etc/ssh/revoked_keys.tmp /etc/ssh/revoked_keys'EOF
# 2. Create systemd timer (runs every 15 minutes)sudo tee /etc/systemd/system/ssh-revoked-keys.timer > /dev/null << 'EOF'[Unit]Description=Sync OpenSSH Revoked Keys Periodically
[Timer]OnBootSec=1minOnUnitActiveSec=15minPersistent=true
[Install]WantedBy=timers.targetEOF
# 3. Configure sshd and enable timersudo touch /etc/ssh/revoked_keysgrep -qxF 'RevokedKeys /etc/ssh/revoked_keys' /etc/ssh/sshd_config || echo 'RevokedKeys /etc/ssh/revoked_keys' | sudo tee -a /etc/ssh/sshd_configsudo systemctl daemon-reloadsudo systemctl enable --now ssh-revoked-keys.timersudo systemctl reload sshdFile: /etc/systemd/system/ssh-revoked-keys.service
[Unit]Description=Sync OpenSSH Revoked KeysAfter=network-online.targetWants=network-online.target
[Service]Type=oneshotExecStart=/bin/sh -c 'curl -fsSL "https://api.example.com/api/ssh/ca/revoked-keys?format=krl" -o /etc/ssh/revoked_keys.tmp && chmod 644 /etc/ssh/revoked_keys.tmp && mv /etc/ssh/revoked_keys.tmp /etc/ssh/revoked_keys'File: /etc/systemd/system/ssh-revoked-keys.timer
[Unit]Description=Sync OpenSSH Revoked Keys Periodically
[Timer]OnBootSec=1minOnUnitActiveSec=15minPersistent=true
[Install]WantedBy=timers.targetVerifying the Host Setup
Section titled “Verifying the Host Setup”-
Check Timer Execution:
Terminal window systemctl list-timers ssh-revoked-keys.timerEnsure the timer shows active triggers for future executions.
-
Trigger Manual Synchronization:
Terminal window sudo systemctl start ssh-revoked-keys.service -
Inspect Revoked Keys Content:
Terminal window cat /etc/ssh/revoked_keys -
Verify Service Logs:
Terminal window journalctl -u ssh-revoked-keys.service -n 50