Skip to content

Conversation

maennchen
Copy link
Member

This PR replaces the former client-id / client-secret authentication flow with Azure AD Workload Identity Federation in the release.yml workflow.

Why

  • Eliminates long-lived secrets – a short-lived GitHub OIDC token is exchanged for an Azure access token, so there is nothing to rotate or leak.
  • Better security posture – credentials are minted just-in-time and expire automatically.
  • Simpler maintenance – we drop AZURE_CLIENT_SECRET entirely.

What changed

  • Added the id-token: write permission to the build job so GitHub can issue an OIDC token.
  • Introduced an environment: release-scoped sign job. Secrets and variables live in that environment.
  • Replaced azure-client-secret with WIF parameters in both the azure/login and azure/trusted-signing-action steps.
  • Parameterised certificate and account names through environment variables, making them configurable per environment.

Setup instructions

  1. Create the environment

    • Settings › Environments › New environment

    • Name it release

    • Add protection rules for:

      • Branch: main
      • Tags: v*
  2. Add environment secrets (values will be shared privately)

    • AZURE_CLIENT_ID
    • AZURE_SUBSCRIPTION_ID
    • AZURE_TENANT_ID
  3. Add environment variables

    • AZURE_CERTIFICATE_PROFILE_NAMEElixir
    • AZURE_TRUSTED_SIGNING_ACCOUNT_NAMEtrusted-signing-elixir

After those steps, the workflow will authenticate to Azure through Workload Identity Federation with no further secret management required.

References

subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: "Sign files with Trusted Signing"
uses: azure/trusted-signing-action@0d74250c661747df006298d0fb49944c10f16e03 # v0.5.1
if: github.repository == 'elixir-lang/elixir' && matrix.flavor == 'windows'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the github.repository == 'elixir-lang/elixir' on purpose so that it's simpler to execute this in a fork for testing purposes. As soon as you set the AZURE_TRUSTED_SIGNING_ACCOUNT_NAME variable, this job will attempt to run.

@maennchen
Copy link
Member Author

One thing to consider: We should either backport this change into all maintained branches or keep the old service account login around for a while.

@josevalim josevalim merged commit 1753c81 into elixir-lang:main Jun 25, 2025
13 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

maennchen added a commit to maennchen/elixir that referenced this pull request Sep 3, 2025
Backported PRs: * elixir-lang#14604 * elixir-lang#14627 The commits are based on the SBoM PR (elixir-lang#14241) which changed the actions.
josevalim pushed a commit that referenced this pull request Sep 5, 2025
Backported PRs: * #14604 * #14627 The commits are based on the SBoM PR (#14241) which changed the actions.
ggVGc pushed a commit to ggVGc/elixir-literal that referenced this pull request Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants