Application Definitions

All matching criteria are case sensitive on macOS.

Application definitions allow you to target applications based on specific properties. When an application is executed, Privilege Management for Mac will query the properties of the application and attempt to match them against the matching criteria in the definition. If a match is made, then the rule is applied. If any of the matching criteria do not match, then neither will the definition, and Privilege Management for Mac will attempt to match against subsequent definitions in the Application Group.

Privilege Management for Mac will continue this process for subsequent Application Groups defined in Application Rules until a successful match is made and the rule is applied. If no matches are made, then no rule will be applied to the application, and it will run as normal.

Privilege Management for Mac must match every definition you configure before it will trigger a match. The rules are combined with a logical AND.

Application definitions requiring a match can also be negated. To target applications that do not match the definition, select does NOT match from the dropdown.

Application Requests Authorization

The application requires authorization, so you need to approve that request. This applies to anything in macOS that has a padlock on the dialog box or where the system requires authorization to change something. The URIs are unique to the application. The Auth Request URIs are generic and any Auth Request URIs can be requested by any application.

When an application triggers an authorization request, the application will use a unique Auth Request URI. This URI will be different to the URI of the application itself. This matching criteria allows you to target any authorization request by matching the Auth Request URI, allowing you to target that specific Auth Request URI and apply your own controls.

This matching criteria can be used in combination with other criteria to target authorization requests from specific applications if more than one application uses the same Auth Request URI.

When this matching criteria is used in a definition, it will only match the authorization request of the application, and not the execution of the application. If you want to apply rules to both the application execution and application authorization request, then separate definitions must be created for each.

If you want to apply different rules to application execution and application authorization requests, then definitions must be added to different Application Groups and applied to different Application Rules.

Mac Packages are always configured to match exactly against the system.install.software request URI. You cannot set Auth Request URI or Perform Match Using options.

This matching criteria can be used with the following application types:

  • Binaries
  • Bundles
  • Packages
  • System Preferences

Command Line Arguments

The Command Line Arguments matching criteria allows you to target a binary or sudo command based on the arguments passed to the command being executed on the command line. Command Line Arguments can be executed either through the Terminal, or through a script. With this matching criteria, you can apply a specific action (such as block, allow, or audit) to specific Command Line Arguments, rather than only applying actions to the use of the binary or sudo command.

The Command Line Arguments matching criteria will match specifically the arguments passed to the binary or sudo command. The following example shows a command for listing the contents of the /Applications directory:

MyMac:~ standarduser$ ls -la /Applications
  • ls is the binary being executed, and is targeted by using the File or Folder Name matching criteria in a Binary definition.
  • -la /Applications are the arguments being passed to ls, and is targeted by using the Command Line Arguments matching criteria in a Binary definition.

Privilege Management for Mac will only match the command line arguments, which will not include the beginning binary or sudo command being executed. If you want to match both the binary and sudo command, as well as the command line, then both the File or Folder Name and the Command Line Arguments matching criteria must be enabled and populated in the definition.

This matching criteria allows you to target all, or just parts of the command line being used. This is achieved by inserting wildcards into the Command Line Arguments string, defining which part of the command line you want to match, or by using a regular expression.

This matching criteria includes the following matching options:

  • Command Line Arguments (for example, -la /Applications)
  • Exact Match
  • Starts With
  • Ends With
  • Contains
  • Regular Expressions

This matching criteria can be used with the following application types:

  • Binaries
  • Scripts
  • Sudo Commands

You can match on any command line argument with the exception of those listed in Mac Sudo Command Arguments Not Supported.

File or Folder Name Matches

This matching criteria allows you to target applications based on their name / path on disk. It is an effective way of automatically allowlisting applications located in trusted areas of the filesystem (for example, /Applications or /System), and for targeting specific applications based on their full path.

This matching criteria can be used in combination with other criteria in a definition, giving you more granularity over which applications you can target based on their properties. Although you may enter relative file names, we strongly recommended you enter the full path to a file.

Applications can be matched on the file or folder name. You can choose to match based on the following options:

  • File or Folder Name (for example, /Applications/iTunes.app)
  • Exact Match
  • Starts With
  • Ends With
  • Contains
  • Regular Expressions

You can match on the file path containing or starting with the /AppTranslocation/ folder, however we recommend you block all applications attempting to run from this location to ensure unsigned applications are not run. Instead, we recommend you run applications from the /Applications/ folder.

Targeting bundles with an Exact Match path applies only to the main binary in the Contents/MacOS directory as specified in the bundle's plist.

This matching criteria can be used with the following application types:

  • Binaries
  • Bundles
  • Packages
  • System Preferences
  • Sudo Commands
  • Scripts

File Hash (SHA-1 Fingerprint)

This definition ensures the contents of the application (which can normally be edited by any user) remain unchanged, as changing a single character in the script will cause the SHA-1 Hash to change.

A File Hash is a digital fingerprint of an application, generated from the contents of application binary or bundle. Changing the contents of an application results in an entirely different hash. Every application, and every version of the same application, has a unique hash. Privilege Management for Mac uses hashes to compare the application being executed against a hash stored in the configuration.

File Hash matching is the most specific criteria, as it can be used to ensure the application being run is the exact same application used when creating the definition, and that it has not been modified.

This matching criteria includes the following matching options:

  • File Hash

This matching criteria can be used with the following application types:

  • Binaries
  • Bundles
  • Packages
  • System Preferences
  • Sudo Commands
  • Scripts

Although File Hash is the more reliable matching criteria for matching a specific application, you must ensure definitions are kept up to date. When updates are applied to the endpoint, new versions of applications may be added, and so their SHA-1 hashes will be different. Applications on different versions of macOS will also have different SHA-1 hashes.

