JiraPS icon indicating copy to clipboard operation
JiraPS copied to clipboard

File not digitally signed

Open smitsrr opened this issue 6 years ago • 7 comments

Expected Behavior

Import-Module jiraPS runs without errors.

Current Behavior

I am able to Install-Module without error. However, when I execute Import-Module jiraPS I get the error:

Import-Module JiraPS
Import-Module : Errors occurred while loading the format data file: 
C:\Program Files (x86)\WindowsPowerShell\Modules\JiraPS\2.7.0\JiraPS.format.ps1xml, , C:\Program Files 
(x86)\WindowsPowerShell\Modules\JiraPS\2.7.0\JiraPS.format.ps1xml: The file was skipped because of the following validation 
exception: File C:\Program Files (x86)\WindowsPowerShell\Modules\JiraPS\2.7.0\JiraPS.format.ps1xml cannot be loaded. The file 
C:\Program Files (x86)\WindowsPowerShell\Modules\JiraPS\2.7.0\JiraPS.format.ps1xml is not digitally signed. You cannot run 
this script on the current system. For more information about running scripts and setting execution policy, see 
about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170..
At line:2 char:1
+ Import-Module JiraPS
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], RuntimeException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

I have tried to change my machine's execution policy, but the following settings still do not allow the file to execute:

PS C:\Windows\system32> Get-ExecutionPolicy -list

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       AllSigned
   UserPolicy       AllSigned
      Process    RemoteSigned
  CurrentUser    RemoteSigned
 LocalMachine    RemoteSigned

Possible Solution

Would it be possible for this file to be digitally signed?

Steps to Reproduce (for bugs)

Context

We are trying to write a powershell script to extract Jira data so we can import it into our warehouse and then report on it. Our warehouse software allows us to schedule and execute powershell scripts, so I'm hoping we can use this module to ease our reporting pipeline.

Your Environment

I am running JiraPS Version 2.7.0

PS C:\Windows\system32> $PSVersionTable

Name                           Value                                                                                           
----                           -----                                                                                           
PSVersion                      5.0.10586.1417                                                                                  
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                         
BuildVersion                   10.0.10586.1417                                                                                 
CLRVersion                     4.0.30319.42000                                                                                 
WSManStackVersion              3.0                                                                                             
PSRemotingProtocolVersion      2.3                                                                                             
SerializationVersion           1.1.0.1  

smitsrr avatar Jul 30 '18 14:07 smitsrr

I am able to get PSJira module to work as expected.

smitsrr avatar Jul 30 '18 17:07 smitsrr

Please update to the latest version (2.8.3) and re-test

lipkau avatar Jul 30 '18 22:07 lipkau

I ran update-module jiraPS, but it doesn't seem to have pulled 2.8.3. It is still at 2.7.0. Do I need to uninstall the module?

smitsrr avatar Jul 31 '18 15:07 smitsrr

The latest version is 2.8.3: https://www.powershellgallery.com/packages/JiraPS/2.8.3

try this:

Install-Module JiraPS -Force -Scope CurrentUser

lipkau avatar Jul 31 '18 15:07 lipkau

Doesn't seem to have solved the issue: image

smitsrr avatar Jul 31 '18 16:07 smitsrr

So... I do not have a way to confirm this myself: I think the MachinePolicy AllSigned (which is defined by GPO) overwrites any change the user can make. And therefore, with the GPO enabled, every module installed must be signed.

I would love to have out modules signed. But unfortunately, this is something we can't afford. https://www.sslshopper.com/cheap-code-signing-certificates.html

lipkau avatar Aug 03 '18 08:08 lipkau

Thank you for looking into it. I'm working with my system administrator to loosen the grips on my security so I can run the script.

smitsrr avatar Aug 08 '18 01:08 smitsrr