Skip to content

pvewarden 0.1.2

Choose a tag to compare

@github-actions github-actions released this 01 Nov 23:07
· 18 commits to main since this release

Security

  • Every guest has its own SSH key, made on the server when the guest is enrolled. Before, guests
    shared one key and the server connected to whatever address a guest reported, so a compromised
    guest with the update tag could report another guest's address and have updates run there
    without a snapshot and without that guest's tags. Now the server picks the key by VMID and the
    other guest refuses it. Guest host keys are remembered per VMID too.
  • Enrolling switches a guest to its new key in checked steps and never leaves it half switched: if a
    step fails, the server refuses the guest until it is enrolled again. Re-enrolling rotates the key.
  • Upgrading: pvewarden-setup upgrade enrolls the guests again and then removes the old shared
    key. Guests that are not enrolled again are refused ("has no pvewarden key of its own yet").
  • A shared [ssh] key is still possible, but only for guests whose address is fixed in the config.
  • New pvewarden key new|verify|activate|remove|list for manual installs.

One change per guest at a time

  • Every change to a guest (snapshot, update, waiting for an update, reboot, rollback, snapshot
    deletion) holds a lock for that guest; a second one is refused at once. Before, two updates of one
    guest called at the same time took two snapshots, and the second removed the first one's record of
    the running update, which unblocked reboot and rollback while dpkg ran.
  • A running update is recorded before anything changes, with a random run id, and outlives a server
    restart. Only its own run removes it. The guest names each run, and update_result lifts the
    block only when the result is provably from that run, or when provably nothing ran
    (never_started). When pvewarden cannot tell (e.g. the update process vanished during dpkg), the
    guest stays blocked and a human clears it after checking: pvewarden pending list|clear <vmid>.
  • A lost SSH connection during an update no longer counts as a failed update: the guest stays
    blocked and update_result picks it up.
  • Writes of that record are fsynced together with its directory (and the directory's creation), so
    on file systems that honour fsync it survives a power loss.
  • Enrolling a guest takes its lock in each step, and a new key is refused while an update's result
    is unknown.

Audit log

  • A call that is cancelled (client gone, server stopping) still gets its tool_result record
    (cancelled).
  • Every tool call gets an id and two records: tool_call (agent, IP, arguments) before it runs and
    tool_result (ok, error with the reason, or asked_user, and the duration) after. Records
    written in between carry the same id. Before, errors and refusals had no outcome record.
  • A tool that changes something does not run if its tool_call record cannot be written.
  • Refused requests are summarised per address and minute (http_denied_summary with a count)
    instead of one line each, so a flood of them cannot fill the disk.
  • The HTTP layer no longer reads every request body into memory for the audit log.

Limits

  • Requests larger than 1 MiB are refused (413), also when they are streamed.
  • More than 16 MiB of output from one guest command is refused; the run log stays as small. Output
    is read in blocks, so one endless line from a guest cannot break reading.
  • The server rotates its audit log weekly (a year kept, logrotate) and removes run logs older than
    180 days (systemd-tmpfiles).

Supply chain

  • requirements.lock pins every dependency with SHA-256 hashes. The server installs them with
    --require-hashes --only-binary=:all:: no unpinned build tools, no pip upgrade from the network.
    pvewarden itself is copied from the checked source instead of being built.
  • Release files get a signed build provenance attestation
    (gh attestation verify <file> -R matousfiser/pvewarden).

Rollback

  • After every rollback pvewarden waits until the guest answers again and reports its state, also
    when the guest kept running (before, only when it had to start it).
  • The security model documents what a snapshot is (disk only, crash-consistent; file system
    consistent with the guest agent's freeze) and what that means for databases.
  • Open, accepted as lower priority for now: snapshots are recognised as pvewarden's by their name
    prefix alone (rollback and deletion still need the user's confirmation). Planned for 0.1.3.

Installer

  • A pool, role or user with pvewarden's names that the installer did not create is no longer taken
    over silently: the install stops before any change, or takes them over only when you say so
    (dialog, or PVEWARDEN_ADOPT_EXISTING=yes). Before, it rewrote an existing Warden role's
    privileges and uninstall deleted such objects. uninstall now deletes only what the installer
    created or took over (/etc/pvewarden/owned.conf); upgrades record the objects of older installs.
  • Upgrading an install from before 0.1.2 no longer records the pool, role and user as created by
    pvewarden: older installers may have taken over existing ones. The upgrade asks (default no;
    PVEWARDEN_ADOPT_EXISTING=yes with --yes). uninstall always removes pvewarden's API token,
    also from a user it leaves in place, and prints how to remove what it left.
  • When a step fails, pvewarden-setup says so instead of stopping without a word.
  • When a guest refuses the server's new key because the server's address changed (DHCP),
    pvewarden-enroll says so; docs/troubleshooting.md has the steps to move to a new address.