File Version Matches

If the application you entered has a File Version property, then it is automatically extracted. You can choose to Check Min Version, Check Max Version, and edit the version number fields. Alphanumeric characters are supported in the version of applications.

For application types with defined versions, you can optionally use the File Version matching criteria to target applications of a specific version or range of versions. This allows you to apply rules and actions to certain versions of an application, for example, blocking an application if it’s version is less than the version defined in the definition.

File Version matching can be applied either as a minimum required version, as a maximum required version, or you can use both to define a range of versions (between a minimum and a maximum).

This matching criteria includes the following matching options:

  • File Min Version
  • File Max Version

This matching criteria can be used with the following application types:

  • Bundles
  • System Preferences

Parent Process Matches

This option can be used to check if an application’s parent process matches a specific Application Group. You must create an Application Group for this purpose or specify an existing Application Group in the Parent Process group. Setting match all parents in tree to True will traverse the complete parent and child hierarchy for the application, looking for any matching parent process. Setting this option to False only checks the application’s direct parent process.

When a new application executes, it is executed by another process, or parent process. In most cases on macOS, the parent process will be launchd. However, sometimes applications like binaries and bundles are executed by other applications. For example, binaries like curl can be executed from Bash, and will be created as a child of the Terminal process. However, curl can also be used by applications.

The Parent Process matching criteria allows you to the target applications based on their parent process, so you can apply different rules and actions depending on where the application is being executed from. In the example above, you can use Parent Process matching to allow curl to be used by an authorized application, but still block users from executing it directly in the Terminal.

Parent Processes are defined as an Application Group, so you can identify multiple parents without having to create multiple definitions. This also means the parent process can be defined as any type of application (binary, bundle, system preference, or package) using any of the relevant matching criteria for each application.

This matching criteria includes the following matching options:

  • Parent Process Group (dropdown menu of all Application Groups existing in the configuration)

This definition can be used with the following application types:

  • Binaries
  • Bundles
  • Sudo Commands
  • Scripts

Publisher Matches

This option can be used to check for the existence of a valid publisher. If you have browsed for an application, then the certificate subject name will automatically be retrieved, if the application has been signed. By default, a substring match is attempted (Contains). Alternatively, you may choose to pattern match based on either a wildcard match (? and *) or a Regular Expression. The available operators are identical to the File or Folder Name definition.

Some applications are digitally signed with a certificate, giving a guarantee the application is genuine and from a specific vendor. The certificate also ensures the application has not been tampered with by an unauthorized source. The vendor who owns the certificate can be identified from certain properties of the certificate, which are referred to as Authorities. A certificate typically contains several Authorities linked together in a chain of trust.

To check if an application has been digitally signed and what the certificate Authorities are, use the following command example to check the certificate of the iTunes.app application bundle:

Codesign -dvvv /Applications/iTunes.app/

If the application has a certificate, there will be one or more Authorities listed in the output:

Authority=Software Signing
Authority=Apple Code Signing Certification Authority
Authority=Apple Root CA

In the output, the first Authority listed is the authority most specific to the application. In this example, you can see Apple uses the certificate Authority Software Signing to digitally sign iTunes.app.

With the Publisher matching criteria, you can target applications based on the publisher information contained in its certificate. This matching criteria can also be used in combination with other matching criteria, as a way of ensuring the application is a genuine application from the vendor.

All apps downloaded from the Apple Store will have certificates with the same authority, as Apple resigns all applications before making them available in the Apple Store.

This matching criteria includes the following matching options:

  • Publisher (For example, the Publisher for Apple applications is Software Signing)
  • Exact Match
  • Starts With
  • Ends With
  • Contains
  • Regular Expressions

This definition can be used with the following application types:

  • Binaries
  • Bundles
  • Packages
  • System Preferences
  • Sudo Commands

Source

If an application was downloaded using a web browser, this option can be used to check where the application or installer was originally downloaded from. The application is tracked by Privilege Management for Mac at the point it is downloaded, so if a user decided to run the application or installer at a later date, the source can still be verified. By default, a substring match is attempted (Contains). Alternatively, you can choose to pattern match based on either a wildcard match (? and *) or a Regular Expression. The available operators are the same as the File or Folder Name definition.

This definition can be used with the following application types:

  • Bundles
  • System Preferences

URI

Every macOS application bundle has a defined Uniform Resource Identifier (URI), a property that uniquely identifies the application to the system. URI’s follow a specific structure, typically referencing the vendor and application. For example, the URI for Apple iTunes is com.apple.iTunes.

The URI matching criteria provides an effective way of targeting applications where the filename or file path may not always be known. It is also an effective way of targeting applications from a specific vendor.

This matching criteria can also be used in combination with other matching criteria, as a way of ensuring the application is a genuine application from the vendor.

This is the Unique Request Identifier for the application bundle. You can choose to match based on the following options:

  • URI (for example, com.apple.iTunes)
  • Exact Match
  • Starts With
  • Ends With
  • Contains
  • Regular Expressions

This definition can be used with the following application types:

  • Bundles

Install Action Matches

This definition can be used to allow installation of bundles to the /Applications directory. This matching criteria can be used in combination with other criteria to allow or deny installation of the matched bundle.

You can choose from the following options to allow installation to the /Applications directory:

  • Yes
  • No

This definition can be used with the following application type:

  • Bundles

Delete Action Matches

This definition can be used to allow deletion of bundles from the /Applications directory. This matching criteria can be used in combination with other criteria to allow or deny deletion of the matched bundle.

You can choose from the following options to allow deletion from the /Applications directory:

  • Yes
  • No

This definition can be used with the following application type:

  • Bundles