Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign the winget packages published for Windows clients #1144

Open
Nogal opened this issue Apr 3, 2024 · 3 comments
Open

Sign the winget packages published for Windows clients #1144

Nogal opened this issue Apr 3, 2024 · 3 comments
Assignees
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Milestone

Comments

@Nogal
Copy link

Nogal commented Apr 3, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

The package installed on windows machines is unsigned, which is a security risk.

This can be achieved using "signtool" which is part of the Windows SDK:
https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool
https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/

Why is this needed?

Primarily, this lets any user be completely sure that the software they're installing actually came from you. Should a malicious actor get your publishing keys, they would also need to get a hold of your signing keys as well in order to really do damage.

We would like to restrict our client machines to only run trusted signed code. Currently to run step-cli this requires a whitelist exception in our policy for the executable, which of course changes between versions, and should a company implement an exception incorrectly (or even correctly depending on the limitations of their security software) it could result in malicious code taking advantage of the hole and infecting the network.

@Nogal Nogal added enhancement needs triage Waiting for discussion / prioritization by team labels Apr 3, 2024
@hslatman hslatman added this to the Backlog milestone Apr 9, 2024
@tashian
Copy link
Contributor

tashian commented Apr 10, 2024

Looks like we could use mtrojnar/osslsigncode to sign the exe file for Winget.

@redrac
Copy link
Contributor

redrac commented Apr 29, 2024

+1 this is a common problem at our corp that the step CLI doesn't have FW access to public network because its not signed

@tashian
Copy link
Contributor

tashian commented Jul 9, 2024

Hi! I've been looking into code signing step.exe for Windows, and wanted to share an update.

GitHub being Microsoft, they have created a Trusted Signing action to do this, using a windows-2022 runner. Compared with mtrojnar/osslsigncode, this is a more modern, officially supported approach.

It integrates with Azure Trusted Signing via an Azure service account.

This action runs on Windows. In order to adopt this into our workflow, I think we'd want to use a GoReleaser split-merge build and running the Trusted Signing action after building for Windows.

One issue is, the "split" stage of the split-merge process will build the binary, zip it up, and hash the zip file.
Because the Trusted Signing action is a GH action, I don't think we could run it as a post-build hook in GoReleaser.
To add the Trusted Signing action between the split and merge steps in GoReleaser, we would have to do some surgery on the files produced by GoReleaser—re-archiving them and updating the artifact json with new hashes.
This is a brittle approach.

Ideal would be to use a post-build hook to sign the binaries, if possible. Here's the main block of PowerShell for this, but I don't love the idea of pulling all of this setup into our GoReleaser config.

I have asked @caarlos0 about Windows code signing support in GoReleaser, and it's coming soon. It may make sense to postpone this issue until that feature is rolled out in GoReleaser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

4 participants