Repository navigation
Make the desktop signing secrets gateable, and decode the cert safely - #9657
Merged
Merged
Conversation
Two changes to release-desktop.yml, neither of which alters how a release runs today. All thirteen signing secrets, the Apple certificate and its notarization credentials, the Azure Trusted Signing set and the Tauri updater private key, are read by the build job and by no other job in the workflow. The job named no environment, so there was nowhere to attach a required reviewer and anyone able to dispatch the workflow could sign a release under our identity. build now names a release-signing environment. GitHub creates a referenced environment on first run with no protection rules and no branch policy, and repository secrets still resolve inside a job that names an environment, since environment secrets only take precedence over a colliding name and this environment holds none. The line is therefore inert until required reviewers are added in repo settings, which is the follow-up this enables. The Apple certificate was decoded with an unquoted echo, so the value was word split and glob expanded before base64 saw it. That works for a single line secret and silently produces a truncated certificate.p12 for a line wrapped one. printf '%s' with quotes passes the secret through byte for byte, and is identical to the old behaviour for the single line case in use today.
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.
Two changes to
release-desktop.yml. Neither alters how a release runs today.1. The signing secrets had nowhere to hang a reviewer
All thirteen signing secrets, the Apple certificate and its notarization credentials, the Azure Trusted Signing set and the Tauri updater private key, are read by the
buildjob and by no other job in the workflow:prepare-versionbuildpublish-releasevirustotal-scanVIRUS_TOTAL_API_TOKENonlybuildnamed no environment, so there was no place to attach a required reviewer, and anyone able to dispatch this workflow could sign a release under our identity. It now names arelease-signingenvironment, which is the single line that makes all thirteen gateable.This is inert on its own. GitHub creates a referenced-but-absent environment on first run with no protection rules and no branch policy, and repository secrets keep resolving inside a job that names an environment. Environment secrets only win on a colliding name, and this environment holds none. Turning the gate on is a settings change, not a code change: add required reviewers to the
release-signingenvironment. One approval then releases all three matrix legs, since pending deployments are approved per(run, environment).2. The Apple certificate was decoded unquoted
echo $APPLE_CERTIFICATE | base64 --decodeword-splits and glob-expands the secret beforebase64sees it. Tested both shapes against a 900 byte payload:echo $VARprintf '%s' "$VAR"So the new form is byte-identical for the single-line secret in use today, and repairs the wrapped case where the old form silently wrote a truncated
certificate.p12. Strictly safer in both directions.Verification
build.environmentreads back asrelease-signing, and no other job gained one.actionlintreports nothing new. Its one complaint,queue: maxunderconcurrency, predates this branch and is deliberate per the comment above it.buildjob header and the certificate import step.