Exclusions for files, folders and processes

Exclusions

Endpoint protection is a necessary component of a multi-layered security stance, which may include email security, firewall(s), intrusion detection, password management, SEIM, SOAR, EDR, and more. Ideally, these systems work together to make it increasingly difficult for bad actors to gain unauthorized access to an organization unnoticed.

Endpoint protection specifically has the responsibility for stopping nasty things from happening on your computer. This traditionally took the form of identifying and isolating malicious software like computer worms, viruses, ransomware, and other unwanted executables. In the constant game of cat-and-mouse between cyber threats and the defenses designed to stop them, malicious software—or malware—has adopted a range of sophisticated evasion strategies to slip past detection, such as:

Endpoint protection has evolved in lockstep with these strategies, and one widely adopted approach is to monitor all processes to look for activity indicative of malicious intent. What’s malicious intent, you may ask? Messing around with a lot of files—moving, adding, deleting, and/or encrypting them—in ways that are unusual or inappropriate is a good generic example.

The problem with activity- or behavior-based detection is that there’s a grey area where it’s not 100% clear whether a process is malicious, and this grey area can result in false positives. Err too much on the side of safety and you get more false positives. Err in the other direction and you risk missing some malicious activity.

The Role of Exclusions

Luckily endpoint protection products, Emsisoft included, allow you to configure exclusions, which instruct the software to ignore activity by a particular process or within a given directory. Problem solved, right? Not so fast. Exclusions are helpful for fine-tuning the detection to reduce false positives and can improve system performance, but if poorly implemented they can allow malicious activity to gain a foothold and go unnoticed. To be as secure as possible, an exclusion rule should be as specific as possible, because a very general rule opens the possibility that malware will be excluded either accidentally or maliciously. Excluding a folder and its subdirectories, for example, would potentially allow malware to run freely from that directory structure. Similarly, wildcards and environment variables should be used with care to develop a rule which is as narrow or specific as possible.

Writing Safer Exclusion Rules

Every time an exclusion is added, it opens an opportunity for malware to go undetected, so we want to write the exclusions to be as precise as possible. Let’s consider a number of ways to make exclusion rules as safe, and specific as possible.

Why it matters: If someone gains unauthorized access to a computer, it shouldn’t be easy for them to disable your protection. Endpoint protection should always have an administrative password set, so that if someone does manage to gain unauthorized access, they can’t disable your protection and proceed to steal or encrypt your data.

Why it matters: The use of these legitimate windows tools to accomplish malicious tasks can be detected and blocked by behavior-based detection, but only if the binaries don’t have exclusion rules. Examples of LoLBINS include: cmd.exe,powershell.exe,regsvr32.exe,rundll32.exe
See the complete list here.

Why it matters: The less exposure an exclusion has, the less likely it is to be exploited. If an application is used by a few users in accounting, for example, create an exclusion rule that only applies to those users. You never know which device may be compromised.

C:\Users\*\temp\*.exe ❌
vs
C:\Users\jdoe\temp\Update*.exe ✅

Why it matters: Applying as much detail as possible to a path leveraging a wildcard can minimize the possibility that it opens the door to malicious abuse.

C:\
C:\users\username\appdata\roaming
%temp%
C:\Windows

Why it matters: Just as generic folders are used by many applications, they’re also used by malware, so they open the door for easy access by malware.

Why it matters: For example, software updates often can’t readily be excluded by filename if those names change with subsequent versions. Excluding the unique folder from which updates are executed can help to get around this issue. For example:

c:\company\tool\version

Finally, when creating an exception rule, pay particular attention to syntax because a misplaced character can have a significant impact.

Emsisoft Enterprise Security + EDR

Robust and proven endpoint security solution for organizations of all sizes. Start free trial

Final Thoughts

Configuring exclusions is a balancing act: too broad, and you risk giving malware a free pass; too strict, and you may end up with disruptive false positives. By applying exclusions sparingly, keeping them as specific as possible, and restricting who can create or modify them, organizations can significantly reduce their exposure while maintaining smooth operations.

Luke Connolly

Luke Connolly

Threat intelligence analyst. Keeps an eye on the dark shadows of the internet so you don’t have to.

What to read next