How to Configure MobaXterm as a Universal Connector in Idira PSM with AppLocker

How to Configure MobaXterm as a Universal Connector in Idira PSM with AppLocker

118
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 16:09 PM


Objective


This article was originally written by  Tácio Santos of Comdados Comercio e Serviços Eletrônicos Ltda and share via our Community discussions. 

 

When trying to use MobaXterm as an SSH client through CyberArk PSM via a Universal Connector (AutoIt dispatcher), we ran into a series of AppLocker blocks that required careful configuration. This post documents the problem and how we solved it.

 



Environment


Privileged Access Manager (PAM, self-hosted) Privileged Session Management (PSM)

Procedure


Understanding MobaXterm's runtime environment and PSM Shadow Users

MobaXterm is not a simple SSH client — it ships a full embedded Unix environment (based on Cygwin/BusyBox) that gets extracted dynamically at runtime into the user's profile. This includes binaries like XWin_MobaX.exe, MoTTY.exe, hundreds of DLLs, and the full /usr/share/X11 structure.

 

In a PSM context, every recorded session runs under a shadow user (PSMShadowUsers group), each with its own isolated profile. This means MobaXterm extracts its environment into a dynamic per-user path:

 

1. C:\Users\PSM-2D00000000000000.PSM-01\AppData\Roaming\MobaXterm\slash\mx86_64b\

 

This behavior is the root cause of all the AppLocker issues — because the extraction path changes per session user, you can't simply hardcode it in the rules.

 

 

The AppLocker problem

PSM uses Windows AppLocker to restrict which applications can run during a session. The default policy is deny everything, with exceptions only for entries listed in 

PSMConfigureAppLocker.xml.

The errors that showed up in Event Viewer (filter: Error 8004) were:

1. APPDATA\ROAMING\MOBAXTERM\SLASH\MX86_64B\BIN\XWIN_MOBAX.EXE was prevented from running.

2. APPDATA\ROAMING\MOBAXTERM\SLASH\MX86_64B\BIN\LIBX11-6.DLL was prevented from running.

 

Setting a persistent root directory for MobaXterm

To ensure MobaXterm always extracts its environment to a predictable, fixed path, we configured a persistent root directory inside the PSM Components folder:

 

  • Create the folder on the PSM server:

    • "C:\Program Files (x86)\CyberArk\PSM\Components\MobaXtermRoot"

  • Open MobaXterm, go to Settings → Configuration → General → Persistent root (/) directory and point it to the path above.

MobaXterm setup screen

 

  • On next launch, MobaXterm will extract its environment to: MobaXtermRoot\slash\mx86_64b\bin\

 

Configuring PSMConfigureAppLocker.xml

Edit the file at C:\Program Files (x86)\CyberArk\PSM\Hardening\PSMConfigureAppLocker.xml and add the entries below inside <AllowedApplications>. Important: all <Application> entries must come before any <Libraries> — the XSD schema enforces this order and will throw a validation error otherwise.

 

 1. <!-- MobaXterm -->

 2. <Application Name="MobaXterm" Type="Exe" SessionType="*"

 3. Path="C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe"

 4. Method="Hash" />

 5. <Application Name="PSM-MobaXterm" Type="Exe" SessionType="*"

 6. Path="C:\Program Files (x86)\CyberArk\PSM\Components\PSM-MobaXterm.exe"

 7. Method="Hash" />

 8. <Application Name="MobaXtermAppDataExe" Type="Exe" SessionType="*"

 9. Path="C:\Users\*\AppData\Roaming\MobaXterm\*"

10. Method="Path" />

11.  

12. <Libraries Name="MobaXtermRoot" Type="Dll"

13. Path="C:\Program Files (x86)\CyberArk\PSM\Components\MobaXtermRoot\*"

14. Method="Path" />

15. <Libraries Name="MobaXtermAppData" Type="Dll"

16. Path="C:\Users\*\AppData\Roaming\MobaXterm\*"

17. Method="Path" />

18.  

 

❗️ The C:\Users\* wildcard automatically covers all shadow users without needing one entry per user. The Libraries entries with Method="Path" allow both the DLLs from the fixed MobaXtermRoot directory and those extracted into each shadow user's AppData.

 

Note: Ensure these rules are not altered prior to execution. Please refer to Understanding the Path Rule Condition in AppLocker  official Microsoft documentation for additional details. 

 

Applying the rules

After saving the XML, open PowerShell as administrator and run:

1. cd "C:\Program Files (x86)\CyberArk\PSM\Hardening"

2. .\PSMConfigureAppLocker.ps1

 

If new blocks appear after testing, check Event Viewer at Applications and Services Logs → Microsoft → Windows → AppLocker → EXE and DLL, filter by Error 8004, add the blocked paths to the XML, and rerun the script.

 

This post is based on a real implementation in a CyberArk PAM Self-Hosted environment. Paths may vary depending on your PSM and MobaXterm versions. Utilize with caution and be sure to understand all risks prior to implementation. 

 



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001WM5CAM&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail