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

Cannot run Install-Package on VM in Azure #1168

Open
jaxidian opened this issue Nov 16, 2022 · 1 comment
Open

Cannot run Install-Package on VM in Azure #1168

jaxidian opened this issue Nov 16, 2022 · 1 comment

Comments

@jaxidian
Copy link

jaxidian commented Nov 16, 2022

Describe the bug
I am attempting to utilize PowerStig on a VM in Azure to generate MOFs from DISA-provided XCCDF files. However, I can't get the module to install successfully due to an authenticode signature error on VMware.VimAutomation.Sdk.

The command I'm running:

Install-Module -Name PowerStig -Scope CurrentUser

The error message:

The module 'VMware.VimAutomation.Sdk' cannot be installed or updated because the authenticode signature of the file 'VMware.VimAutomation.Sdk.cat' is not valid.

I have only tried this in both Azure Commercial and Azure Gov. I have tried this using the default commercial Windows 11 and Windows 2019 VM images with no modifications (other than enabling publicly accessible RDP, nothing fancy). I have also tried this with the built-in PowerShell as well as with 7.3.0. I have tried it both with and without running as Admin. Everything I try inside an Azure VM fails with much the same error (PowerShell Core is less verbose but it's still the same error). Oddly enough, I don't have this problem on my local laptop workstation.

To Reproduce

  1. Create new VM in Azure using a Windows 11 Pro vanilla image from Microsoft. (Alternatively, use a vanilla Windows 2019 Datacenter image from Microsoft.)
  2. Enable RDP and a public IP on that VM for easy access (I have not bothered to try this via Bastion).
  3. Once the VM is up and running, RDP into the machine.
  4. Right-click on the Start button and open up PowerShell. (Alternatively, install PowerShell 7.3.0 and open it up.)
  5. Run the Install-Module.
  6. Upon the first execution, it may ask to update PowerShellGet. If so, tell it y to update it. (It updates successfully.)
  7. Next it will prompt about an untrusted repository. Tell it a for Yes to All.
  8. Observe the authenticode signature error.

Expected behavior
I expect a successful installation of PowerStig with no errors.

Screenshots
These are screenshots of the errors as I see them in both Windows PowerShell as well as PowerShell Core 7.3.0. These screenshots are specifically from Windows 11 but Windows Server 2019 behaved the same way.

Windows PowerShell

PowerShell 7.3.0

Additional context
I have ran this Install-Module command locally on a few different physical workstations and I don't have an issue. But I cannot get it to successfully run in an Azure VM where I want to do this work. These VMs are as clean and fresh as possible when I attempt to do this. As soon as I login for the first time, other than clicking through any OOBE popups, I do nothing else before trying to install this.

@erjenkin
Copy link
Contributor

Hello Jaxidian,

This is an issue with one of the module dependencies in the VMware set. If you run the following, you should be able to get past this.

Install-Module powerstig -SkipPublisherCheck -Scope CurrentUser

We are hoping the cert issue is resolved with future iterations of that module. Currently even their latest version has an error related to its certificate.

Install-Package: Authenticode issuer 'CN="VMware, Inc.", O="VMware, Inc.", L=Palo Alto, S=California, C=US' of the new module 'VMware.vSphereDSC' with version '2.2.0.84' from root certificate authority
'CN=VeriSign Class 3 Public Primary Certification Authority - G5, OU="(c) 2006 VeriSign, Inc. - For authorized use only", OU=VeriSign Trust Network, O="VeriSign, Inc.", C=US' is not       
matching with the authenticode issuer '[email protected], CN="VMware, Inc.", O="VMware, Inc.", L=Palo Alto, S=California, C=US' of the previously-installed module 'VMware.vSphereDSC'   
with version '2.1.0.58' from root certificate authority 'CN=DigiCert Assured ID Root CA, OU=www.digicert.com, O=DigiCert Inc, C=US'. If you still want to install or update, use
-SkipPublisherCheck parameter.

Thanks,
Eric

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

No branches or pull requests

2 participants