Skip to content

[patch] Recover managed keys after disk loss#37

Merged
joecorall merged 1 commit into
mainfrom
fix/managed-app-key-recovery
Jul 25, 2026
Merged

[patch] Recover managed keys after disk loss#37
joecorall merged 1 commit into
mainfrom
fix/managed-app-key-recovery

Conversation

@joecorall

@joecorall joecorall commented Jul 25, 2026

Copy link
Copy Markdown
Member

Summary

  • attest a newly formatted GCP data filesystem with a root-only, single-use marker bound to the server-assigned data-disk ID
  • reconcile orphaned user-managed keys only for module-owned identities, only before consumers start, with durable idempotency state
  • restore the central app credential only from unanimous validated distributed copies; caller-supplied identities remain non-destructive
  • consume and flush recovery authority immediately after one-shot key convergence, before the persistent timer, Vault, or application startup

Safety properties

  • IAM mutation cannot outrun a durable state snapshot
  • a snapshot-restored marker cannot authorize a different GCP disk incarnation
  • populated, ambiguously labeled, or mismatched filesystems fail closed
  • key list and response validation is bounded, exact, and redacted
  • supported snapshot restore goes through Terraform and VM replacement so boot config receives the new disk ID

Focused evidence

  • GCP Terraform validation and all 41 module tests
  • ci/filesystem-prep-contract.sh
  • ci/key-rotation-contract.sh
  • ci/bootstrap-recovery-contract.sh
  • Vault, host security, runtime config, systemd, source-trust, rootfs, config-management, application-env, Compose, and COS jq contracts
  • Go vet and tests
  • Terraform formatting, Bash syntax, and git diff --check

GitHub CI supplies the full repository lint, ShellCheck, and cloud smoke gates.

Maintainability follow-up

The clean Go boundary is one future cloud-compose-host binary owning the complete IAM/key lifecycle and durable state. This patch deliberately does not add a partial helper because current rootfs/source consumers have no verified host-binary delivery path, and two recovery state machines would be harder to audit.

@joecorall
joecorall temporarily deployed to cloud-smoke-linode July 25, 2026 03:12 — with GitHub Actions Inactive
@joecorall
joecorall temporarily deployed to cloud-smoke-linode July 25, 2026 03:12 — with GitHub Actions Inactive
@joecorall
joecorall temporarily deployed to cloud-smoke-linode July 25, 2026 03:12 — with GitHub Actions Inactive
@joecorall
joecorall had a problem deploying to cloud-smoke-digitalocean July 25, 2026 03:12 — with GitHub Actions Failure
@joecorall
joecorall temporarily deployed to cloud-smoke-gcp July 25, 2026 03:12 — with GitHub Actions Inactive
@joecorall
joecorall force-pushed the fix/managed-app-key-recovery branch from aec9ffa to 76509d3 Compare July 25, 2026 03:38
@joecorall
joecorall temporarily deployed to cloud-smoke-linode July 25, 2026 03:41 — with GitHub Actions Inactive
@joecorall
joecorall temporarily deployed to cloud-smoke-gcp July 25, 2026 03:41 — with GitHub Actions Inactive
@joecorall
joecorall temporarily deployed to cloud-smoke-linode July 25, 2026 03:41 — with GitHub Actions Inactive
@joecorall
joecorall temporarily deployed to cloud-smoke-linode July 25, 2026 03:41 — with GitHub Actions Inactive
@joecorall
joecorall had a problem deploying to cloud-smoke-digitalocean July 25, 2026 03:41 — with GitHub Actions Failure
@joecorall
joecorall merged commit 52fec3e into main Jul 25, 2026
8 of 9 checks passed
@joecorall
joecorall deleted the fix/managed-app-key-recovery branch July 25, 2026 04:05
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.

1 participant