--- title: "Expert Rule syntax to protect registry" slug: "expert-rule-syntax-to-protect-registry-1" tags: ["Product Usage", "ENS 26.x", "Endpoint Security"] updated: 2026-09-22T07:54:03Z published: 2026-09-22T07:54:03Z canonical: "docs.trellix.com/expert-rule-syntax-to-protect-registry-1" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.trellix.com/llms.txt > Use this file to discover all available pages before exploring further. # Expert Rule syntax to protect registry To write an expert rule to protect your registry, you need to ensure that it follows the correct syntax. Expert rules consist of process, one or more targets, and the matching conditions that rules must examine before allowing the source to access the registry. > [!NOTE] > Note > > Exploit Prevention is not supported in the ARM architecture. Here is a sample Expert rule for registry rule type and their respective definitions: > [!WARNING] > Caution > > Expert Rule commands are case-sensitive. ```plaintext Rule { Process { Include OBJECT_NAME { -v regedit.exe   } } Target { Match KEY { Include OBJECT_NAME { -v "HKLMS\\test**" } Include -access "CREATE WRITE DELETE REPLACE_KEY RESTORE_KEY" } } } ``` For more Expert rules examples, visit the GitHub repository. To add more commands in Expert rules, see [Learn Expert Rules commands for Files, Processes, and Registry](/v1/docs/aac-rule-structure-1). ### Sections of Expert Rule syntax in detail The above Expert rule syntax is described here: | ```plaintext Rule ``` | Formulates the execution of commands defined within `Process` and `Target`. | | --- | --- | | ```plaintext Process ``` | Executes the set of actions defined within the `Include` and `Exclude` commands. It does not take any other commands. | | ```plaintext Include OBJECT_NAME { -v regedit.exe ``` | `Include` command defines the Match types. These match types are supported for the Registry rule type: - ACCESS_MASK - AUTHENTICATION_ID - NT_ACCESS_MASK - OBJECT_NAME - OS_VERSION - REGVAL_DATA For example, the `OBJECT_NAME` match type is uses here to specify the name of interface object, regedit.exe, the Registry Editor. For more information, see [Object name guidelines](/v1/docs/object-name-guidelines-1) and [Match types values](/v1/docs/match-type-values-1). | | ```plaintext Target ``` | Defines the target matches for the rule. This command takes no arguments and can contain only `Match` commands. A rule must contain at least one or more `Target` commands. | | ```plaintext Match KEY ``` | Defines an object, that an Expert rule is intended to protect and to match an event. This command requires at lease one match object type value. For registry rule type, `KEY` and `VALUE` are the match object type values. | | ```plaintext Include OBJECT_NAME { -v "HKLMS\\test**" ``` | This section defines the target object name, that is, registry key path. These root keys are recognized: \| **Key** \| **Matches** \| \| --- \| --- \| \| HKLM \| HKLM is equivalent to HKEY_LOCAL_MACHINE. \| \| HKCU \| All user registry keys (not just the current user) and the .default user key. HKCU is equivalent to: - HKEY_CURRENT_USER - HKEY_USERS > [!NOTE] > Note > > Matching against specific user SIDs is not supported. \| \| HKCUC \| All user classes (HKCU/*_CLASSES). \| \| HKCR \| System classes and all user classes (HKCU/*_CLASSES). HKCR is equivalent to HKEY_CLASSES_ROOT. \| \| HKCCS \| - HKLM/SYSTEM/CurrentControlSet - HKLM/SYSTEM/ControlSet00X \| \| HKLMS \| - HKLM/Software on 32-bit and 64-bit systems - HKLM/Software/Wow6432Node on 64-bit systems only \| \| HKCUS \| - HKCU/Software on 32-bit and 64-bit systems - HKCU/Software/Wow6432Node on 64-bit systems only \| \| HKULM \| - HKLM - HKCU \| \| HKULMS \| - HKLMS - HKCUS \| \| HKALL \| - HKLM - HKU \| > [!NOTE] > Note > > If the rule specifies a name where the root starts or contains a wild character, the AAC code performs no name normalization and that name might never match correctly. For example, ****\mcshield\start** is a valid name, but **H*L*\mcshield\start** is not. HKEY_CURRENT_CONFIG is not supported. | | **Key** | **Matches** | | HKLM | HKLM is equivalent to HKEY_LOCAL_MACHINE. | | HKCU | All user registry keys (not just the current user) and the .default user key. HKCU is equivalent to: - HKEY_CURRENT_USER - HKEY_USERS > [!NOTE] > Note > > Matching against specific user SIDs is not supported. | | HKCUC | All user classes (HKCU/*_CLASSES). | | HKCR | System classes and all user classes (HKCU/*_CLASSES). HKCR is equivalent to HKEY_CLASSES_ROOT. | | HKCCS | - HKLM/SYSTEM/CurrentControlSet - HKLM/SYSTEM/ControlSet00X | | HKLMS | - HKLM/Software on 32-bit and 64-bit systems - HKLM/Software/Wow6432Node on 64-bit systems only | | HKCUS | - HKCU/Software on 32-bit and 64-bit systems - HKCU/Software/Wow6432Node on 64-bit systems only | | HKULM | - HKLM - HKCU | | HKULMS | - HKLMS - HKCUS | | HKALL | - HKLM - HKU | | ```plaintext Include -access "CREATE WRITE DELETE REPLACE_KEY RESTORE_KEY" ``` | Defines the access flags. This flag applies when the protected registry key or value is accessed. The registry rule type supports these access flags: - CREATE - DELETE - ENUM - LOAD_KEY - QUERY - READ - RENAME - REPLACE_KEY - RESTORE_KEY - WRITE To know more about the access flags, refer [ACCESS_MASK flags](/v1/docs/access-mask-flags-1). | For more Expert Rules examples, visit the [Trellix Github repository](https://github.com/trellix-enterprise/ExpertRules).