AtlassianPS / JiraPS

PowerShell module to interact with Atlassian JIRA
https://AtlassianPS.org/module/JiraPS
MIT License
323 stars 131 forks source link

File not digitally signed #305

Open smitsrr opened 6 years ago

smitsrr commented 6 years ago

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)

1. 2. 3. 4.

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 commented 6 years ago

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

lipkau commented 6 years ago

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

smitsrr commented 6 years ago

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?

lipkau commented 6 years ago

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

try this:

Install-Module JiraPS -Force -Scope CurrentUser
smitsrr commented 6 years ago

Doesn't seem to have solved the issue: image

lipkau commented 6 years ago

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

smitsrr commented 6 years ago

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.