how to find what is blocked by Applocker and add it to rule manually and script

how to find what is blocked by Applocker and add it to rule manually and script

137
Created On 11/10/26 11:00 AM - Last Modified 11/10/26 15:51 PM


Objective


this article is showing example how can identify which dll/exe/script is blocked by Applocker and add it to rule manually or script to fix it.

Environment


12.2;12.6;13.2;14.0;14.2;14.6 Privileged Access Manager (PAM, self-hosted);Privilege Cloud PSM;Privileged Session Management (PSM)

Procedure


1. put Applocker to Audit mode or disable to confirm if connection is working while issue happens when Applocker is set to enforced.

2. Reproduce the issue and open EventViewer in PSM server to navigate to below for applocker log.

Applications and Services Logs\Microsoft\Windows\Applocker\EXE and DLL

if connector is custom connector using "powershell" or scripting, check below as well.

Applications and Services Logs\Microsoft\Windows\Applocker\MSI and Script

3. filter with event id 8003 to see what file has been blocked. 

image.png

4. check the time line with connector and look for the first warning with User "PSMConnect" or Shadowuser . check the detail tab for applied rule and file full path.

image.png
image.png


5. open corresponding Applocker rule with matching User based on the information collected above and add exception the file path or folder with type of "Path".

image.png
image.png


6. continue testing to see if warning message with applocker is gone. 
7. if issue still persist, check which rule is affecting the connection by put Audit mode to one or two at a time to narrow down. 

image.png

8. Repeat above to find blocked file and add them manually.
--

Once list of blocked file identified and confirmed working after manually added, consider to add them to PSM applocker script to manage them with script. 

1. With the list of the file/folder to add to the rule, go to PSM server -> Hardening folder and find PSMConfigureAppLocker.xml file to edit.

+ As for PSMConnect user rule, find "InternalApplication" section.

++ EXE file rule example
 <Application Name="RDPInit" Type="Exe" SessionType="*" Path="c:\windows\system32\*" Method="Path" />

++ DLL file rule example
<Libraries Name="System32" Type="Dll" Path="%SYSTEM32%\*" Method="Path" SessionType="*" />

++ script rule example
<Application Name="CMDscript" Type="Script" Path=" C:\Windows\System32\Usrlogon.cmd" Method="Path" SessionType="*" />

+ As for PSMshadowuser rule, find "AllowedApplications" section. note that remove "SessionType" parameter.
++ example
 <Application Name="RDPInit" Type="Exe" Path="c:\windows\system32\*" Method="Path" />
<Libraries Name="System32" Type="Dll" Path="%SYSTEM32%\*" Method="Path" />
<Application Name="CMDscript" Type="Script" Path=" C:\Windows\System32\Usrlogon.cmd" Method="Path" />

9. run PSMConfigureAppLocker.ps1 to apply rule with script.


Actions
  • Print
  • Copy Link

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