Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

fix: keep enclave signing key out of image builds - #694

Merged
smtmfft merged 10 commits into
hotfix/hotfix-based-on-1.16.1from
fix/enclave-key-secret-build
Jun 25, 2026
Merged

fix: keep enclave signing key out of image builds#694
smtmfft merged 10 commits into
hotfix/hotfix-based-on-1.16.1from
fix/enclave-key-secret-build

Conversation

@smtmfft

@smtmfft smtmfft commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Remove the tracked enclave signing key from the repository and Docker build context.
  • Pass the local signing key through BuildKit secrets for both EGo and Gramine signing.
  • Update SGX and SGXGETH MRENCLAVE values from the freshly built image.

Image

  • Pushed us-docker.pkg.dev/evmchain/images/raiko:latest
  • Digest: sha256:9fccfbd3fac4a0305a4f1aea7117c01bfc9cd0c08a7efb82b779eb4b1090c717

Verification

  • bash -n script/publish-image.sh
  • git diff --check origin/hotfix/hotfix-based-on-1.16.1...HEAD -- Dockerfile script/publish-image.sh .dockerignore .gitignore .env
  • Fresh no-cache TEE build produced:
    • SGX_MRENCLAVE=72258d3cae0e9901d0efc1f630064f1c44f11950bd25fee0b62ec8df84532da2
    • SGXGETH_MRENCLAVE=398be8424f27802b38e6e8d3413bf6a0b187349e68522a218f5bfc00279006ac
    • mr_signer=e08aef23d4357d47e5ac5f278ba5492a5f5fb145c4fc026995367210f21a333c

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7059c7026e

ℹ️ 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".

Comment thread Dockerfile Outdated
Comment on lines +16 to +20
RUN --mount=type=secret,id=enclave_key,target=/run/secrets/enclave-key.pem \
set -e; \
test -n "${ENCLAVE_KEY_PUBLIC_SHA256}"; \
test -s /run/secrets/enclave-key.pem; \
test "$(openssl rsa -in /run/secrets/enclave-key.pem -pubout 2>/dev/null | openssl sha256 | awk '{print $2}')" = "${ENCLAVE_KEY_PUBLIC_SHA256}"; \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the BuildKit secret through compose builds

This makes Dockerfile require both ENCLAVE_KEY_PUBLIC_SHA256 and the enclave_key BuildKit secret, but the existing docker/docker-compose*.yml build blocks for Dockerfile only set context/dockerfile (and sometimes ENABLE_SELF_REGISTER) and never provide that arg or secret. Any documented local flow such as docker compose build raiko will now fail at this first signing step (and the same requirement is repeated in the runtime stage), even when the user has docker/enclave-key.pem locally, because compose is not passing it as a build secret.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 5da6773: compose/CI builds no longer require a BuildKit secret because the Dockerfile generates a throwaway RSA-3072/e=3 key only when no secret/hash is supplied. Release builds still pass ENCLAVE_KEY_PUBLIC_SHA256 and fail if the secret is missing.

@smtmfft
smtmfft merged commit e499ba1 into hotfix/hotfix-based-on-1.16.1 Jun 25, 2026
13 of 14 checks passed
@smtmfft
smtmfft deleted the fix/enclave-key-secret-build branch June 25, 2026 09:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant