feat: add Terraform deployment for syft-enclave#9433
Open
koenvanderveen wants to merge 4 commits into
Open
Conversation
Declarative alternative to the gcloud Justfile flow: one terraform apply provisions APIs, service account, IAM, Secret Manager secret (incl. token version), and the SEV Confidential Space VM. A single dev_mode var flips the debug bundle (SSH image, serial container logs, restart Always, encryption off). New just tf-* recipes wrap it; setup guide in docs/terraform.md linked from the README. Also hardens both deploy paths to guarantee no inbound port on the enclave (drop http-server tags and firewall remnants; attest now goes via SSH + localhost).
Findings from a real e2e test (4-actor enclave flow ran successfully against a tf-deployed enclave): a fresh apply boots the VM before the SA's confidentialcomputing.workloadUser grant propagates, so the Confidential Space launcher 403s and exits leaving a dead VM — add a 120s time_sleep between IAM grants and the instance. tf-logs now prefers SSH + journalctl (serial console caps redirected container logs) with serial fallback for production. tf-redeploy accepts passthrough args like -auto-approve.
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.
Summary
packages/syft-enclave/terraform/) that provisions the full enclave stack in one apply: GCP APIs, service account + IAM, Secret Manager secret (incl. the token version), and the AMD SEV Confidential Space VMdev_modevariable flips the debug bundle (confidential-space-debug image with SSH, container logs to serial, restartAlways, encryption off by default) — mirroringstartvsstart-debug; tee-metadata changes force VM replacement since Confidential Space reads metadata only at bootjust tf-*recipes (tf-init/plan/apply/apply-dev/destroy/redeploy/output/attest/logs/status/ssh) driven by a gitignoredterraform.tfvars; existing gcloud recipes unchangeddocs/terraform.md(ADC auth, quickstarts, dev iteration flow, day-2 ops, gcloud↔terraform mapping), linked from the package READMEhttp-servernetwork tags and firewall-rule remnants;just attestnow fetches via SSH + localhost (attestation is published through the peer flow inSYFT_version.json)Fixes from live e2e testing
The flow was verified end-to-end on GCP: a tf-deployed dev-mode enclave ran the full 4-actor flow (enclave + 2 DOs + DS,
notebooks/enclave-style steps) — a job referencing both private datasets executed only after both DOs approved, with results delivered to the DS and both DOs. Issues found and fixed along the way:confidentialcomputing.workloadUsergrant propagated → the Confidential Space launcher 403s and exits (exit_code=4), leaving a dead VM. Fixed withtime_sleep.iam_propagation(120s) between IAM grants and the instance; recovery documented (gcloud compute instances reset)tf-logs: the serial console caps redirected container output (chatty containers go quiet) — now prefers SSH +journalctlwith serial fallback for productiontf-redeploy: accepts passthrough args (e.g.-auto-approve)Misc
.jupyter/,.jupyter_ystore.db)jupyter-collaboration+jupyter-mcp-toolsto dev deps (Jupyter MCP server for agent-driven notebook testing)Test plan
terraform validate+terraform fmt -checkclean;just --listparses; tfvars preflight errors helpfully.terraform//tfvars gitignored;.terraform.lock.hclcommittedtf-apply-dev→ attest (GCP_AMD_SEV, secure boot) → 4-actor job flow →tf-destroy(12 resources, APIs left enabled); verified no network tags and external :8080 unreachable🤖 Generated with Claude Code