Refactor: replace enclave framework with Nix runtime toolchain - #149
Refactor: replace enclave framework with Nix runtime toolchain#149chris-ricketts wants to merge 31 commits into
Conversation
…r downstream users
|
This PR has been open for 4 days without a review. @chris-ricketts is anyone looking at this? |
arkana-ai-bot
left a comment
There was a problem hiding this comment.
Review — Refactor: replace enclave framework with Nix runtime toolchain
This PR refactors the entire enclave repository from a full application framework into a reusable Nix toolchain + Go runtime for AWS Nitro Enclaves. The scope is very large (removes ~5,600 lines, rewrites deployment model, renames Go module).
Key concerns to verify on human review
-
Go module rename ( → ) — any downstream consumers importing the old module path will silently stop getting updates. Verify all consumers are updated or have been notified.
-
K/V store removal — The PR removes the Redis-compatible K/V store. The justification ("no confirmed consumer") should be verified: check whether any deployed enclave applications currently rely on it before merge.
-
PCR pinning correctness — The NixOS e2e test exercises PCR0-specific AMI builds and blue/green migration. Verify the PCR0 measurement is deterministic in CI and matches what a production build would produce.
-
ACME/TLS changes — Default-SNI handling and encrypted cache key layout changed. Verify certificate issuance and renewal still work against production Let's Encrypt.
-
Attestation verification — The retained Go client does attestation-verified requests. Verify it still checks PCRs 0/1/2 correctly and that the nonce freshness mechanism is unchanged.
-
Static secret migration — Existing enclaves hold secrets in the old layout. The migration runbook in the PR description needs careful review — secret loss during migration would be catastrophic.
This PR is open since 2026-07-31 with no review. Given the scope, it urgently needs a dedicated security review.
arkana-ai-bot
left a comment
There was a problem hiding this comment.
Review — Refactor: replace enclave framework with Nix runtime toolchain
This is a large, security-critical architectural change. Human review is mandatory before merge.
This PR refactors the entire enclave repository from a full application framework into a reusable Nix toolchain + Go runtime for AWS Nitro Enclaves. The scope is very large (~5,600 lines removed, deployment model rewritten, Go module renamed).
Key concerns to verify on human review
-
Go module rename — Any downstream consumers importing the old module path will silently stop getting updates. Verify all consumers are updated or notified.
-
K/V store removal — The PR removes the Redis-compatible K/V store. Verify no deployed enclave application currently relies on it before merge.
-
PCR pinning correctness — The NixOS e2e test exercises PCR0-specific AMI builds and blue/green migration. Verify the PCR0 measurement is deterministic in CI and matches production builds.
-
ACME/TLS changes — Default-SNI handling and encrypted cache key layout changed. Verify certificate issuance and renewal still work against production Let's Encrypt.
-
Attestation verification — Verify the retained Go client still checks PCRs 0/1/2 correctly and that the nonce freshness mechanism is unchanged.
-
Static secret migration — Existing enclaves hold secrets in the old layout. The migration runbook needs careful review — secret loss during migration would be catastrophic.
This PR is open since 2026-07-31 with no review. Given the scope, it urgently needs a dedicated security review.
|
This PR has been open for 6+ days without review. @chris-ricketts this is a large architectural change to security infrastructure — is anyone looking at this? |
|
This PR has been open for 11 days without a review decision. @chris-ricketts is anyone looking at this? |
|
This PR has been open for 14+ days without review. @chris-ricketts is anyone looking at this? |
1 similar comment
|
This PR has been open for 14+ days without review. @chris-ricketts is anyone looking at this? |
Summary
Refocus this repository from a full application framework into a reusable Nix toolchain and Go runtime for AWS Nitro Enclaves. Downstream applications now package their own executable and consume the exported flake API directly.
What changed
enclave curlcommand.github.com/ArkLabsHQ/introspector-enclavetogithub.com/ArkLabsHQ/enclave.Why remove the K/V store?
This removes roughly 5,600 lines, including tests, implementing the Redis-compatible K/V store, RESP server, and rollback anchoring.
We do not yet know whether downstream Arkade applications need this functionality. Keeping it in the core runtime would require every change to be maintained, reviewed, and security-audited despite having no confirmed consumer.
If downstream demand emerges, the storage engine can be extracted into a separate library. The runtime would export a DEK to the application, and the library would consume it alongside standard AWS configuration and storage resource names. Preserving rollback protection would additionally require an Object-Locked S3 anchor bucket.
End-to-end coverage
The NixOS test exercises:
Breaking changes
enclave curl.github.com/ArkLabsHQ/enclave.extraPackages.Validation
CI now runs:
nix develop --command make testnix develop --command make lintnix build .#checks.x86_64-linux.e2e --print-build-logsThe full e2e check requires
x86_64oraarch64Linux, nested KVM, and thenixos-testsystem feature.Note:
aarch64target has not been tested.Minimal downstream consumer
flake.nixA downstream application only needs to package its executable and pass it to
buildEif:buildEifis the smallest integration point. Downstream flakes can also uselib.mkEnclaveAmito build a Nitro-capable NixOS AMI andlib.mkEnclaveTofuto generate the blue/green AWS deployment definitions.lib.mkEnclaveQemuAmiprovides the equivalent QEMU host for NixOS tests.