Repository navigation
Restore server-side GitHub App signing - #17801
missymessa merged 7 commits into
Conversation
Co-authored-by: Copilot <[email protected]> Copilot-Session: e6793769-8620-4b12-9a94-206a0db5e467
There was a problem hiding this comment.
🔵 Needs a closer look
The protected canary has not run, leaving Azure CLI signing, GitHub App/key correspondence, promotion-key provisioning, and Sign permissions for each actual WIF identity awaiting human validation that mocks cannot provide.
No open issues 🎉
What changed in this PR
Restores server-side GitHub App signing in Arcade’s shared authentication tooling for OneLoc and promotion validation. Agents submit JWT digests to Key Vault, keeping private keys off agents and preserving short-lived installation tokens without a PAT fallback.
Changes:
- Restores the
KeyName/AppClientIdcontract across the helper, shared templates, and promotion caller. - Adds nine mocked Pester regression cases covering signing, installation lookup, failure handling, and token masking.
- Updates migration and key-rotation documentation and corrects the signing-key retention comment.
Protected internal canary validation remains pending.
| File | Description |
|---|---|
eng/validation/Get-GitHubAppToken.Tests.ps1 |
Adds regression coverage for digest-only signing and token handling. |
eng/validate-promotion.yml |
Configures promotion authentication with an App issuer and RSA key name. |
eng/common/Get-GitHubAppToken.ps1 |
Replaces local PEM signing with Key Vault signing and rejects empty tokens. |
eng/common/core-templates/steps/get-github-app-token.yml |
Exposes and forwards the restored signing parameters. |
eng/common/core-templates/job/onelocbuild.yml |
Restores OneLoc’s App client ID and signing-key defaults. |
Documentation/OneLocBuildGitHubApp.md |
Documents remote signing, migration, permissions, rotation, and canary requirements. |
Documentation/OneLocBuild.md |
Updates OneLoc authentication parameters and migration guidance. |
.vault-config/product-builds-engkeyvault.yaml |
Corrects the retention and rotation comment; key declarations remain unchanged. |
Review effort: Balanced
Co-authored-by: Copilot <[email protected]> Copilot-Session: e6793769-8620-4b12-9a94-206a0db5e467
| $escapedSecretName = [Uri]::EscapeDataString($AppIdSecretName) | ||
| try { | ||
| # Read only the ID value: CLI secret deserialization fails on year-9999 expiry metadata. | ||
| $appIdResponse = Invoke-RestMethod ` |
There was a problem hiding this comment.
az keyvault instead of REST api?
There was a problem hiding this comment.
If you do this, then you dont' even need the original account token generation.
There was a problem hiding this comment.
Removed az account get-access-token. az rest obtains the Key Vault token through Azure CLI using --resource https://vault.azure.net.
There was a problem hiding this comment.
I tested az keyvault secret show against the configured App-ID projection; it fails with [Errno 22] Invalid argument. I switched to az rest with --resource https://vault.azure.net. This keeps authentication in Azure CLI and successfully reads the value without logging it; the direct secret-show command is not viable for this projection in the tested environment.
There was a problem hiding this comment.
Removed the temporary Get-GitHubAppToken.Tests.ps1 file as requested.
There was a problem hiding this comment.
🔵 Needs a closer look
Protected end-to-end canaries have not exercised the remote-signing path, leaving WIF permissions, actual CLI signing, GitHub key registration and installation access, and promotion-key provisioning dependent on human validation.
No open issues 🎉
Review effort: Balanced
Use Azure CLI REST to read the App ID projection without explicit token handling. Remove the temporary validation tests per review feedback. Co-authored-by: Copilot <[email protected]> Copilot-Session: 08592ccd-79d8-4bfe-86df-effc4ae76483
There was a problem hiding this comment.
🔵 Needs a closer look
Protected canaries have not run, and human validation is still needed for WIF App-ID read/Sign permissions, GitHub key registration and installation access, and promotion signing-key provisioning.
No open issues 🎉
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
Protected canaries have not exercised the corrected authentication path, leaving WIF read/sign permissions, promotion-key provisioning, and GitHub App registration and installation access requiring human validation before merge.
No open issues 🎉
Review effort: Balanced
Intent
Correct the GitHub App migration without moving private keys onto build agents. Keep WIF and short-lived installation tokens, read the configured App-ID secret projection for the JWT issuer, and sign only the SHA-256 digest through Azure Key Vault's RSA Sign operation.
The identifier contract is
appIdSecretName/AppIdSecretName(GitHubAppIdSecretNamefor OneLoc), not a hardcoded App/Client ID in YAML. Only the App-ID projection is read.keyNameselects the RSA signing resource; the private-key secret is never retrieved and there is no PEM/local-signing or PAT fallback.Scope and decisions
Updates the authoritative helper, token step, OneLoc job defaults and authentication docs. Promotion callers on main/release11 use their configured projection too. Retains the release/8 localization no-op. Generated downstream copies must receive this through normal Arcade dependency flow.
App-ID retrieval uses authenticated Key Vault REST and reads the response value directly. This avoids Azure CLI's Windows deserialization failure on the existing year-9999 secret expiry metadata; that workaround does not require exporting a private key.
The WIF identity requires read access to the configured App-ID projection and Sign on the selected RSA key, not read access to private-key secrets. This PR does not change live credentials, keys, RBAC, production pipeline definitions or deployments. For the protected canary, the Promotion WIF identity was granted
Key Vault Crypto Useron its validation key; temporary canary pipeline and resource authorizations were restored afterward.Validation
4c765904c0d948c1a56963f709043870aeb58887. OneLoc and Promotion used WIF, read their App-ID projections, signed via Key Vault, and verified read-only repository access; both installation tokens were revoked. This does not validate a full publishing workflow.git diff --check. Template expressions are substituted only in validation artifacts; this is not Azure DevOps template compilation.Gates before merging
Obtain the required review and keep required CI and policy checks green.
Downstream prerequisites
Tracking: https://dev.azure.com/dnceng/internal/_workitems/edit/12467
Authoritative Arcade correction: #17801