Skip to content

Strict Microsoft package signature validation #1438

Description

Description of the new feature/enhancement

winget currently makes no distinction between packages provided by Microsoft and community packages, such that there is no way to install Microsoft software that is not shipped in-box like Windows Admin Center or PowerShell 7 with a guarantee that everything downloaded and executed was exclusively signed by Microsoft. The idea would be to make enforcement of signature validation tied to a specific vendor like Microsoft when installing packages: when installing WAC or PowerShell 7, one would have the same kind of guarantee of origin one would expect from Windows Update. A Microsoft package not signed by Microsoft would fail to install.

Proposed technical implementation details

The vendor signature enforcement could be controlled by command-line options, but my recommendation would be to enable it by default for official Microsoft packages, with the Microsoft key pair or certificate trusted by default. This is very similar to how Linux package repositories work (https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-1804).

As for the signature mechanism, the most important part is to sign the manifest file. Yes, the manifest contains CDN URLs and the hash of the files, but it's not of much use if the manifest is unsigned because it could be tampered with. A relatively simple way to implement this today would be to borrow the same kind of signature down with OCI artifacts and containers using cosign from the sigstore project: https://github.com/sigstore/cosign

This issue is related to #702 because it intends to meet the recurring demand for including out-of-box Microsoft software like WAC and PowerShell 7 in-box. I believe that if we provide a fully trusted way to install additional out-of-box Microsoft software without relying on community packages, this demand would be met. If winget can enforce proper trust of origin on Microsoft software, then it's not that much different from calling Install-WindowsFeature. It would be a trustworthy option, rather than simply a convenient option.

Activity

  1. added
    Issue-Feature
    on Sep 7, 2021
  2. jedieaston commented on Sep 7, 2021

    @jedieaston
    Contributor

    I think the current idea is that microsoft/winget-pkgs#100 will solve this. ISVs (or, in this case, Microsoft) will restrict packages in the community repo so that they are the only ones that can merge changes to them.

    It's not as strong as signatures (hypothetically someone could screw with GitHub and merge changes bypassing the policies), but we could generally trust that the manifests were correct. Does that not work for you?

  3. awakecoding commented on Sep 7, 2021

    @awakecoding
    Author

    I think the current idea is that microsoft/winget-pkgs#100 will solve this. ISVs (or, in this case, Microsoft) will restrict packages in the community repo so that they are the only ones that can merge changes to them.

    It's not as strong as signatures (hypothetically someone could screw with GitHub and merge changes bypassing the policies), but we could generally trust that the manifests were correct. Does that not work for you?

    This would not be sufficient, I really mean it when I say the manifests should be cryptographically signed by the vendor. What you are suggesting is having a way to let vendors control ownership over the manifests published in the community repository. The main difference is that if someone were to take control of the winget-pkgs repository and merge a malicious manifest, the cryptographic signature would not be valid. In order to push a malicious manifest with a valid signature, one would need to steal the keys used for the signatures (Microsoft in this case).

    In theory one could very well mix the Microsoft packages with the community packages inside one same repository, but then the problem is that it becomes difficult to tell automatically which package must be signed by which vendor (and key pair). The simplest option is to break down packages into vendor-specific repositories and automatically enforce signature validation for all packages inside that repository with the vendor key pair.

    Relying on package signatures also has one big advantage: it makes it possible to cache the entire set of manifests + download corresponding files for offline installation. Since the manifests are signed and refer to immutable artifacts by their hash, it doesn't matter where you download them from - you can still validate the signatures anyway. Offline installation with trust of origin from Microsoft would be excellent for Windows Server, where not all installations are done with internet access.

  4. awakecoding commented on Sep 15, 2021

    @awakecoding
    Author

    Steve Lasker (@SteveLasker) Sajay Antony (@sajayantony) this would be another interesting application of signed manifests

  5. doctordns commented on Sep 16, 2021

    @doctordns

    This approach would solve a lot of issues using winget (and winget cmdlets) in the server arena.

  6. canon250 commented on Nov 21, 2026

    @canon250

    Is there any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions