Configuring Windows AppLocker to Protect Against Ransomware Attacks

Problem:

How do I configure Windows AppLocker to Protect Against Ransomware Attacks

Solution:

First open the local security policy

Configuring Windows AppLocker to Protect Against Ransomware Attacks-1

Go to Application Control Policies and then AppLocker. Right click on AppLocker and go to Properties

Configuring Windows AppLocker to Protect Against Ransomware Attacks-2

First you will want to set AppLocker to an Audit only mode while you collect logs and see what might be blocked from running.  Change all the drop downs to Audit only and click Ok

Configuring Windows AppLocker to Protect Against Ransomware Attacks-3

You can now collect you log data in the Windows Event Log under: Application and Services Logs> Microsoft> Windows> AppLocker.  Check the EXE and DLL log to see which applications would be blocked from running.

Configuring Windows AppLocker to Protect Against Ransomware Attacks-4

Once you can see from the logs which applications would be blocked you can start to generate the allow rules. First right click on Executable Rules and go to Automatically Generate Rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-5

We will create Publisher based rules (it will use that publisher’s certificate) and to fall back to a file hash if there is no certificate.  AppLocker will scan your machine for applications and generate rules for each one

Configuring Windows AppLocker to Protect Against Ransomware Attacks-6

Click Create to create the rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-7

You will see a pop-up asking if you want to create the default rules, click Yes

Configuring Windows AppLocker to Protect Against Ransomware Attacks-8

This will add some suggested default rules.  From what is created we will delete:

(Default Rule) All files

(Default Rule) All files located in the Program Files folder

Configuring Windows AppLocker to Protect Against Ransomware Attacks-9

The list of rules should then look like this

Configuring Windows AppLocker to Protect Against Ransomware Attacks-10

Right click on Windows Installer Rules and go to Automatically Generate Rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-11

Click Next

Configuring Windows AppLocker to Protect Against Ransomware Attacks-12

We will create Publisher based rules (it will use that publisher’s certificate) and to fall back to a file hash if there is no certificate

Configuring Windows AppLocker to Protect Against Ransomware Attacks-13

Configuring Windows AppLocker to Protect Against Ransomware Attacks-14

Click Create to create the rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-15

You will see a pop-up asking if you want to create the default rules, click Yes

Configuring Windows AppLocker to Protect Against Ransomware Attacks-16

Configuring Windows AppLocker to Protect Against Ransomware Attacks-17

This will add some suggested default rules.  From what is created we will delete:

(Default Rule) All Windows Installer files

Configuring Windows AppLocker to Protect Against Ransomware Attacks-18

Right click on Script Rules and go to Automatically Generate Rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-19

Click Next

Configuring Windows AppLocker to Protect Against Ransomware Attacks-20

We will create Publisher based rules (it will use that publisher’s certificate) and to fall back to a file hash if there is no certificate

Configuring Windows AppLocker to Protect Against Ransomware Attacks-21

Configuring Windows AppLocker to Protect Against Ransomware Attacks-22

Click Create to create the rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-23

You will see a pop-up asking if you want to create the default rules, click Yes

Configuring Windows AppLocker to Protect Against Ransomware Attacks-24

This will add some suggested default rules.  From what is created we will delete:

(Default Rule) All scripts

Configuring Windows AppLocker to Protect Against Ransomware Attacks-25Configuring Windows AppLocker to Protect Against Ransomware Attacks-26

Right click on Packaged app Rules and go to Automatically Generate Rules

Click Next

Configuring Windows AppLocker to Protect Against Ransomware Attacks-27

Click Next

Configuring Windows AppLocker to Protect Against Ransomware Attacks-28

Configuring Windows AppLocker to Protect Against Ransomware Attacks-29

Click Create to create the rules

Configuring Windows AppLocker to Protect Against Ransomware Attacks-30

Configuring Windows AppLocker to Protect Against Ransomware Attacks-31

Now we can check the logs again

Configuring Windows AppLocker to Protect Against Ransomware Attacks-32

Test the configuration by downloading an .exe and trying to run it

Configuring Windows AppLocker to Protect Against Ransomware Attacks-33

The service should be started but we need to set it to automatic startup

Configuring Windows AppLocker to Protect Against Ransomware Attacks-34

Open PowerShell as an Administrator and run the below:

sc.exe config appidsvc start= auto 

Leave a Reply

Your email address will not be published. Required fields are marked *