CreateRuleRequest

CreateRuleRequest
CreateRuleRequest

Request body to create a Custom Rule. minAgentVersion is never accepted.

JSON Example
{
    "name": "string",
    "description": "string",
    "ruleType": "string",
    "matchData": "string",
    "action": "string"
}
string
name
Required  
Constraints: minLength: 1 maxLength: 255

Trimmed; letters, digits, space and - _ . : ( ) only (INVALID_RULE_NAME). Unique among all Rules ignoring case (DUPLICATE_RULE_NAME).

string
description
Optional
Constraints: maxLength: 2000

Optional free text. It is trimmed; longer than 2,000 characters after trimming is INVALID_DESCRIPTION. Absent or null stores no description

string
ruleType
Required  
Constraints: maxLength: 100

Rule type code; it must be an entry of the rule type catalog (PATH_FILE_CMD, HASH, PUBLISHER_SIGNING, MFA, ANTI_TAMPER or VIB_REPUTATION in this release; UNKNOWN_RULE_TYPE otherwise) and cannot be changed later. The allowed action depends on the type; an MFA rule accepts MFA_REQUIRED, AUDIT or ALLOW, and its matchData selects Hypervisor MFA User Groups through user_group_ids or all users through all_users true

string
matchData
Required  
Constraints: maxLength: 8192

JSON-encoded match criteria for the rule type, at most 8192 characters (INVALID_MATCH_DATA when longer or invalid). For PATH_FILE_CMD, target_path and process_path must be absolute (start with '/') for match_mode PREFIX; each '|' part of a GLOB must start with '/', '', '?' or '{'; a REGEX must be a valid ECMAScript regular expression. With match_mode EXACT or absent, a value is read as the Agent reads it: a regex when it holds a regex metacharacter, else a glob when it holds '' or '?', else an exact path that must be absolute. argv_pattern and arg_pattern must be valid regular expressions when match_mode is REGEX or they hold a regex metacharacter. 'any' and '*' match anything (INVALID_MATCH_DATA otherwise)

action
Required  

Default verdict of a Rule. MFA_REQUIRED is accepted only for ruleType MFA (any other type is refused with 400 INVALID_RULE_ACTION).

  • ALLOW: The operation is permitted
  • BLOCK: The operation is aborted with -EPERM
  • AUDIT: The operation is logged and alerted, and execution is permitted
  • MFA_REQUIRED: Triggers an interactive TOTP challenge through PAM; accepted only for ruleType MFA
Enumeration: ALLOW, BLOCK, AUDIT, MFA_REQUIRED