AWS guardduty: GuardDuty: document RE2_FIND/IRE2_FIND functions for Runtime Monitoring rules
Summary
Rewrites the intro to describe Custom Detection Rules as opt-in detections enabled per-environment risk, and expands the detection-logic function table with the RE2_FIND and IRE2_FIND regular-expression functions used by Runtime Monitoring rules, plus a note that agent-recorded command-line arguments are null-separated and that rule SQL approximates GuardDuty's detection logic.
Security assessment
The diff documents the detection-logic SQL functions (RE2_FIND/IRE2_FIND) that back GuardDuty Custom Detection Rules and Runtime Monitoring, including how the security agent records null-separated command lines. This is descriptive documentation of a threat-detection feature with no mention of a specific vulnerability, CVE, credential, or permission change, so it is security-relevant but low severity.
Evidence
+`RE2_FIND(input, pattern)` | Boolean | Returns true when the RE2 regular expression `pattern` matches any part of `input`. The match is case sensitive. Returns false when `input` is null. Runtime Monitoring rules use this function mainly to match process command lines.
Diff
diff --git a/guardduty/latest/ug/custom-detection-rules-available.md b/guardduty/latest/ug/custom-detection-rules-available.md index d37d717..9b0eb77 100644 --- a//guardduty/latest/ug/custom-detection-rules-available.md +++ b//guardduty/latest/ug/custom-detection-rules-available.md @@ -11 +11 @@ Viewing rule detection logicFunctions used in detection logic -GuardDuty owns and maintains a library of rules that you can enable in your accounts. GuardDuty adds new rules and refines existing ones over time to improve detection accuracy and reduce false positives. Each rule update is versioned. Because the available rules change, the [ListCustomDetectionRules](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListCustomDetectionRules.html) API operation is the authoritative source for the rules that you can currently enable. For information about available rules, see [Custom Detection Rules finding types](./findings-custom-detection-rules.html). +GuardDuty Custom Detection Rules offers a library of opt-in detections that target activity which might be routine in one environment but a sign of compromise in another. You can choose to enable these rules based on risks specific to your environment. To get the current list of available rules, use the [ListCustomDetectionRules](https://docs.aws.amazon.com/guardduty/latest/APIReference/API_ListCustomDetectionRules.html) API operation. For the finding types that each rule generates, see [Custom Detection Rules finding types](./findings-custom-detection-rules.html). @@ -38 +38 @@ The following image shows the rule details panel with the detection logic. -Custom Detection Rules use SQL conditions that evaluate AWS CloudTrail event fields. Some rules use specialized functions to inspect nested JSON structures within event fields like `requestParameters` and `responseElements`. The following table describes the functions that might appear in rule detection logic. +Custom Detection Rules use SQL conditions. AWS CloudTrail rules evaluate AWS CloudTrail event fields, and some use specialized functions to inspect nested JSON structures within event fields like `requestParameters` and `responseElements`. Runtime Monitoring rules evaluate runtime event fields, and many use regular expression functions, mainly to match process command lines. The following table describes the functions that might appear in rule detection logic. @@ -47,0 +48,6 @@ Function | Returns | Description +`RE2_FIND(input, pattern)` | Boolean | Returns true when the RE2 regular expression `pattern` matches any part of `input`. The match is case sensitive. Returns false when `input` is null. Runtime Monitoring rules use this function mainly to match process command lines. +`IRE2_FIND(input, pattern)` | Boolean | Same as `RE2_FIND`, but the match is not case sensitive. + +The GuardDuty security agent records a process's command-line arguments separated by null characters. Most Runtime Monitoring rules that match a command line first replace these separators with spaces, for example `RE2_FIND(REPLACE(process.cmd_line, '\u0000', ' '), pattern)`. + +The detection logic SQL for Runtime Monitoring rules is an approximation of how GuardDuty detects activity, not the exact logic.