Skip to content

docs(tofu): record the first apply and both proofs as run, and set umask 077 (#445) - #828

Merged
Gerrrt merged 3 commits into
mainfrom
gerrrt/tofu-proof-as-run
Oct 3, 2026
Merged

Gerrrt merged 3 commits into
mainfrom
gerrrt/tofu-proof-as-run

Conversation

@Gerrrt

@Gerrrt Gerrrt commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Closes #445.

The first apply has run, and both halves of the proof the issue asked for passed against real state on phoenix. That was the last condition Gerrrt/HomeLab#803 left open.

As run, 2026-10-03

  • Steps 1–3: tofu 1.13.1 and sops 3.13.3 installed, the three phoenix.env lines added, Pool.Allocate granted on /pool/proof, and the passphrase escrowed (Gerrrt/HomeLab#826). On prometheus, the hash of what the estate key decrypts equals the one taken on phoenix.
  • Step 4, the apply: 998 tofu-proof was cloned in full from 901 into the proof pool, with the expected shape.
  • Half one: check-tofu-state-encryption.sh passed on the real state: it is the encrypted wrapper with no gitleaks match, and the proof guest's cloud-init password is absent. A grep for the passphrase returned 0.
  • Half two: git add was refused by .gitignore. With -f, check-tracked-artefacts.sh named tofu/state/lab.tfstate and exited 1.
  • Teardown: 3 destroyed. From Saruman, I confirmed there is no 998, no pool, no vm-998 disk, and no /pool/proof ACL.

Changes

  • provision-lab-guests.md step 4: the first apply wrote the state file as mode 664, because tofu creates it under the shell's umask. It was ciphertext, but ADR-0076 counts file permissions as part of the control. I fixed the permissions on phoenix, and step 4 now sets umask 077 and a 700 tofu/state/ before any tofu command.
  • provision-lab-guests.md step 6: the as-run table is filled in.
  • docs/roadmap.md: Provision lab VMs with OpenTofu, and encrypt the state before the first apply #445 is marked done in the automation chain.
  • docs/changelog.md: a 2026-10-03 entry.

🤖 Generated with Claude Code

…ask 077 (#445)

998 cloned from 901 into the proof pool; the real state is the encrypted
wrapper and holds neither the proof password nor the passphrase; git add is
refused and -f is caught; teardown removed the guest, pool, disk and grant.
The state was written 664 under the shell's umask, so §4 now sets umask 077
and a 700 state directory first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 3, 2026 05:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The roadmap retains a stale #440 status that conflicts with the newly completed dependent work.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Records successful OpenTofu provisioning and encryption proofs while tightening state-file permissions.

Changes:

  • Sets restrictive state-directory permissions and umask 077.
  • Records the successful apply, proofs, and teardown.
  • Updates roadmap and changelog status.
File Description
docs/​runbooks/​provision-lab-guests.md Secures and records the first apply workflow.
docs/​roadmap.md Marks #445 complete.
docs/​changelog.md Adds the 2026-10-03 completion record.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/roadmap.md Resolved
@Gerrrt
Gerrrt enabled auto-merge (squash) October 3, 2026 05:23
@Gerrrt
Gerrrt merged commit f9c3c05 into main Oct 3, 2026
7 checks passed
@Gerrrt
Gerrrt deleted the gerrrt/tofu-proof-as-run branch October 3, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants