Skip to content

Configuration processor auditing improvements#6193

Merged
JohnMcPMS merged 12 commits into
microsoft:masterfrom
JohnMcPMS:config-proc
May 14, 2026
Merged

Configuration processor auditing improvements#6193
JohnMcPMS merged 12 commits into
microsoft:masterfrom
JohnMcPMS:config-proc

Conversation

@JohnMcPMS
Copy link
Copy Markdown
Member

@JohnMcPMS JohnMcPMS commented May 1, 2026

Change

When a processor path is provided, inform the user about that fact in the output. Ensure that the server agrees on the hash of the processor that is provided in its CLI arguments.

When the target processor is an app execution alias, the hash is of the contents of the reparse point data. Otherwise, it is a hash of the contents of the file itself.

Custom processor path:
  Path: C:\Program Files\WindowsApps\Microsoft.DesiredStateConfiguration_3.2.0.0_x64__8wekyb3d8bbwe\dsc.exe
  Hash: 6ee88bd4c93c4a94539a0af0667ace8ffba48f5b8732930e1421721621ca19de
  Signed By: CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US

Validation

Tests are added for the scenario and individual operations.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner May 1, 2026 20:01
florelis
florelis previously approved these changes May 7, 2026
Copy link
Copy Markdown
Member

@florelis florelis left a comment

Choose a reason for hiding this comment

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

I'm not familiar with the configuration code, so my review of that part was superficial and it may be wise to get somebody else to look at it.

Comment thread src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
Comment thread src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw Outdated
Comment thread src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw Outdated
Comment thread src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
Comment thread src/AppInstallerCLI.sln
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{3FF6C881-2548-486E-8D70-7555A90030F5}"
ProjectSection(SolutionItems) = preProject
..\doc\windows\package-manager\winget\returnCodes.md = ..\doc\windows\package-manager\winget\returnCodes.md
..\doc\Settings.md = ..\doc\Settings.md
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we move all the .mds here?

Comment thread src/AppInstallerSharedLib/Certificates.cpp Outdated
Comment on lines +195 to +196
result.IsAlias = true;
result.HashString = Utility::SHA256::ConvertToString(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we extract the signer/publisher from the package that owns the alias?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We don't know that with OS APIs. We could infer things about the path and likely find the family name, then the full name, then extract the signing information. But all of that is a guess, and a bad actor could easily replace the alias contents while we claimed signature information from the other package.

yao-msft
yao-msft previously approved these changes May 13, 2026
| 0x8A15C110 | -1978285814 | WINGET_CONFIG_ERROR_UNIT_SETTING_CONFIG_ROOT | A unit contains a setting that requires the config root. |
| 0x8A15C111 | -1978285813 | WINGET_CONFIG_ERROR_UNIT_IMPORT_MODULE_ADMIN | Loading the module for the configuration unit failed because it requires administrator privileges to run. |
| 0x8A15C112 | -1978285812 | WINGET_CONFIG_ERROR_NOT_SUPPORTED_BY_PROCESSOR | Operation is not supported by the configuration processor. |
| 0x8A15C113 | -1978285811 | WINGET_CONFIG_ERROR_PROCESSOR_HASH_MISMATCH | The DSC processor hash provided does not match hash of the target file. |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just realized the decimals for error codes starting from 0x8A15C110 were incorrect , we did not use ABCD..

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed and added markdown generation via winget error -o file.md which fixed a few more things that were off.

Comment thread src/AppInstallerCLICore/ConfigurationDynamicRuntimeFactory.cpp Outdated
Comment thread src/Microsoft.Management.Configuration.UnitTests/Helpers/Errors.cs Outdated
<value>Enable Windows Package Manager Configuration</value>
</data>
<data name="ErrorCommandLongDescription" xml:space="preserve">
<value>Retrieve information about errors. Given a number, the output will contain details about the error, including the symbol name if it is a WinGet specific error. Given a string, the WinGet specific errors are searched for this value.</value>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we update the command long description?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think so. It isn't the primary purpose of the command and I don't expect that many/any people will run it outside of us. The one fun thing you can do is run it to get a localized markdown file.

@JohnMcPMS JohnMcPMS merged commit 29350fa into microsoft:master May 14, 2026
9 checks passed
@JohnMcPMS JohnMcPMS deleted the config-proc branch May 14, 2026 15:56
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.

3 participants