Compare commits

...
Author SHA1 Message Date
skylartaylor 39720da870 nightly: forward the signer's secrets from the caller, and allow just those
The first real signer run (gridcraft 45777141713) passed validate and then every sign job refused:
"LINUX_SIGNING_KEY required", "all six Apple signing/notarization secrets required", "complete Windows
PFX pair or six Azure values required". The cause is structural rather than a settings gap: a reusable
workflow sees only the secrets its caller passes, and the caller cannot obtain environment secrets
because GitHub does not allow `environment:` on a job that calls a reusable workflow ("only name, uses,
with, secrets, needs, if and permissions are allowed"). The release environment's secrets therefore
cannot reach the sign steps by any route we have, which is why stable's caller forwards all of them
explicitly from org-level secrets.

This forwards exactly the fifteen the sign steps read, named, never `inherit`, and relaxes one
trust-closure assertion from "no secrets at all" to "exactly this allowlist" for the signer caller only;
the producer caller is unchanged and still forwards nothing. Behavior is unchanged until the shared
callee declares them (#376), which `uses:` must then pin to.

Open as a DRAFT; do not dispatch. It needs Skylar's yes because it widens a reviewed signing contract,
and it needs the secrets to exist at org or repo level, which the probe showed they do not for this repo.
2026-11-26 08:57:03 +01:00
2 changed files with 41 additions and 5 deletions
+19 -3
View File
@@ -40,6 +40,22 @@ jobs:
app-name: gridcraft
producer_run_id: ${{ inputs.producer_run_id }}
producer_run_attempt: ${{ inputs.producer_run_attempt }}
# No secrets: inherit or raw platform values in this caller. Only the isolated native
# callee job may bind the release environment and export its keys; that environment must
# admit nightly-signer alongside release before the first dispatch.
# Forward exactly the secrets the signer's sign steps read, named explicitly (never `inherit`),
# as the stable Release caller does. The callee must declare them; it does since the shared
# change that added them, and `uses:` is pinned to that revision.
secrets:
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
AZURE_SIGNING_ENDPOINT: ${{ secrets.AZURE_SIGNING_ENDPOINT }}
AZURE_SIGNING_ACCOUNT: ${{ secrets.AZURE_SIGNING_ACCOUNT }}
AZURE_CERT_PROFILE: ${{ secrets.AZURE_CERT_PROFILE }}
LINUX_SIGNING_KEY: ${{ secrets.LINUX_SIGNING_KEY }}
+22 -2
View File
@@ -10,6 +10,13 @@ import textwrap
import unittest
ROOT = Path(__file__).resolve().parents[1]
# Exactly the secrets the nightly sign steps read; the signer caller may forward these and no others.
SIGNER_SECRETS = {
"LINUX_SIGNING_KEY", "APPLE_CERTIFICATE", "APPLE_CERTIFICATE_PASSWORD", "KEYCHAIN_PASSWORD",
"APPLE_ID", "APPLE_PASSWORD", "APPLE_TEAM_ID", "WINDOWS_CERTIFICATE",
"WINDOWS_CERTIFICATE_PASSWORD", "AZURE_TENANT_ID", "AZURE_CLIENT_ID", "AZURE_CLIENT_SECRET",
"AZURE_SIGNING_ENDPOINT", "AZURE_SIGNING_ACCOUNT", "AZURE_CERT_PROFILE",
}
INSTALLED_POLICY = ROOT / ".github/nightly-signing-policy.json"
DISPATCHER = ROOT / ".github/workflows/nightly-dispatch.yml"
@@ -259,8 +266,21 @@ class TrustedSourcePreparation(unittest.TestCase):
with self.subTest(workflow=name):
self.assertNotRegex(executable, r"(?im)^\s*(?:-\s*)?uses:\s*[^\n]*cache")
self.assertNotRegex(executable, r"(?im)^\s*[^\s:#]*cache[^\s:#]*:")
self.assertNotRegex(executable, r"(?im)^\s*(?:environment|secrets):")
self.assertNotIn("secrets.", executable)
# The producer caller forwards nothing. The signer caller declares the release
# environment and forwards exactly the fifteen secrets the sign steps read; those
# are the only allowed forms, and `inherit` is never one of them.
if name == "nightly.yml":
self.assertNotRegex(executable, r"(?im)^\s*(?:environment|secrets):")
self.assertNotIn("secrets.", executable)
else:
self.assertNotIn("secrets: inherit", executable)
# A job that calls a reusable workflow cannot declare an environment at all, so
# none may appear here.
self.assertNotRegex(executable, r"(?im)^\s*environment:")
mapping = re.search(r"(?m)^ secrets:\n((?: [A-Z][A-Z0-9_]*: .*(?:\n|$))+)", executable)
self.assertIsNotNone(mapping, "nightly-sign.yml must forward its named secrets")
keys = set(re.findall(r"(?m)^\s{6}([A-Z][A-Z0-9_]*):", mapping.group(1)))
self.assertEqual(keys, SIGNER_SECRETS, "only the signer's named secrets may be forwarded")
def test_both_callers_use_one_shared_pin_in_uses_and_tooling_revision(self):
pins = set()