---
updatedAt: 2026-09-18T18:36:03.000Z
---

# EPM for Mac application definitions and types | EPM-WM Cloud

## Application definitions

<Callout icon="ℹ️" theme="info">
  All matching criteria are case sensitive on macOS.
</Callout>

Application definitions allow you to target applications based on specific properties.

When an application runs, Endpoint Privilege Management for Mac queries the properties of the application and attempts to match them against the matching criteria in the definition.

* The rule applies on a match.
* If there is no matching criteria, Endpoint Privilege Management for Mac attempts to match against subsequent definitions in the Application Group. The matching process continues through Application Groups defined in Application Rules until a successful match and the rule is applied.
* If there are no matches, then no rule is applied, and the application runs as normal.
* Every definition you configure must 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.

**Definitions**

<Accordion title="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 Settings

</Accordion>

<Accordion title="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.

<Callout icon="ℹ️" theme="info">
  Endpoint 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.
</Callout>

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

<Callout icon="ℹ️" theme="info">
  You can match on any command line argument with the exception of those listed in [macOS sudo command arguments not supported](application-definitions-and-types-mac#macos-sudo-command-arguments-not-supported).
</Callout>

</Accordion>

<Accordion title="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.

<Callout icon="ℹ️" theme="info">
  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.
</Callout>

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

- Binaries
- Bundles
- Packages
- System Settings
- Sudo Commands
- Scripts

</Accordion>

<Accordion title="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. Endpoint 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 Settings
- Sudo Commands
- Scripts

<Callout icon="ℹ️" theme="info">
  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 also have different SHA-1 hashes.
</Callout>

**Changes to file hash auditing**

Prior to version 21.6, the file hash audited depends on the context, for example, whether the application is a bundle or whether it’s code signed:

- Signed applications report the code directory hash (**CDHash**).
- Unsigned single files (binaries, scripts) and signed packages report a SHA-1.
- Unsigned bundles report a recursively generated SHA-1 of all their contents. In a worst case scenario, this can take several minutes to generate.

In version 21.6, what is audited is simplified to provide support for reputation services such as VirusTotal:

- Single files report a SHA-1.
- Bundles report the SHA-1 of their main binary, as specified by their **Info.plist**.

**Changes to file hash matching criteria**

Support for matching signed applications using their CDHash is continuing, and we also now support matching against the audited SHA-1.

Support for recursive SHA-1 matching for unsigned bundles will be removed once Apple Silicon is widely adopted by businesses, as unsigned code is not allowed to run on these devices. It can cause significant performance issues.

**How to determine a file’s hash for matching criteria**

If you have audit events available through reporting, then you can find the appropriate SHA-1 file hash there. This is not as secure as using a CDHash for bundles.

Signed application (bundle, binary, script):

```
codesign -dvvv <path to bundle or file> 2>&1 | egrep "^CDHash"
```

Unsigned files (binary, script) and both signed and unsigned packages:

```
shasum -a 1 <path to file>
```

Unsigned bundle:

```
shasum -a 1 <path to bundle’s main binary>
```

</Accordion>

<Accordion title="File hash (SHA-256) matches">

Set the SHA-256 file hash on an application. The SHA-256 hash is supported on all appropriate macOS applications. On the macOS operating system, you can select **match**. The **does NOT match** setting is not available on macOS. We recommend using SHA-256 rather than SHA-1.

**How to determine a file’s hash for matching criteria**

If you have audit events available through reporting, then you can find the appropriate SHA-256 file hash there. This is not as secure as using a CDHash for bundles.

Unsigned files (binary, script) and both signed and unsigned packages:

```
shasum -a 256 <path to file>
```

Unsigned bundle:

```
shasum -a 256 <path to bundle’s main binary>
```

</Accordion>

<Accordion title="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 Settings

</Accordion>

<Accordion title="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.

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 setting, 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

</Accordion>

<Accordion title="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.

<Callout icon="ℹ️" theme="info">
  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.
</Callout>

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 Settings
- Sudo Commands

</Accordion>

<Accordion title="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 Endpoint 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 Settings

</Accordion>

<Accordion title="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

</Accordion>

<Accordion title="Install action matches">

Use 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

</Accordion>

<Accordion title="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

</Accordion>

## Application types

### Binary

<Callout icon="ℹ️" theme="info">
  Matching criteria is case sensitive.
</Callout>

1. From the left menu, click ![Policies menu icon](https://files.readme.io/0a0b21e053732120e4fbedbc3ba9e82923c32b6691db9ccb6d109faf24b23ae0-icon-policies.png).<br />The **Policies** page displays.
2. Locate the policy you want to open.
3. Click ![Actions menu](https://files.readme.io/7e786057c4cd2715b1c16394e9f6577cbdb2bdba8d3b97783ee040203f8af3c1-icon-actions.png) **> Open Policy**.<br />The **Policy Editor** opens, and the **Workstyles** page displays by default. You can view the policy's configuration in read-only mode.
4. Expand **macOS**.
5. Expand **Application Groups**.
6. Select the Application Group you want to add the binary control to.
7. Select **Create New Application > Binary**.
8. Enter a description or accept the default. Leave the **Description** blank to match on all binaries.
9. Configure the matching criteria::
   * File or Folder Name
   * File Hash (SHA-1)
   * File Hash (SHA-256)
   * Application Requests Authorization
   * Command Line Arguments
   * Publisher
   * Parent Process
10. Click **Finish**. The binary is added to the Application Group.

### Bundle

<Callout icon="ℹ️" theme="info">
  Matching criteria is case sensitive.
</Callout>

1. From the left menu, click ![Policies menu icon](https://files.readme.io/0a0b21e053732120e4fbedbc3ba9e82923c32b6691db9ccb6d109faf24b23ae0-icon-policies.png).<br />The **Policies** page displays.
2. Locate the policy you want to open.
3. Click ![Actions menu](https://files.readme.io/7e786057c4cd2715b1c16394e9f6577cbdb2bdba8d3b97783ee040203f8af3c1-icon-actions.png) **> Open Policy**.<br />The **Policy Editor** opens, and the **Workstyles** page displays by default. You can view the policy's configuration in read-only mode.
4. Expand **macOS**.
5. Expand **Application Groups**.
6. Select the Application Group you want to add the bundle control to.
7. Select **Create New Application > Bundle**.
8. Enter a description or accept the default . Leave the **Description** blank to match on all bundles.
9. Enter a **File** or **Folder Name**.
10. Configure the matching criteria:
    * File or Folder Name
    * File Hash (SHA-1)
    * File Hash (SHA-256)
    * Source
    * File Version
    * URI
    * Application Requests Authorization
    * Publisher
    * Parent Process
11. Click **Create Application**. The bundle is added to the Application Group.

### Package

<Callout icon="ℹ️" theme="info">
  Matching criteria is case sensitive.
</Callout>

1. From the left menu, click ![Policies menu icon](https://files.readme.io/0a0b21e053732120e4fbedbc3ba9e82923c32b6691db9ccb6d109faf24b23ae0-icon-policies.png).<br />The **Policies** page displays.
2. Locate the policy you want to open.
3. Click ![Actions menu](https://files.readme.io/7e786057c4cd2715b1c16394e9f6577cbdb2bdba8d3b97783ee040203f8af3c1-icon-actions.png) **> Open Policy**.<br />The **Policy Editor** opens, and the **Workstyles** page displays by default. You can view the policy's configuration in read-only mode.
4. Expand **macOS**.
5. Expand **Application Groups**.
6. Select the Application Group you want to add the package to.
7. Select **Create New Application > Package**.
8. Enter a description or accept the default and click **Next**. Leave the **Description** blank to match on all packages.
9. Enter a **File** or **Folder Name**.
10. Configure the matching criteria for the package:
    * File or Folder Name
    * File Hash (SHA-1)
    * File Hash (SHA-256)
    * Application Requests Authorization
    * Publisher
11. Click **Create Application**. The package is added to the Application Group.

### Script

Use the **Script** application type to target a script that is trying to run privileged operations using sudo. System administrators can apply Application Rules on scripts to allow installation and management of development tools; for example, Homebrew.

Supported script types include:

* bash (.sh)
* ruby (.rb)
* python (.py - xattr)

<Callout icon="ℹ️" theme="info">
  Matching criteria is case sensitive.
</Callout>

1. From the left menu, click ![Policies menu icon](https://files.readme.io/0a0b21e053732120e4fbedbc3ba9e82923c32b6691db9ccb6d109faf24b23ae0-icon-policies.png).<br />The **Policies** page displays.
2. Locate the policy you want to open.
3. Click ![Actions menu](https://files.readme.io/7e786057c4cd2715b1c16394e9f6577cbdb2bdba8d3b97783ee040203f8af3c1-icon-actions.png) **> Open Policy**.<br />The **Policy Editor** opens, and the **Workstyles** page displays by default. You can view the policy's configuration in read-only mode.
4. Expand **macOS**.
5. Expand **Application Groups**.
6. Select the Application Group you want to add the script control to.
7. Select **Create New Application > Script**.
8. Enter a description or accept the default. Leave the **Description** blank to match on all scripts.
9. Enter a **File** or **Folder Name**.
10. Configure the matching criteria for the binary:
    * File or Folder Name
    * File Hash (SHA-1)
    * File Hash (SHA-256)
    * Command Line Arguments
    * Parent Process
11. Click **Create Application**. The script is added to the Application Group.

**Install Homebrew**

The Homebrew installer is a shell script which users can download to their machine and run. This script internally uses sudo to create folders on the system and set their ownership/permissions to be accessible by the installing user, reducing the need for further privileged sudo operations when users want to install packages.

**Allow standard users to install Homebrew via Endpoint Privilege Management for Mac**

<Accordion title="Prepare a script">

The current installation script for Homebrew must be modified slightly to work with Endpoint Privilege Management for Mac.

To achieve this, create a script that contains the following:

```
#!/bin/bash

# Download the latest brew install script using curl
curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh -o install.sh

# The following command modifies the install.sh script, creating a backup of the original
# as install.sh.bak, and does the following modifications
#  - replaces occurrences of "/usr/bin/sudo" with just "sudo" to allow customers using
#    the non-Apple sudo to continue
#  - Inserts a line "HAVE_SUDO_ACCESS=0" near the top of the file. This bypasses the
#    built-in have_sudo_access feature with the expectation that the PMFM plugin policy is
#    correctly configured to match this script

sed -i .bak -e $'s^set -u^set -u\\\nHAVE_SUDO_ACCESS=0^' \ 
    -e '/unset HAVE_SUDO_ACCESS/d' install.sh

source install.sh
                
rm install.sh
rm install.sh.bak
```

Check the shasum of the file you created to ensure no copy and paste irregularities have introduced differences.

To check the shasum of the script, run the following command in Terminal:

```
shasum -a 1 <name of script>
```

</Accordion>

<Accordion title="Add the script to policy">

To create a rule to match this script in the Policy Editor:

1. Create an Application Group to add the script control.
2. Select **Create New Application > Script**.
3. Enter **\*** as the file or folder name, as you're matching explicitly on hash.
4. Enter a description of **User Homebrew Installation**.
5. Set the **File Hash** to value **\<_insert shasum here_>**.

   Ensure this file hash is the same as the script you prepared earlier, in case you made any custom modifications.
6. Click **Create Application**. The script is added to the Application Group.

</Accordion>

<Accordion title="Add a sudo command for Homebrew to policy">

In the same Application Group:

1. Click **Create New Application > Sudo Command**.
2. Enter **\*** to represent any sudo command.
3. Enter a description or accept the default.
4. Configure the **Parent Process** to be the group which you are editing.

   This keeps the configuration of Homebrew isolated in the policy and easier to navigate. Alternatively, you can separate the **Script** and **Sudo** application definitions.
5. Click **Create Application**. The **sudo** command is added to the Application Group.

</Accordion>

<Accordion title="Set up an application rule for Homebrew">

1\. Select the Workstyle that is appropriately filtered for users you want to allow to install Homebrew.
2\. Create an application assignment for the Application Group that contains the sudo command, of type **Allow Execution**, with your messaging and auditing preferences.

</Accordion>

### Sudo command

<Callout icon="ℹ️" theme="info">
  Matching criteria is case sensitive.
</Callout>

1. From the left menu, click ![Policies menu icon](https://files.readme.io/0a0b21e053732120e4fbedbc3ba9e82923c32b6691db9ccb6d109faf24b23ae0-icon-policies.png).<br />The **Policies** page displays.
2. Locate the policy you want to open.
3. Click ![Actions menu](https://files.readme.io/7e786057c4cd2715b1c16394e9f6577cbdb2bdba8d3b97783ee040203f8af3c1-icon-actions.png) **> Open Policy**.<br />The **Policy Editor** opens, and the **Workstyles** page displays by default. You can view the policy's configuration in read-only mode.
4. Expand **macOS**.
5. Expand **Application Groups**.
6. Select the Application Group you want to add the sudo command to.
7. Click **Create New Application** > **Sudo Command**.
8. Enter a description or accept the default. Leave the **Description** blank to match on all sudo commands.
9. Enter a **File** or **Folder Name**.
10. Configure the matching criteria for the sudo command:
    * File or Folder Name
    * File Hash (SHA-1)
    * File Hash (SHA-256)
    * Command Line Arguments
    * Publisher matches
    * Parent Process
11. Click **Finish**. The sudo command is added to the Application Group.

**Sudo switches**

Endpoint Privilege Management for Mac supports running sudo commands with the following switches:

* **-b**, **--background**
* **-e**, **--edit**(requires configuration. See [Edit -e switch](#edit--e-switch)).
* **-i**, **--login**
* **-S**, **--stdin**
* **-s**, **--shell**
* **-V**, **--version**

When a sudo command is run, Endpoint Privilege Management for Mac ignores any switches that have been used and will match the rest of the command against the application definition.

* If Endpoint Privilege Management for Mac matches against a rule that allows execution, the sudo command runs with any supported switches that were used. Any switches not supported by Endpoint Privilege Management for Mac are ignored.
* If Endpoint Privilege Management for Mac matches on a passive rule or doesn't match any rules, then the sudo command runs with any supported or unsupported switches that have been used.

<Callout icon="ℹ️" theme="info">
  The **-l --list** switch, which lists the commands the user is allowed to run, does not take into account the commands that are restricted by Endpoint Privilege Management for Mac.
</Callout>

**Edit -e switch**

The **-e --edit** switch, also known as **sudoedit**, allows the user to edit one or more files using their preferred text editor. The text editor is defined by setting the **SUDO\_EDIT**, **VISUAL**, or **EDITOR** environment variable in the user's Terminal session. Otherwise, the default editor, Vim, is used.

To configure your policy to support the **-e** switch, set up a sudo command Application Rule so that:

* The **File or Folder Name** definition is set to **sudoedit** with the **Perform Match Using** set to **Exact Match**.
* The **Command Line Arguments** definition is set to the path of the files to control using this rule.

The audit log will show an application of **/usr/bin/sudo** and the command line arguments will have **-e** prepended to them.

#### macOS sudo command arguments not supported

The following arguments are not supported by Endpoint Privilege Management for Mac when you're using sudo:

| Option (single dash) | Option (double dash) | Description                                                                     |
| -------------------- | -------------------- | ------------------------------------------------------------------------------- |
| -A                   | --askpass            | use a helper program for password prompting                                     |
| -C num               | --close-from=num     | close all file descriptors >= num                                               |
| -E                   | --preserve-env       | preserve user environment when running command                                  |
| -g group             | --group=group        | run command as the specified group name or ID                                   |
| -H                   | --set-home           | set HOME variable to target user's home dir                                     |
| -h host              | --host=host          | run command on host (if supported by plugin)                                    |
| -K                   | --remove-timestamp   | remove timestamp file completely                                                |
| -k                   | --reset-timestamp    | invalidate timestamp file                                                       |
| -l                   | --list               | list user's privileges or check a specific command; use twice for longer format |
| -n                   | --non-interactive    | non-interactive mode, no prompts are used                                       |
| -P                   | --preserve-groups    | preserve group vector instead of setting to target's                            |
| -p prompt            | --prompt=prompt      | use the specified password prompt                                               |
| -U user              | --other-user=user    | in list mode, display privileges for user                                       |
| -u user              | --user=user          | run command (or edit file) as specified user name or ID                         |
| -v                   | --validate           | update user's timestamp without running a command                               |

#### Configure NOEXEC for sudo rules

You can configure a sudo rule that permits a specific command on macOS while preventing that command from spawning child processes or executing other binaries using our Shell Guardian functionality. In the Policy Editor, configure this behavior with the Child Processes setting on macOS sudo rules.

#### Prerequisites

* Deploy Endpoint Privilege Management for Mac 26.3.1 or later to the target macOS endpoints.
* Use Policy Editor 26.3.1 or later.
* Pre-approve the Shell Guardian NOEXEC system extension in your MDM solution before deploying the policy to production endpoints. The system extension is automatically approved with the EPM Configuration profile version 2.4.0 and later.
* Confirm System Integrity Protection (SIP) remains enabled on managed endpoints. Shell Guardian enforcement is not guaranteed on systems where SIP is disabled.

#### Configure a sudo rule with Shell Guardian

1. In the Policy Editor, open the policy that contains the macOS workstyle you want to update.
2. Open the relevant macOS workstyle, and then open the sudo rules for that workstyle.
3. Create a new sudo rule, or edit an existing sudo rule for the command you want to permit.
4. Configure the sudo command match criteria as specifically as possible, including the command path and any required arguments.
5. Enable the **Child Processes** option for the sudo rule. This applies Shell Guardian / NOEXEC enforcement to the rule.
6. Save the rule, save the policy, and assign or publish the policy to the target macOS endpoints.
7. Test the sudo workflow on a representative endpoint before broad deployment.

### System Settings pane

<Callout icon="ℹ️" theme="info">
  Matching criteria is case sensitive.
</Callout>

<Callout icon="🚧" theme="warn">
  ### Important

  When adding the **Battery preference pane** to a policy, the match must include the URI and exact file path, similar to:

  ![Battery preference pane settings](https://files.readme.io/fb20c718c5989d124650f65ea3e0ed398f97dc2490b42b57c59ee5c44a45fc20-pm-mac-add-battery-pref.png)

  Failing to configure correctly can result in matching unrelated authorization requests, which can lead to unexpected behavior.
</Callout>

**Add a system settings pane**

1. From the left menu, click ![Policies menu icon](https://files.readme.io/0a0b21e053732120e4fbedbc3ba9e82923c32b6691db9ccb6d109faf24b23ae0-icon-policies.png).<br />The **Policies** page displays.
2. Locate the policy you want to open.
3. Click ![Actions menu](https://files.readme.io/7e786057c4cd2715b1c16394e9f6577cbdb2bdba8d3b97783ee040203f8af3c1-icon-actions.png) **> Open Policy**.<br />The **Policy Editor** opens, and the **Workstyles** page displays by default. You can view the policy's configuration in read-only mode.
4. Expand **macOS**.
5. Expand **Application Groups**.
6. Select the Application Group you want to add the system settings pane to.
7. Click **Create New Application > System Settings Pane**.
8. Enter a description or accept the default. Leave the **Description** blank to match on all system settings panes.
9. Enter an **Auth Request URI**.
10. Configure the matching criteria:
    * File or Folder Name
    * File Hash (SHA-1)
    * File Hash (SHA-256)
    * Source
    * File Version
    * Application Requests Authorization
    * Publisher
11. Click **Create Application**. The **System Settings Pane** is added to the Application Group.

## Disk mounted images

Endpoint Privilege Management for Mac examines each disk mounted image (DMG) when running with a valid license.

* If there are one or more bundles of applications in the Disk Image, where the policy is contained in an allow rule for the Workstyle, **and** the install action is also set to **Yes** in the Application Rule, the user is allowed to copy those bundles to the System Applications folder on the endpoint.
* If the applications do not have an Endpoint Privilege Management **Allow** rule, the copying of the bundle defaults to normal macOS functionality where admin credentials are required to copy the bundle to the System Applications folder. Standard macOS functionality is used if anything other than an **Allow** rule is associated with the application bundle in the DMG, such as **Block** or **Passive**.

<Callout icon="ℹ️" theme="info">
  Previously, to trigger copy functionality, the bundle from the DMG had to be in an Application Group with an Endpoint Privilege Management **Allow** rule. As of version 5.4, the same condition applies, however, the bundle must also have **Install Action match** set to **Yes** in the Application matching criteria, within the **Application Groups** settings to right-click and **Install with Defendpoint**. Existing policies must be altered to reflect the changes in functionality.

  For more information, see [Manage system applications](application-definitions-and-types-mac#manage-system-applications).
</Callout>

### Configure the defendpoint.plist file

Managing DMGs is controlled by default, but it can be turned off by editing the **defendpoint.plist** file.

The location for the **defendpoint.plist** file is **/Library/Application Support/Avecto/Defendpoint/defendpoint.plist**.

Set the **MountAssistant** key to **false** to turn off the Endpoint Privilege Management for Mac management of DMG files (it is set to **true** by default):

```
<key>MountAssistant</key>
<false/>
```

You must restart the **defendpointd** daemon after you edit the **defendpoint.plist** file for any changes to take effect. This can either be done by restarting the machine or by running these commands from Terminal:

```
sudo launchctl unload /Library/LaunchDaemons/com.avecto.defendpointd.plist
sudo launchctl load /Library/LaunchDaemons/com.avecto.defendpointd.plist
```

<Callout icon="ℹ️" theme="info">
  If you specify the **-w** parameter in the command line, it will disable the daemon and a reboot will not turn it back on. Not including the parameter will allow the daemon to restart after a reboot of the endpoint.
</Callout>

### Format of messages

Within the **defendpoint.plist** file, you can also modify the string used for the messaging in the key tag.

The format of the messages is a **key** and **string** tag:

```
<key>MountMessageAllow</key>
<string>Allow copying "[APP_NAME]" from "[MOUNT_NAME]" to Applications?</string>
```

The following placeholders can be used:

* **\[APP\_NAME]:** Replaced by the Application Name.
* **\[MOUNT\_NAME]:** Replaced by the Volume Name of the mounted DMG.

When you enter your own strings for the above keys, the formatting is 'what you see is what you get'. For example, if you press **Enter**, then you will get a new line.

You can configure the message displayed to the user at the endpoint in the following scenarios:

* **MountMessageAllow:** Message that appears when a DMG containing an allowed bundle, is mounted.
* **MountMessageNoteSame:** Message that appears in smaller text below the **MountMessageAllow** message if the bundle is allowed, but the same version exists in the destination.
* **MountMessageNoteNewer:** Message that appears in smaller text below the **MountMessageAllow** message if the bundle is allowed but a newer version of the bundle exists in the destination.
* **MountMessageNoteOld:** Message that appears in smaller text below the **MountMessageAllow** message if the bundle is allowed but an older version of it exists in the destination.
* **MountNotificationSuccess:** Message that appears in the macOS notification center when the copying process succeeds.
* **MountNotificationFailure:** Message that appears in the macOS notification center when the copying process fails.

If the message keys above have not been set, Endpoint Privilege Management for Mac uses the default values and strings. If you enter the **\<key>** but do not specify the **\<string>**, then the message will be empty.

You must use escaped characters for valid XML, such as in the examples below:

| Symbol | Escaped Form |
| ------ | ------------ |
| "      | ""           |
| &      | &"           |
| ‘      | \&apos"      |
| <      | <"           |
| >      | > "          |

**Example**

The following examples show sample messages in the **defendpoint.plist** file.

```
<string>Allow copying "[APP_NAME]" from "[MOUNT_NAME]" to Applications?</string>
<key>MountMessageNoteSame</key>
<string>Note: same version of the item named "[APP_NAME]" already exists in this
location.</string>
<key>MountMessageNoteNewer</key>
<string>Note: a newer version of the item named "[APP_NAME]" already exists in this
location.</string>
<key>MountMessageNoteOlder</key>
<string>Note: an older version of the item named "[APP_NAME]" already exists in this
location.</string>
<key>MountNotificationSuccess</key>
<string>"[APP_NAME]" was successfully copied from "[MOUNT_NAME]" into the Applications
older.</string>
<key>MountNotificationFailure</key>
<string>"[APP_NAME]" was not successfully copied from "[MOUNT_NAME]" into the
Applications folder.</string>
```

## System applications

Endpoint Privilege Management for Mac examines each application and, if there is an application bundle where the application is associated with an **Allow** rule and **Install Action match** of **Yes**, the user can right-click the application and select **Install with Privilege Management**. This will install the bundle in the **/Applications** folder on the endpoint.

If the applications do not have an **Allow** rule with an **Install Action match** or **Delete Action match** of **Yes**, the management of the bundle defaults to normal macOS functionality where admin credentials are required to manage the bundle in the **/Applications** folder. Standard macOS functionality is used if anything other than an **Allow** rule with an **Install Action match** or **Delete Action match** of **Yes** is associated with the application bundle, such as **Block** or **Passive**.

<Callout icon="ℹ️" theme="info">
  - You cannot use File Hash matching criteria to install or uninstall unsigned bundles.
  - Per system functionality, applications running or protected by System Integrity Protection (SIP) cannot be uninstalled.
</Callout>

<Callout icon="ℹ️" theme="info">
  For more information, see **Install action matches** and **Delete action matches** in [Application definitions](application-definitions-and-types-mac#application-definitions).
</Callout>

### Endpoint Privilege Management Finder Extension

Activate the Privilege Management Finder extension before using **Run with Privilege Management** to manage the System Applications folder. The location to manage extensions depends on your [macOS version](https://support.apple.com/en-ca/guide/mac-help/mtusr003/26/mac/26).

The Finder extension allows end users to install applications. The extension works in the same way as the native macOS functionality.

#### Remove applications from the /Applications folder

Standard users can drag an application from the **/Applications** folder to the **Trash**.

* If the application matches a policy entry which has **Deletable** set on it, then any messages configured in the policy are displayed first to the user, and the user can proceed.
* If the policy does not contain a matching entry for the item being removed, then this is treated as a passive event and the user is prompted for an administrative user’s credentials to proceed.

#### Install applications distributed in a DMG file

The Finder extension is active within mounted DMG volumes to install applications.

As with all previous releases, if a standard user attempts to drag an application to the **/Applications** folder, then they are prompted for an administrator’s user name and password to proceed.

Allowing standard users to install applications using the Finder extension or MountAssist features remains, as per previous releases.

VLC media player is an example of an application distributed in a DMG volume.

#### Install applications distributed from a non-DMG file

As of version 22.7, a standard user can drag files to the **/Applications** folder to install applications.

This only supports application bundles which are not contained within a mounted disk (DMG).

Standard users can drag an application from the **/Applications** folder to the **Trash**.

* Removing these file types behaves passively if the dragged item does not match any entries in the policy.
* Allows the user to remove the application pending the completion of any configured Endpoint Privilege Management for Mac messaging.