Skip to main content
Follow these instructions to add a custom rule:
  1. Open Expert Editor and go to the folder activeguard/core/rule_sets/90_local/.
  2. Create a new file within rules via the three dots context menu. Name it <rule_name>.xml (e.g. CUSTOM_spam_keyword_match.xml). Hamburger icon for the context menu
  3. Open the file you just created and paste the content of the custom rule.
  4. Inside params folder, open local.properties.
  5. Add the parameter to activate the rule. Usually the format is <rule_name>_state=ACTIVE (e.g. CUSTOM_spam_keyword_match_state=ACTIVE).
  6. Click Publish. The rule-set changes become active within about one minute.

Adding a custom list

In case your custom rule references a new custom list, you will also need to add this new custom list.
  1. Open Expert Editor and go to the folder activeguard/core/rule_sets/90_local/.
  2. Create a new file within lists folder via the three dots context menu. If there is no lists folder inside 90_local, create one manually.
  3. Enter <list_name>.list.info.json as file name. For example, CUSTOM_spam_domains.list.info.json.
  4. Open the file you just created and add:
    where
    • displayName is the title/name of the list (no.1 on the screenshot below)
    • category is the name of the category the list belongs to (existing or a new one; no.2 on the screenshot below)
    • description is the description of the list displayed in the right pane after selecting a list in the left pane of the Lists view (no.3 on the screenshot below).
    List elements in the Lists view
  5. Click Publish. The custom list becomes active within about one minute.

Adding a YARA rule

You can block emails using a YARA rule by adding it to a custom rule. This YARA-based rule consists of 3 main elements:
  1. Condition to specify when the YARA rule is applied
  2. Actual YARA rule.
  3. Decision that tags or quarantines the matched email.
We start with this example rule and modify it to contain a YARA rule that finds CVE-2018-0802 exploits in Word and RTF files:
  1. Set the name to YARA_cve_2018_0802, set the state property to ACTIVE, and select the email direction it should be applied to in applyTo:
    The allowed values for applyTo are: ALL, INCOMING, OUTGOING, INTERNAL.
    The priority values are within the range of 0-2000. We recommend setting the priority to at least above 20 to ensure the built-in tag rules still apply. Then, either set it between 300 and 400 to ensure the rule has precedence over the built-in quarantine rules, or set it above 1000 to ensure that it does not have precedence over the built-in quarantine rules, i.e., is applied afterward.
  2. Write a condition that would match all Word and RTF attachments during the file scan:
  3. Now, add the actual YARA rule and close the condition block:
  4. Define the action. Here we just add a Tag that can be later used in a campaign:
  5. The whole rule should look like this:

Multiple YARA rules

It is possible to use multiple YARA rules in one custom rule. All you have to do is to put them in the <or>…</or> block, just like you did with the fileType selector:

Multi-Tenancy

A rule placed in 90_local as described above is the default for all tenants. To add a rule that applies to a single tenant only, put the rule file in activeguard/core/rule_sets/_tenantX/rules/custom/ instead, and activate it in the params folder of that same tenant. See Manage Tenant Rules for the folder structure and for overriding parameters per tenant.