Skip to content

Conversation

martincostello
Copy link
Member

@martincostello martincostello commented Sep 2, 2025

What?

Use Azure Trusted Signing to sign the Windows artifacts instead of the existing code-signing certificate.

The k6.exe file itself is now also signed.

I suggest this is merged as-is to complete the rotation of the certificate, then I can do a follow-up PR to refactor this to use a shared re-usable action for signing once that's implemented and merged (see grafana/shared-workflows#1290).

Before

image

After

image

Why?

The existing certificate expires on Thursday 2nd October 2025.

Checklist

  • I have performed a self-review of my code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests for my changes.
  • I have run linter and tests locally (make check) and all pass.

Checklist: Documentation (only for k6 maintainers and if relevant)

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

None.

@martincostello
Copy link
Member Author

Verified artifacts from this workflow run:

  • Have a .zip that contains the signed Windows binary
  • Have a signed .msi
  • The .msi contains the signed Windows binary

@martincostello martincostello temporarily deployed to azure-trusted-signing September 2, 2025 13:59 — with GitHub Actions Inactive
@martincostello martincostello temporarily deployed to azure-trusted-signing September 2, 2025 14:01 — with GitHub Actions Inactive
@martincostello
Copy link
Member Author

Verified artifacts from this workflow run:

  • Skip all signing-related steps
  • signed-windows-binary contains an unsigned version of k6.exe
  • binaries-signed contains an unsigned version of k6.exe
  • binaries-windows-signed contains an unsigned .msi.

@martincostello martincostello temporarily deployed to azure-trusted-signing September 2, 2025 14:16 — with GitHub Actions Inactive
@martincostello martincostello temporarily deployed to azure-trusted-signing September 2, 2025 14:18 — with GitHub Actions Inactive
Use Azure Trusted Signing to sign the Windows artifacts instead of the existing code-signing certificate.
- Refactor workflow so that the Windows binary can be signed before it is added to the Windows installer.
- Avoid string interpolation in shell commands.
Fix copy-pasta.
Fix incorrect path for the signed Windows binary.
Add comments to workflow where relevant.
Resolve TODO to check that unsigned builds work.
Restore publish jobs now that testing is completed.
@martincostello martincostello temporarily deployed to azure-trusted-signing September 2, 2025 14:28 — with GitHub Actions Inactive
@martincostello martincostello temporarily deployed to azure-trusted-signing September 2, 2025 14:30 — with GitHub Actions Inactive
@martincostello martincostello changed the title [WIP] Use Azure Trusted Signing Use Azure Trusted Signing Sep 2, 2025
@martincostello martincostello marked this pull request as ready for review September 2, 2025 14:31
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 14:31
@martincostello martincostello requested a review from a team as a code owner September 2, 2025 14:31
@martincostello martincostello requested review from mstoykov, joanlopez and codebien and removed request for a team September 2, 2025 14:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates from traditional certificate-based code signing to Azure Trusted Signing for Windows artifacts in the GitHub Actions build workflow. The change adds signing for the k6.exe binary itself and replaces the existing MSI installer signing process.

  • Implements Azure Trusted Signing using Microsoft's Sign CLI tool and Azure authentication
  • Adds conditional signing logic that only signs artifacts from the default branch, version tags, or manual dispatches
  • Restructures the Windows packaging workflow to separate binary signing, installer creation, and installer signing into distinct jobs

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@martincostello martincostello temporarily deployed to azure-trusted-signing September 4, 2025 11:10 — with GitHub Actions Inactive
Fix missing artifact to use for the installer build.
@martincostello martincostello temporarily deployed to azure-trusted-signing September 4, 2025 11:19 — with GitHub Actions Inactive
@martincostello martincostello temporarily deployed to azure-trusted-signing September 4, 2025 11:22 — with GitHub Actions Inactive
Restore conditions now testing is completed.
@martincostello
Copy link
Member Author

Addressed various review comments:

  • Shared action now used for signing
  • Refactored artifact naming to flow between jobs
  • Renamed new jobs
  • More steps are skipped when signing isn't being used
  • Reduced the number of artifacts produced by unsigned builds

mstoykov
mstoykov previously approved these changes Sep 5, 2025
Copy link
Contributor

@mstoykov mstoykov left a comment

Choose a reason for hiding this comment

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

LGTM!

I have a comment around naming, that is not blocking, and would be nice if we can it run the signing again before we merge it.

Thank you for all the work 🙇

subscription-id=azure-trusted-signing:subscription-id
tenant-id=azure-trusted-signing:tenant-id
# TODO Add functionality to allow passing a directory to sign without needing an artifact first
Copy link
Contributor

Choose a reason for hiding this comment

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

So we are uploading this before so the workflow can download it?

If so can we ranem it to windows-binary-to-sign to again be something that is more obvious

Copy link
Member Author

@martincostello martincostello Sep 5, 2025

Choose a reason for hiding this comment

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

No, it's also needed for when the workflow runs when signing is disabled (e.g. in a PR) (see 69ba0db).

Although that does mean as the artifact has to exist anyway I can just delete the comment.

The artifact is needed anyway.
@martincostello
Copy link
Member Author

would be nice if we can it run the signing again before we merge it.

I think we're good as-is. To run it again with signing, as this is a PR, I would have to re-edit the PR force it on and ensure there isn't an accidental real publish, then revert those changes again before it can be merged. The edits since the last run with signing are trivial enough that I think there's enough confidence it works for both unsigned and signed builds.

@martincostello martincostello temporarily deployed to azure-trusted-signing September 5, 2025 09:16 — with GitHub Actions Inactive
@martincostello martincostello temporarily deployed to azure-trusted-signing September 5, 2025 09:18 — with GitHub Actions Inactive
mstoykov
mstoykov previously approved these changes Sep 5, 2025
@martincostello martincostello temporarily deployed to azure-trusted-signing September 8, 2025 11:14 — with GitHub Actions Inactive
@martincostello martincostello temporarily deployed to azure-trusted-signing September 8, 2025 11:16 — with GitHub Actions Inactive
@codebien codebien merged commit d699e0b into master Sep 10, 2025
56 of 67 checks passed
@codebien codebien deleted the azure-trusted-signing branch September 10, 2025 15:09
@martincostello martincostello added this to the v1.3.0 milestone Sep 11, 2025
martincostello added a commit to martincostello/k6 that referenced this pull request Sep 23, 2025
Update the `Manufacturer` value to match the new Windows signing certificate (grafana#5122).
codebien pushed a commit that referenced this pull request Sep 24, 2025
Update the `Manufacturer` value to match the new Windows signing certificate (#5122).
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.

4 participants