You can edit custom YARA rules, for example, to enable the rule, update the tags, or to reanalyze files.
Prerequisites
To get familiar with YARA rule parameters, see YARA Rule Parameters.
For a list of the YARA tags that have predefined meanings, see YARA Rule Tags.
To get familiar with YARA CBEP attributes, see YARA CBEP Attributes.
- Rule identifiers can differ only by case, for example, "ABC" and "abc" can identify completely different rules.
- Operators such as == and contains use case-sensitive semantics and may return counter-intuitive results. For example, hash.sha1(0, filesize) == "7193B6EDF651EAC1AB437F64B2FD6F203F8B702F" will never return true because YARA hashes use lower case hexadecimal digits. There are no modifiers or workarounds available for this.
- Regular expressions can be used as workarounds for case-sensitivity. For example, == returns false for hashes with differing case. However, the required results can be obtained by using a case insensitive regular expression: (cbep.analysis.file.signature.codesigning_chain[0].cert[0].sha1_thumbprint matches /^09A5C5E9AF1B96091B22F92E0356B1C33A410420$/is. For information on regular expressions, see https://learn.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference.
- The Windows Agent generally ignores the case of YARA tags, however, it is recommended always to use lower case when using predefined tags. Tags in the Classification namespace are always treated case-insensitively, for example, QUARANTINE becomes quarantine. However, some of the predefined tags in the IsInteresting namespace must be lower case for them to be recognized. These tags are: archive, dep_incompatible, executable, filetype, installer, invalid, script, and script_interpreter.
Procedure
Results
The modified rule appears in the YARA rules table.
The agent must sync with the server and download the new rule for it to become effective.
If the YARA rule is enabled and the Namespace is defined as Classification, all new or modified files will be scanned and the rule tags will be assigned if the rule criteria is met. If you chose to rescan known files, they are rescanned immediately or the rescan will begin during the time range you selected.
If the YARA rule is enabled and the Namespace is defined as IsInteresting, all new or modified files will be scanned and the rule tags will be assigned if the rule criteria is met. If you chose to perform a full system scan, it is performed immediately or will begin during the time range you selected.