Harden image integrity, guest preparation, and Proxmox template replacement#5
Open
iandk wants to merge 24 commits into
Open
Harden image integrity, guest preparation, and Proxmox template replacement#5iandk wants to merge 24 commits into
iandk wants to merge 24 commits into
Conversation
iandk
marked this pull request as ready for review
July 17, 2026 23:45
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.
Why
Cloudbuilder turns upstream cloud images into reusable Proxmox templates and
therefore sits on a destructive and security-sensitive path: it downloads and
customizes operating-system images, replaces existing templates, and affects
every VM cloned from those templates.
The previous implementation relied on mutable upstream downloads, had limited
validation of customized or imported images, and replaced templates without a
complete rollback transaction. Several guest assumptions had also drifted
across current RHEL, Debian, Fedora, openSUSE, Ubuntu, and Alpine releases.
This PR makes reliability and fail-closed behavior the default. In particular,
successful updates preserve the existing VMID, and every managed template is
required to consume its Proxmox Cloud-Init drive.
What changed
Image provenance and downloads
of the final customized artifact.
unexpected fields, backing-file images, and digest mismatches before publish.
and Ubuntu 25.10 from active management. Existing Proxmox templates for those
releases are deliberately not deleted.
Proxmox replacement safety
backup instead of an unprotected destroy/import sequence.
to that VMID when cutover fails.
clone state cannot be established safely.
with
ciupgrade=0, and require a Cloud-Init drive on imported templates.same-name template before local publication, download, clone lookup, or
Proxmox mutation.
Guest correctness and security
contract for legacy systemd, split systemd, and OpenRC guests.
read-only before publishing normal builds or manifest imports.
placeholders without relying on
systemctlcapability probes inside thevirt-customizechroot.PasswordAuthentication noandPermitRootLogin nowithout retaining atemporary host key.
first boot indefinitely.
and Rocky mirrors.
relabel RHEL images with the guest's own SELinux policy, and verify critical
PID 1/QGA labels before publication.
without truncating following YAML.
Maintenance and documentation
templates.json, the unitsuite, and the network wait script.
linked-clone checks, transactional rollback, VMID preservation, Cloud-Init
lifecycle variants, SSH policy, SELinux/BLS behavior, and distro catalog rules.
requirements, supported testing paths, and operational recovery behavior.
the intentional project history.
self-update behavior.
Validation performed
64/64Python unit tests passed locally and on the Proxmox host.identity, SSH policy, disk growth, guest-agent/service state, and bounded
network waits were checked across the distro matrix.
machine identity, unique clone machine IDs/SSH host keys, clean Cloud-Init
status, exact injected data, and approximately +1 GiB root filesystem growth.
transactionally with their original VMIDs preserved.
passed a fresh post-cutover live clone test from VMID 9008.
qemu-img check, and no-backing-file validation.actual guest guard ran successfully on Alma, Fedora, Debian, openSUSE, and
Alpine overlays.
stopped template state,
ciupgrade=0, Cloud-Init drive, SCSI disk, firewall,no locks, no staging/canary VMs or volumes, and no modification of the three
unmanaged EOL templates.
cloudbuilder.py --statusleft metadata unchanged.The BM1 test bridge intentionally had no DHCP service. This validated the
bounded no-lease behavior and absence of first-boot hangs; it did not validate
successful DHCP lease acquisition from that bridge.
Compatibility and rollout notes
for a full rollback clone and a candidate during cutover.
rebuild before they can be trusted as cache/recovery inputs.
cluster-wide locking and VMID reservation and are intentionally outside this
PR.
model is pinned upstream digests plus verified final-artifact metadata.
Reviewer focus
proxmox.py.cloudbuilder.py.template.py.templates.json.clear enough for existing deployments.
Checklist