Skip to content

Provision lab VMs with OpenTofu, and encrypt the state before the first apply #445

Closed

Description

@Gerrrt

#440 makes templates; something
has to turn them into machines.
ADR-0029's
six guests, #421's attack VM and
targets, and ADR-0030's odin are all repeated shapes, and the estate has no
way to express them.

OpenTofu rather than Terraform, and the reason is not licensing

terraform.tfstate stores secrets in cleartext. The state file holds every
value the provider touched, including the ones read from a secrets store — the
upstream issue has been open since 2014, and ephemeral values do not yet cover
the Proxmox provider's data sources.

Dropped into this repo unchanged, that would undo
ADR-0005 (values encrypted, keys
plaintext, git log -p as a rotation audit),
ADR-0020
(per-stack recipients, so a lab host cannot decrypt the estate's SNMP
communities) and
ADR-0024
(a per-recipient proof deadline) in a single commit — and it would do it
quietly, which is the failure mode this repository keeps finding one level up
each time.

OpenTofu has encrypted state. That is the deciding property here. The
licence change is incidental.

Guards that land before the first apply, not after

  • state_encryption configured, keyed from the same age material the estate
    already holds.
  • The state directory gitignored, and asserted untracked by
    scripts/check-tracked-artefacts.sh — whose patterns are already deliberately
    unanchored, for exactly this class of miss.
  • A gitleaks rule for tfstate shapes, in .gitleaks.toml alongside the four
    that already exist.
  • The jumpbox recorded in docs/security.md as a secret-bearing host, the way
    prometheus already is.

Prove it rather than assume it: after the first apply, grep the state for a
known secret and get nothing back. Then try to git add it and confirm
validation fails. Both halves — a check that has never been seen to fail is a
check nobody has tested.

Also worth taking from the same source

Proxmox host pools declared as a managed resource, so a pool is created and
destroyed with the VMs it groups. Directly useful for the six-guest domain and
for #421's range.

What it waits on

#436 and
#440.

Purchases this needs

None.


Corrected 2026-09-19

Read "the jumpbox" as phoenix throughout (ADR-0043). The ask to record it in docs/security.md as a secret-bearing host is now a checklist item rather than a decision: build-the-jumpbox.md frames it as exactly that. Gates (#436, #440) unchanged. The tfstate argument is untouched by anything that has landed.


Corrected 2026-09-20

Half the gate has cleared: #436 closed 2026-09-20 (phoenix built). What remains in front of this is #440 alone — the templates this provisions from.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA new capability or a changelabstacks/lab on alexander (VLAN 30)securityA credential, an exposure, or a control that is weaker than recorded

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions