macOS examples of wildcards used in memory protection exclusions

These examples are based on excluding an executable that is stored in this path: /Application/TestApp/MyApp/program.dmg

Type

Description

Correct use of exclusions

Excludes program.dmg as long as it is located under the "MyApp" child directory:

CODE
/Application/**/MyApp/program.dmg

Excludes any executable with the .dmg as long as the it is located under the "MyApp" child directory:

CODE
/Application/**/MyApp/*.dmg

Excludes any executable as long as it is located under the "MyApp" child directory:

CODE
/Application/**/MyApp/*

Excludes program.dmg as long as it is located in any directory that is a child of the "TestApp" directory :

CODE
/Application/TestApp/**/program.dmg

Incorrect use of asterisks in exclusions

Only use a single asterisk (*) to match characters in a folder name or file name. Double asterisks (**) are reserved to match directory paths and cannot be used at the end of an exclusion.

This is a list of examples in the context of excluding /Application/TestApp/MyApp/program.dmg.

  • Incorrect: /Application/TestApp/MyApp/pro**am.dmg
  • Correct: /Application/TestApp/MyApp/progra*.dmg
  • Incorrect: /Application/**
  • Correct: /Application/**/*

Exclusions that are not recommended

Avoid using a double asterisk (**) at the beginning of an exclusion. For example:

CODE
/**/program.dmg

In this example, program.dmg is allowed to run from any folder on the drive. Although this exclusion is technically correct, it would exclude anything in any directory (including child directories) located on the drive.