Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Import-Module icinga-powershell-framework fails in ContranedLanguage powershell when Applocker is enabled

Aperta
#616 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@LordHepipud ci sta già lavorando.

Dal 10/5/2023.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Enhancement Help wanted Investigation

I am trying to setup the Icinga for Windows with the PowerShell Framework on an Domain managed system.
Do to policy reason the Icinga agent has to run as an domain user and I have configured icinga agent like that (following the instruction.

When I run an powershell as that icinga service user to debug some stuff and try to import the icinga-powershell-framework module I get an error

Import-Module : This module uses the dot-source operator while exporting functions using wildcard characters, and this
is disallowed when the system is under application verification enforcement.

image

I guess this is caused due to the fact that AppLocker is active on the system and the user is not an Adminstrator and gets an PowerShell with ContrainedLanguage LanguageMode

Expected Behavior

I would like to be able to do an Import-Module icinga-powershell-framework as an normal user even when AppLocker is enabled.

Current Behavior

Failure to do an Import-Module icinga-powershell-framework

PS C:\Windows\system32> Import-Module icinga-powershell-framework
The pipeline has been stopped.
+ CategoryInfo : OperationStopped: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : PipelineStopped

Import-Module : The module to process 'icinga-powershell-framework.psm1', listed in field 'ModuleToProcess/RootModule'
of module manifest 'C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\icinga-powershell-framework.
psd1' was not processed because no valid module was found in any module directory.
At line:1 char:1

  • Import-Module icinga-powershell-framework
  •   + CategoryInfo          : ResourceUnavailable: (icinga-powershell-framework:String) [Import-Module], PSInvalidOper
     ationException
      + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
    
    

Import-Module : This module uses the dot-source operator while exporting functions using wildcard characters, and this
is disallowed when the system is under application verification enforcement.
At line:1 char:1

  • Import-Module icinga-powershell-framework
  •   + CategoryInfo          : SecurityError: (:) [Import-Module], PSSecurityException
      + FullyQualifiedErrorId : Modules_SystemLockDown_CannotUseDotSourceWithWildCardFunctionExport,Microsoft.PowerShell
     .Commands.ImportModuleCommand
    
    

Possible Solution

Steps to Reproduce (for bugs)

  1. System with AppLocker enabled somehow (details are beyond my capabilities
  2. Run PowerShell as normal user.
  3. Verify LanguageMode is ConstrainedLanguage by displaying $ExecutionContext.SessionState.LanguageMode
  4. Try to do an Import-Module icinga-powershell-framework

Context

I am trying to setup Icinga agent on an system where I will manage it but won't have Administrator access but can run stuff as the icinga service user

Your Environment

  • PowerShell Version used ($PSVersionTable.PSVersion):

Major Minor Build Revision


5 1 19041 2673

  • Operating System and version (Get-IcingaWindowsInformation Win32_OperatingSystem | Select-Object Version, BuildNumber, Caption):
    Version BuildNumber Caption

10.0.19045 19045 Microsoft Windows 10 Enterprise

Lingua principale
PowerShell
Stelle
86
Fork
34
Merge medio
4g 11h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Icinga/icinga-powershell-framework

Tutte le issue di Icinga/icinga-powershell-framework

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.