Expose a VM's SSH host keys in the customer API - #324
Merged
Conversation
This was referenced Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #154.
ApiVmStatusgainshost_ssh_keys: [{ key_type, public_key, fingerprint_sha256 }]— empty until captured, so a client can verify the host on first connect instead ofaccept-new. Kieran's call on the issue: scanned withssh-keyscanfrom the Proxmox node, public keys only, nothing runs in the guest.lnvps_api/src/worker.rs:917): the keys do not exist until cloud-init has made them and sshd is up, and a VM that has none self-heals. VMs that already have keys skip immediately; a guest that never answers is retried at most hourly (HOST_KEY_SCAN_RETRY_SECS).worker.rs:2560) — the guest regenerates its keys, so the stored ones belong to an image that is gone.vm.ssh_host_keysrather than a table: the set is written and read whole and never queried by key. It has its own DB method (lnvps_db/src/lib.rs:423) and is deliberately not part ofupdate_vm, so a caller holding a VM loaded before the capture cannot wipe it.lnvps_api_common/src/ssh_host_key.rs); anything not a well-formed line of a known algorithm, or whose blob disagrees with its stated type, is dropped rather than handed to a client to pin. Fingerprints are pinned in the tests againstssh-keygen -lfoutput for the same key.vm_to_statusparsed, and an e2e assertion that it is an empty array before capture and the parsed key afterwards.The scan itself has no test — it needs a Proxmox node and a booted guest. It uses the same
connect_with_key+executepattern as the host-info collector (worker.rs:1441).Originating channel: Buzz #721a8a6c-c36c-5fa1-ae07-822ddc8567c5