fix: keep enclave signing key out of image builds - #703
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the SGX/TEE build pipeline by removing the enclave signing private key from the repository and image build context, and switching signing steps to use BuildKit secrets so the key is never written into Docker image layers.
Changes:
- Updated
Dockerfileto sign SGX/SGXGETH artifacts usingRUN --mount=type=secretand an optional public-key hash check, instead of copying a private key into the build context/layers. - Updated
script/publish-image.shto support supplying the signing key viaENCLAVE_KEY_PATHor GCP Secret Manager and pass it todocker buildxas a BuildKit secret. - Removed the committed
docker/enclave-key.pem, adjusted.dockerignore/.gitignore, and addeddocker/Dockerfile.base-cleanto create a scrubbed runtime base image.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
script/publish-image.sh |
Adds BuildKit secret wiring and optional GCP Secret Manager retrieval for enclave signing key during image builds. |
Dockerfile |
Switches enclave signing to BuildKit secrets and parameterizes the SGX runtime base image to a scrubbed base-clean. |
docker/enclave-key.pem |
Removes the committed private signing key from the repository. |
docker/Dockerfile.base-clean |
Adds a “scrubbed” base image recipe to remove the historical key from the runtime base filesystem. |
.gitignore |
Ensures any local docker/enclave-key.pem is not accidentally committed. |
.dockerignore |
Removes the exception that previously forced docker/enclave-key.pem into the Docker build context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 122bbbb7ec
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
122bbbb to
bac6fad
Compare
Summary
This supersedes #695 with only the enclave-key build hardening changes. It intentionally does not include the stale gaiko pointer, chainspec, Cargo.lock, or unrelated branch changes from #695.
Verification