Prerequisites
Steps to reproduce
Execute FileSignatureInfo.GetFromFileStream on a signed .ps1 file from a Windows service (.NET Framework 4.8, compiled with "Prefer 32-bit") running under a gMSA account. This works for .exe and .dll files. It also works for .ps1 too if the service is running under a "normal" (non gMSA) account.
The NuGet Microsoft.Security.Extensions package's listed website goes to Get-AuthenticodeSignature hence opening a ticket here.
For reference - same is observed when calling Get-AuthenticodeSignature from the same service using PowerShellStandard.Library.
Not a surprise, since:
|
fileSigInfo = FileSignatureInfo.GetFromFileStream(fileStream); |
Expected behavior
FileSignatureInfo.GetFromFileStream and Get-AuthenticodeSignature should correctly work for .ps1 files when called from a Windows service running under a gMSA account
Actual behavior
FileSignatureInfo.GetFromFileStream and Get-AuthenticodeSignature do not work correctly for .ps1 files when called from a Windows service running under a gMSA account
Error details
Neither FileSignatureInfo.GetFromFileStream nor Get-AuthenticodeSignature throw errors. They just fail to read the signature.
Environment data
Name Value
---- -----
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
Execute FileSignatureInfo.GetFromFileStream on a signed .ps1 file from a Windows service (.NET Framework 4.8, compiled with "Prefer 32-bit") running under a gMSA account. This works for .exe and .dll files. It also works for .ps1 too if the service is running under a "normal" (non gMSA) account.
The NuGet Microsoft.Security.Extensions package's listed website goes to Get-AuthenticodeSignature hence opening a ticket here.
For reference - same is observed when calling Get-AuthenticodeSignature from the same service using PowerShellStandard.Library.
Not a surprise, since:
PowerShell/src/System.Management.Automation/security/Authenticode.cs
Line 323 in 85fcb72
Expected behavior
FileSignatureInfo.GetFromFileStream and Get-AuthenticodeSignature should correctly work for .ps1 files when called from a Windows service running under a gMSA accountActual behavior
FileSignatureInfo.GetFromFileStream and Get-AuthenticodeSignature do not work correctly for .ps1 files when called from a Windows service running under a gMSA accountError details
Neither FileSignatureInfo.GetFromFileStream nor Get-AuthenticodeSignature throw errors. They just fail to read the signature.Environment data
Visuals
No response