Skip to content

Make the desktop signing secrets gateable, and decode the cert safely - #9657

Merged
danielhanchen merged 1 commit into
mainfrom
harden-release-desktop
Aug 25, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
harden-release-desktop

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

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 build job and by no other job in the workflow:

job signing secrets
prepare-version none
build all 13
publish-release none
virustotal-scan VIRUS_TOTAL_API_TOKEN only

build named 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 a release-signing environment, 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-signing environment. 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 --decode word-splits and glob-expands the secret before base64 sees it. Tested both shapes against a 900 byte payload:

secret shape echo $VAR printf '%s' "$VAR"
single line rc=0, 900 bytes, matches rc=0, 900 bytes, matches
line wrapped rc=1, 57 bytes, corrupt rc=0, 900 bytes, matches

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

  • YAML parses, build.environment reads back as release-signing, and no other job gained one.
  • actionlint reports nothing new. Its one complaint, queue: max under concurrency, predates this branch and is deliberate per the comment above it.
  • Diff is 21 insertions, 1 deletion, confined to the build job header and the certificate import step.

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.
@danielhanchen
danielhanchen merged commit ff7c017 into main Aug 25, 2026
20 checks passed
@danielhanchen
danielhanchen deleted the harden-release-desktop branch August 25, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant