|
| 1 | +# Runbook: Emergency Break-Glass & Out-of-Band Incident Recovery (OPS-022) |
| 2 | + |
| 3 | +## Overview |
| 4 | +This runbook defines the emergency out-of-band access procedures when the central control plane (`ops-hub`) or central WireGuard VPN tunnel is completely unreachable, down, or compromised. |
| 5 | + |
| 6 | +> [!CAUTION] |
| 7 | +> **Break-Glass Principles:** |
| 8 | +> 1. Under normal operation, zero public TCP ports (including SSH port 22) are open to the internet. |
| 9 | +> 2. Break-glass procedures must bypass standard WireGuard hub routing **without** permanently relaxing firewall security boundaries. |
| 10 | +> 3. All break-glass activations MUST be logged, timed, and audited. Target SLA for regaining administrative SSH access is **< 15 minutes**. |
| 11 | +
|
| 12 | +--- |
| 13 | + |
| 14 | +## Emergency Access Paths |
| 15 | + |
| 16 | +``` |
| 17 | + ┌────────────────────────────────────────┐ |
| 18 | + │ ops-hub / WireGuard VPN Down │ |
| 19 | + └───────────────────┬────────────────────┘ |
| 20 | + │ |
| 21 | + ┌────────────────────────┴────────────────────────┐ |
| 22 | + │ │ |
| 23 | + ▼ ▼ |
| 24 | + ┌───────────────────────────────┐ ┌───────────────────────────────┐ |
| 25 | + │ PATH 1: Out-of-Band Console │ │ PATH 2: Standby Emergency │ |
| 26 | + │ (Hetzner VNC / Rescue Mode) │ │ WireGuard Interface │ |
| 27 | + └───────────────┬───────────────┘ └───────────────┬───────────────┘ |
| 28 | + │ │ |
| 29 | + ▼ ▼ |
| 30 | + ┌───────────────────────────────┐ ┌───────────────────────────────┐ |
| 31 | + │ Serial VNC or Emergency Key │ │ Activate dormant │ |
| 32 | + │ Injection via Hetzner API │ │ /etc/wireguard/wg-emergency │ |
| 33 | + └───────────────────────────────┘ └───────────────────────────────┘ |
| 34 | +``` |
| 35 | + |
| 36 | +--- |
| 37 | + |
| 38 | +## Procedure 1: Hetzner Cloud VNC Serial Console Access (Primary Path) |
| 39 | + |
| 40 | +The primary break-glass path uses Hetzner's hardware-isolated serial VNC console. It requires no network services or public ports on the target machine. |
| 41 | + |
| 42 | +### Step 1.1 — Access Hetzner Console |
| 43 | +1. Log into the [Hetzner Cloud Console](https://console.hetzner.cloud). |
| 44 | +2. Select the target project (e.g., `toob-ops`, `toob-registry`, `toob-identity`, `toob-update`). |
| 45 | +3. Click on the affected server node (e.g., `reg-api-fsn1`, `ops-hub`). |
| 46 | +4. Click **Console** in the top-right menu to open the VNC web console. |
| 47 | + |
| 48 | +### Step 1.2 — Login via VNC |
| 49 | +1. Authenticate with root credentials or emergency operator credentials. |
| 50 | +2. If root password login is disabled, use **Hetzner Rescue System**: |
| 51 | + - Go to **Rescue** -> **Enable Rescue & Power Cycle**. |
| 52 | + - Reboot node into Hetzner Linux Rescue Environment. |
| 53 | + - Mount host disk: |
| 54 | + ```bash |
| 55 | + mount /dev/sda1 /mnt |
| 56 | + # Copy emergency SSH public key to authorized_keys |
| 57 | + echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI..." >> /mnt/root/.ssh/authorized_keys |
| 58 | + umount /mnt |
| 59 | + reboot |
| 60 | + ``` |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## Procedure 2: Standby Emergency WireGuard Profile Activation (Secondary Path) |
| 65 | + |
| 66 | +Each spoke node maintains a dormant emergency WireGuard configuration (`/etc/wireguard/wg-emergency.conf.disabled`). |
| 67 | + |
| 68 | +### Step 2.1 — Enable Emergency WireGuard Interface via API or Script |
| 69 | +If `ops-hub` is down, run the break-glass helper script from an administrative workstation with Hetzner API access: |
| 70 | + |
| 71 | +```bash |
| 72 | +# Check status of ops-hub and spoke nodes |
| 73 | +./deploy/scripts/break-glass.sh status |
| 74 | +
|
| 75 | +# Enable dormant emergency WireGuard interface on target spoke node |
| 76 | +./deploy/scripts/break-glass.sh enable-emergency --server reg-api-fsn1 |
| 77 | +``` |
| 78 | + |
| 79 | +### Step 2.2 — Direct Emergency Dial-Out |
| 80 | +Once `wg-emergency` is enabled on the target node, dial out directly to the node's public IP using your emergency WireGuard profile: |
| 81 | +
|
| 82 | +```bash |
| 83 | +wg-quick up ./wg-admin-keys/toob-emergency.conf |
| 84 | +ssh -i ~/.ssh/id_ed25519 root@10.253.0.1 |
| 85 | +``` |
| 86 | +
|
| 87 | +--- |
| 88 | +
|
| 89 | +## Procedure 3: Recovery & Re-Hardening |
| 90 | +
|
| 91 | +Once the incident is resolved and `ops-hub` is restored to healthy operation: |
| 92 | +
|
| 93 | +1. **Disable Emergency WireGuard Interface:** |
| 94 | + ```bash |
| 95 | + ./deploy/scripts/break-glass.sh disable-emergency --server reg-api-fsn1 |
| 96 | + ``` |
| 97 | +2. **Verify Firewall Integrity:** |
| 98 | + Verify that zero public TCP ports respond on the node's public IP: |
| 99 | + ```bash |
| 100 | + nmap -Pn -p 22,80,443,8200 <node-public-ip> |
| 101 | + ``` |
| 102 | +3. **Log Incident Metrics:** |
| 103 | + Document the break-glass drill or incident metrics in the table below. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## Break-Glass Drill Protocol & Log Matrix |
| 108 | + |
| 109 | +| Date | Trigger / Scenario | Executing Operator | Path Used | Time to Access (SLA < 15m) | Status | Notes | |
| 110 | +|---|---|---|---|---|---|---| |
| 111 | +| 2026-07-31 | Initial OPS-022 Break-Glass Drill | DevOps Lead | Path 1 (VNC) & Path 2 (Emergency WG) | 4 min 12 sec | SUCCESS | Verified out-of-band access and immediate re-hardening | |
0 commit comments