Skip to content

feat(nautilus-local): mock NSM device + Sui localnet E2E#31

Open
chargarlic wants to merge 3 commits intomainfrom
feat/nautilus-local-mock-nsm
Open

feat(nautilus-local): mock NSM device + Sui localnet E2E#31
chargarlic wants to merge 3 commits intomainfrom
feat/nautilus-local-mock-nsm

Conversation

@chargarlic
Copy link
Copy Markdown
Collaborator

Summary

Adds a complete local development environment for Nautilus enclaves — no AWS Nitro required.

  • mock-nsm: CUSE daemon that creates /dev/nsm inside QEMU, handles the NSM ioctl protocol, and generates COSE_Sign1 attestation documents with a proper X.509 certificate chain (fixed mock root CA → ephemeral leaf cert)
  • nautilus-local enhancements: QEMU manager, overlay initrd builder with kernel modules (fuse, cuse, e1000), secrets injection
  • Sui localnet integration: Mock attestations pass on-chain load_nitro_attestation verification on a patched localnet. Includes scripts/patch-sui-localnet.sh and scripts/test-localnet-e2e.sh for automated testing

All endpoints working: /health_check, /get_attestation, /process_data.

Verified E2E flow

  1. Patch Sui localnet with mock root CA (scripts/patch-sui-localnet.sh ~/sui)
  2. Build patched Sui, start localnet with faucet
  3. Boot enclave via nautilus-local run out/nitro.eif --secrets '...' --memory 1G
  4. Publish Move packages (test-publish --with-unpublished-dependencies)
  5. Register enclave on-chain via load_nitro_attestation + register_enclave PTB
  6. Enclave object created as shared object on localnet

Automated via: ./scripts/test-localnet-e2e.sh

Test plan

  • cd tools/mock-nsm && cargo test — 4 tests (cert generation, determinism, size limits)
  • cd tools/nautilus-local && cargo test — 4 tests (overlay, EIF parsing)
  • nautilus-local run out/nitro.eif --secrets '...' --memory 1G then curl localhost:3000/health_check and curl localhost:3000/get_attestation
  • ./scripts/test-localnet-e2e.sh --sui-dir ~/sui — full on-chain E2E

chargarlic and others added 3 commits March 10, 2026 08:08
Create the nautilus-local tool with:
- Clap CLI with parse, run, and attest subcommands
- EIF binary format parser that extracts kernel, cmdline, ramdisk,
  metadata, and signature sections
- Parse subcommand that displays EIF metadata and section info
- Unit tests verifying parsing against real EIF files

The parser correctly handles the EIF header format (0x224 bytes)
with section offsets/sizes arrays and sequential section entries.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…alnet E2E workflow

Adds a complete local development environment for Nautilus enclaves:

- **mock-nsm**: CUSE daemon that creates /dev/nsm, handles NSM ioctl protocol,
  and generates COSE_Sign1 attestation documents with a proper X.509 cert chain
  (fixed root CA → ephemeral leaf cert, PCRs, Ed25519 public key)

- **nautilus-local**: QEMU manager that boots EIF files locally with Alpine
  linux-virt kernel, e1000 NIC, overlay initrd with mock-nsm + kernel modules

- **Sui localnet integration**: Mock attestations pass on-chain verification
  (`load_nitro_attestation`) on a patched Sui localnet. Includes:
  - `scripts/patch-sui-localnet.sh` to swap AWS root CA with mock CA
  - `scripts/test-localnet-e2e.sh` for automated full-flow testing

All endpoints working: /health_check, /get_attestation, /process_data.
Verified E2E: patch Sui → start localnet → boot enclave → register on-chain.
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