I would like to share an experience I recently had with Microsoft AppLocker that could help others save some valuable time.

Microsoft AppLocker is an application intended to provide control over applications and files on local systems. In my case, however, it led to some severe headaches and, ultimately, an unexpected outcome; one even Microsoft did not anticipate. So, let’s dive into the topic.

The problem

At panagenda, we offer a Digital Experience Monitoring solution which requires customers to install a packaged application on Windows. This application has a simple design with minimal requirements, and is signed by a certificate issued by the Global Root CA.

Customers who use AppLocker Rules are requested to add our application to the list of trusted packaged apps if there is no existing rule that trusts all signed packaged apps.  Typically, an AppLocker Administrator adds the rule on an administrative computer. The policy is then exported and applied to Endpoint Manager (formerly Intune) to be deployed to all client devices.

The problem arose tough, when the app got blocked although the allow rule was active and available. Windows Eventlog didn’t provide much detail, other than a very generic message without any details other than that there is no rule which would allow this application. Very helpful, right?

Windows Eventlog block event
Picture 1: Windows Eventlog block event

The investigation

When adding an AppLocker rule in the MMC UI, you typically select the app and make a few adjustments. We advise customers to use wildcards for the package name and version, restricting the rule at the publisher level only (see screenshot).

Set Publisher rule.
Picture 2: Set Publisher rule

You might think everything is set up correctly, but it is not.

If you take a look at the Publisher String of the certificate within the app, it looks like this:

E=office@panagenda.com, CN=panagenda GmbH, O=panagenda GmbH, STREET=Sonnenfelsgasse 13/9, L=Vienna, S=Vienna, C=AT, OID.1.3.6.1.4.1.311.60.2.1.1=Vienna, OID.1.3.6.1.4.1.311.60.2.1.2=Vienna, OID.1.3.6.1.4.1.311.60.2.1.3=AT, SERIALNUMBER=293516T, OID.2.5.4.15=Private Organization


Not really special. Pretty much the same as if you would take the publisher’s information for any other application like for instance Adobe.

CN=Adobe Inc., OU=Adobe Inc., O=Adobe Inc., L=San Jose, S=ca, C=US, SERIALNUMBER=2748129, OID.2.5.4.15=Private Organization, OID.1.3.6.1.4.1.311.60.2.1.2=Delaware, OID.1.3.6.1.4.1.311.60.2.1.3=US

After creation, the rule needs to be exported as XML and then imported into Endpoint Manager for further distribution to the endpoints. And here is where things went south.

It turns out that in the exported rule, the PublisherName string was truncated after 260 characters!

Exported XML with the truncated PublisherName
Picture 3: Exported XML with the truncated PublisherName

Microsoft specifies that the Publisher string must match exactly when AppLocker evaluates its rules. https://learn.microsoft.com/en-us/windows/security/application-security/application-control/app-control-for-business/applocker/understanding-the-publisher-rule-condition-in-applocker. The truncated string meant that the evaluation would always fail.

Is export the issue here, or is something else causing the problem?

In fact, it was not the export, but indeed something else. Basically, you create the rule, pick the application and then set the publisher level – you would assume that everything is fine, right? Wrong, if you reopen the rule in the MMC UI you will notice that the Publisher string is already truncated. As the export simply takes what is there, the result is an incorrect publisher string in the export as well.

Even Microsoft was surprised when we brought up this topic to them.

The fix

Pretty simple: Export the rule and update the exported XML to include the full Publisher String. Inject the modified XML into Endpoint Manager and deploy it. To verify if the Publisher Condition is configured correctly, run the following PowerShell cmdlet on the user’s PC.

Get-AppLockerPolicy -Effective | Select-Object -ExpandProperty RuleCollections

You should see the correct Publisher condition on the Client PC which matches exactly the publisher’s name on the installed packaged.

Remember however that you will need to update the exported XML whenever you modify the rule or create a new export at a later stage, as Publisher will still only have the truncated Publisher String.

Lesson learned

Trusting the UI cost hours – even for Microsoft. Next time, question everything, document the weird, and remember: “Wildcards might save the day, but understanding the details saves your sanity.” 😊