How to Configure Windows Server AppLocker Policies to Prevent Ransomware Execution

The Failure of Antivirus

Traditional antivirus software relies on a “Default Allow” architecture. It allows any program on a Windows Server to execute, unless the program’s mathematical signature matches a known virus in a database. This is a fundamentally broken security model. Modern ransomware groups do not use known viruses; they write custom, zero-day payloads that evade signature detection entirely. If a user clicks a malicious email attachment, the unknown payload executes, encrypts the entire file server, and destroys the backups before the antivirus even realizes an attack occurred.

To definitively stop ransomware, enterprise administrators deploy AppLocker. AppLocker reverses the paradigm to a “Default Deny” (Allowlisting) architecture. It instructs the Windows kernel to block everything—every script, every executable, every installer—from running, unless the IT administrator has explicitly mathematically authorized it. Even if a user with local administrative rights downloads a zero-day ransomware payload, they cannot execute it, because it is not on the AppLocker whitelist.

Step 1: Enabling the Application Identity Service

AppLocker relies on a specific background service to evaluate the cryptographic signatures and file paths of executables before allowing them to run.

Open an elevated PowerShell prompt on your Domain Controller and ensure the service is configured to start automatically on all target machines (you should ideally do this via Group Policy, but for testing, run it locally):

Set-Service -Name appidsvc -StartupType Automatic
Start-Service appidsvc

If this service is not running, AppLocker policies will not enforce.

Step 2: Generating the Default Rules (Critical)

You manage AppLocker via Group Policy. Open the Group Policy Management Console and create a new GPO named “AppLocker – Enforce Mode.”

Navigate to Computer Configuration > Policies > Windows Settings > Security Settings > Application Control Policies > AppLocker.

If you blindly turn AppLocker on without creating rules, it will block everything, including the core Windows operating system files. The server will instantly crash and you will never be able to log in again.

You must generate the Default Rules first. Expand AppLocker, click on Executable Rules, right-click, and select Create Default Rules. This creates three critical whitelist rules:

  1. Allow everyone to run files located in C:\Windows\*
  2. Allow everyone to run files located in C:\Program Files\*
  3. Allow the local Administrator group to run anything.

Because standard users cannot write files into C:\Windows or C:\Program Files (they only have write access to their User Profile, like the Downloads folder), they cannot download ransomware into a permitted directory.

Step 3: Creating Publisher Rules (Cryptographic Whitelisting)

The default path rules are a good baseline, but modern IT requires more precision. Instead of allowing an entire folder, you should authorize software based on its cryptographic digital signature.

Suppose you want to allow the Finance team to run a specialized accounting software, regardless of where they install it.

  1. Right-click Executable Rules and select Create New Rule.
  2. Select Allow and target the Finance_Users security group.
  3. Select Publisher as the condition.
  4. Browse to the accounting software’s .exe file. AppLocker will extract the digital certificate from the file.
  5. You can use the slider to set the strictness. You can allow “Any application signed by Intuit,” or you can be hyper-specific and only allow “QuickBooks version 2023 and above.”

If the accounting software is updated, the rule automatically applies, provided the developer hasn’t changed their cryptographic signing certificate.

Step 4: Blocking Scripts and MSI Installers

Ransomware is rarely delivered as an .exe file; it is usually delivered as a malicious PowerShell script or a hidden .msi installer.

You must configure AppLocker to govern these files as well. In the AppLocker menu, right-click Script Rules and generate the default rules. Do the same for Windows Installer Rules. This ensures that users cannot execute random .vbs or .ps1 scripts from their Downloads folder.

Step 5: Enforcing the Policy (Audit vs. Enforce)

When you deploy a new AppLocker policy, you will inevitably break a legitimate business application that was installed in a weird location (like C:\AppData\Local\CustomApp).

Therefore, you must never deploy a new policy in “Enforce” mode.

  1. Click on the main AppLocker node in the GPO editor.
  2. Click Configure rule enforcement.
  3. Check the box for Executable rules and set it to Audit only.

In Audit mode, AppLocker acts exactly as if it were enforcing the rules, but it does not actually block anything. Instead, it writes a warning event to the Windows Event Log (Applications and Services Logs > Microsoft > Windows > AppLocker > EXE and DLL) every time a user executes a file that would have been blocked.

You review these logs for a week. If you see legitimate software triggering the audit logs, you create a new Allow rule for it. Once the audit logs are clean of false positives, you change the policy from Audit only to Enforce rules.

Conclusion

Attempting to blacklist infinite variations of malware is a mathematically impossible battle. By implementing Windows Server AppLocker policies, IT security architects shift to a zero-trust execution model. By explicitly defining exactly which cryptographically signed applications are permitted to run, you instantly neutralize 99% of ransomware payloads, macro-viruses, and shadow IT applications, regardless of whether the antivirus software detects them.

RELATED POSTS

  • How to Setup an iSCSI Target Server in Windows Server
  • How to Setup a SSTP (Secure Socket Tunneling Protocol) VPN in Windows Server
  • How to Configure a Distributed File System (DFS) Namespace in Windows Server
  • How to Map a Network Drive Using Group Policy (GPO) in Windows Server
  • How to Clear the Windows RSAT (Remote Server Administration Tools) Cache via PowerShell
  • Get the best tech tips delivered straight to your inbox.

    Join thousands of readers mastering Apple, Google, Microsoft, and Linux.