Skip to content

Support launching AWS Nitro Enclaves (enclave-options + nitro-cli workflow) #94

Open

Description

@scttfrdmn

What

Add first-class support for launching and running AWS Nitro Enclaves on a spawned instance. Today spawn launches/manages the parent EC2 instance beautifully, but everything enclave — enabling enclave options at launch, the allocator, building an EIF, run-enclave, capturing enclave output — is left to the user as ad-hoc instance-side scripting.

Why (real friction)

I just hand-rolled this end-to-end to validate a /dev/nsm ioctl for a Nitro attestation tool, driving a raw instance via SSM Run Command. The enclave dance has several non-obvious sharp edges spawn could encapsulate:

  1. Launch-time flag. Enclaves require --enclave-options Enabled=true at RunInstances (can't be added later), plus an enclave-capable instance type (≥4 vCPU, e.g. m5.xlarge) and adequate root volume.
  2. Allocator config. aws-nitro-enclaves-cli must be installed and /etc/nitro_enclaves/allocator.yaml edited (memory_mib, cpu_count) and the nitro-enclaves-allocator service started before any enclave runs.
  3. nitro-cli build-enclave env gotcha. Run non-interactively (SSM/CI, no $HOME), build-enclave fails with [E51] Artifacts path environment variable not set and needs NITRO_CLI_BLOBS=/usr/share/nitro_enclaves/blobs. Both NITRO_CLI_BLOBS and NITRO_CLI_ARTIFACTS must be exported — a 30-minute foot-gun that a tool should just handle.
  4. Capturing enclave output. In --debug-mode, nitro-cli console output races the enclave's exit; without a vsock server you have to keep the program alive to drain the console. A spawn enclave run --capture that handles this would save everyone.

Proposed shape (sketch, for discussion)

# Launch a parent already configured for enclaves (allocator preset, nitro-cli installed)
spawn launch my-enclave --instance-type m5.xlarge --enclave --enclave-memory 768 --enclave-cpus 2 --ttl 1h --on-complete terminate

# Build an EIF from a local Docker image / Dockerfile and run it, streaming console
spawn enclave run my-enclave --docker-uri myimg:test --debug --capture
# (handles NITRO_CLI_BLOBS/ARTIFACTS, allocator, build-enclave, run-enclave, console drain, terminate)

Even just --enclave at launch (flag + allocator/nitro-cli bootstrap) would remove most of the pain; the enclave run subcommand is the nice-to-have on top.

Notes / scope

  • This pairs naturally with spawn's TTL/auto-terminate model — enclave validation runs are inherently ephemeral (mine cost < $1 and self-terminated would've been ideal).
  • Prior art for the exact instance-side sequence (install, allocator, blobs env, build-enclave, debug-mode console capture, teardown) is available — happy to share the working SSM command sequence I used.
  • Filed from the provabl/nitro project's perspective (a Nitro attestation producer), but this is generally useful for anyone doing enclave dev/test on ephemeral instances.

Activity

  1. added
    enhancement
    area:launch
    on Jun 10, 2026
  2. added this to the Later milestone on Oct 19, 2026
  3. modified the milestones: Later, Post-1.0 on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:launchenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions