Skip Navigation

Wildcards in script control exclusions

You can use the asterisk (*) as a wildcard when specifying script control exclusions.
Using wildcards in script control exclusions reduces the number of alerts displayed in your console while allowing users to run certain scripts that match the exclusion path and filename. For example, you can exclude a specific script by using its full name, or you can use the wildcard to match a group of scripts that share a similar name.
Although the use of wildcards in exclusions provides flexibility, it can also lower your security stance if your exclusions are too broad. For example, avoid excluding entire folders such as
/windows/temp
. Instead, use a wildcard while specifying the full or partial filename of the script that you want to exclude (for example,
/windows/temp/myscript*.vbs
).
The following table describes the rules of script control exclusions:
Item
Description
Supported wildcard characters
Only the asterisk (*) is supported as a wildcard for script control exclusions.
The wildcard represents one or more characters.
Unix-style slashes
If you are using wildcards, exclusions must use Unix-style slashes (even for Windows systems).
Example:
/windows/system*/*
Folder exclusions
When you want to exclude a folder, the exclusion must have a wildcard at the end of the path to distinguish the exclusion as a folder (and not a file).
For example:
  • /windows/system32/*
  • /windows/*/test/*
  • /windows/system32/test*/*
File exclusions
When you want to exclude a file, the exclusion must end with a file extension to distinguish the exclusion as a file (and not a folder). For example:
  • /windows/system32/*.vbs
  • /windows/system32/script*.vbs
  • /windows/system32/*/script.vbs
  • One wildcard per level.
    • So /folder/*/script.vbs matches \folder\test\script.vbs or \folder\exclude \script.vbs but does not work for \folder\test\001\script.vbs. This would require either /folder/*/001/script.vbs or /folder/*/*/script.vbs.
    • The wildcard would need to persist down per level to where the script resides.
    • Two or more wildcards per level are not allowed. For example, /*/folder/ *file*.ext is not allowed.
For each folder level, you can use one wildcard only.
  • Example,
    /*/folder/*file*.ext
    is not allowed.
Each wildcard represents one folder level only. The number of folder levels represented in the exclusion must match the level of the file that you are trying to exclude.
  • For example, if you are trying to exclude
    \test\level1\level2\script.vbs
    , use
    /test/*/*/script.vbs
    (not
    /test/*/script.vbs
    ).
Process exclusions
Process exclusions with a wildcard must have a file extension to distinguish it as a process exclusion (and not a folder).
To specify a process regardless of the directory that it's in, refer to the following examples:
  • /my*.exe
    (local drive)
  • //my*.exe
    (network drive)
To specify a process that's in a specific directory, refer to the following examples:
  • /directory/child/my*.exe
    (local drive)
  • //directory/child/my*.exe
    (network drive)
Examples of full and partial matches in exclusions
Wildcards support full and partial exclusions.
  • /folder/*/script.vbs
  • /folder/test*/script.vbs
Absolute paths
Absolute paths are not supported in script control exclusions.
Relative paths
If you can identify a common relative path, you can exclude Universal Naming Convention (UNC) paths with a wildcard. For example, if you use device names in a path such as "DC01" to "DC24":
  • /dc*/path/to/script/*
Network paths
Network paths can be excluded. For example:
  • //hostname/application/*
  • //host*/application/*
  • //*name/*/application/*
  • //hostname/*
Examples of script control exclusions
Adding exclusions for dynamic scripts that are run from a specific directory location or for a script that is run from multiple different user folders is possible by using wildcards in script control exclusions. As an example, you can use the token “*” in the exception path to ensure it covers your variants.
The following table includes some example exclusions with matches that would be successfully excluded, and non-matches that won't be excluded. 
Exclusion example
Matches
Non-matches
/users/*/temp/*
  • \users\john\temp
  • \users\jane\temp
  • \users\folder\john\temp
  • \users\folder\jane\temp
These folders won't be excluded because the number of folder levels don't match.
/program files*/app/ script*.vbs
  • \program files(x86)\app \script1.vbs
  • \program files(x64)\app \script2.vbs
  • \program files(x64)\app \script3.vbs
  • \program files(x86)\app \script.vbs
  • \program files\app \script1.vbs
These folders won't be excluded because wildcards represent one or more characters.
//*example.local/sysvol/ script*.vbs
\\ad.example.local\sysvol \script1.vbs
\\ad.example.local\sysvol \script.vbs
This script won't be excluded because wildcards represent one or more characters.
/users/*/*/*.vbs
  • \/users/john/temp/ script.vbs
  • /users/john/temp/ anotherscript.vbs
/users/john/temp1/ temp2/script.vbs
This script won't be excluded because the number of folder levels don't match.