Repository navigation
fix(enclave): report the release version in build info - #30
Merged
Merged
Conversation
The enclave build linked only its profile values, so buildinfo kept its defaults: nexus_gateway_build_info reported version="dev" with an empty commit, and enclave logs said "dev", while the regular gateway reports its release tag. - Dockerfile.enclave takes VERSION, validates it like the other linker inputs, and links it into buildinfo.Version, with SOURCE_REVISION as buildinfo.Commit. - build-release-assets.sh passes the release VERSION. - verify-build.sh reads release.version from the signed manifest, requires it, and passes the same value, so a release still reproduces. Older revisions do not declare VERSION, so BuildKit ignores it for them. - CI passes a placeholder version, since VERSION is now required. The version is now part of the measured binary, so it reaches the PCRs: the same revision released under two tags measures differently. Every release already gets new measurements, so the KMS allowlist and cutover steps do not change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Marketen
marked this pull request as ready for review
November 25, 2026 15:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After the v0.1.74 cutover, Grafana shows the enclave as
nexus_gateway_build_info{version="dev", commit=""}, and enclave logs say"version":"dev". The regular gateway reports its release tag. The cause is thatDockerfile.enclavesets only the enclave profile values (revision, region and KMS key) at link time, sopkg/buildinfokeeps its defaults.Change
apps/gateway/Dockerfile.enclave:VERSIONbuild argument and validates it with the same pattern the release workflow uses (vX.Y.Z[-suffix]), like the other linker inputs;buildinfo.Version, and linksSOURCE_REVISIONintobuildinfo.Commit.deploy/nitro/build-release-assets.sh: passes the releaseVERSION.deploy/nitro/verify-build.sh:release.versionfrom the signed manifest and refuses a manifest that lacks it;VERSION(and reuses it fornitro-cli --version, which read it separately before).ci.yml: passesVERSION=v0.0.0-ci, because the argument is now required.Effect on measurements
The version is now compiled into the measured binary, so it affects the PCRs: the same revision released under two different tags measures differently. Each release already gets new measurements, so nothing changes for the KMS allowlist or the cutover.
verify-build.shtakes the version from the signed manifest, so third-party rebuilds still reproduce.Older releases (v0.1.74 and earlier) are unaffected. Their
Dockerfile.enclavedoesn't declareVERSION, and BuildKit only warns about an unused build argument.This takes effect at the next enclave release. Nothing needs to run in infrastructure.
Testing
GOOS=linux GOARCH=amd64,-tags nitro_enclave) using the ldflags taken from thisDockerfile.enclave.buildinfo.Versionandbuildinfo.Commitare embedded, andnexus_gateway_build_infois fed by exactly those (metrics/prometheus.go:289).v0.1.75,v0.0.0-ciandv1.2.3-rc.1. It rejectsdev, an empty value,0.1.75, and a value that would inject an extra-X.verify-build.sh's manifest parsing against synthetic manifests. With a version, all 11 fields parse and line up. Without one, it reportsmanifest is missing release.version.bash -npasses on both scripts.buildxbuild andverify-build.shagainst a real release. I only have an arm64 machine, and the script requires x86_64. CI's enclave build and the release workflow's double-build determinism check cover the first. For the second, it's worth runningverify-build.shon the v0.1.74 manifest on an x86_64 host to confirm the unused-argument case.🤖 Generated with Claude Code