$e.security_result.detection_fields.value = /SocRole:.*/ . but it doesnt detect any logs
Can you please help me to correct this issue?
Thanks in advance!🙂
Best answer by NastyaS
Unfortunately Lookahead or Lookbehinds aren't supported in re2 as far as I am aware. However the alternative is to match and group values. I don't have the data required to test the logic of the rule, however it should work. - https://regex101.com/r/riJNQ4/1
rule soar_user_creation_admin {
meta:
author ="NastyaS"
description ="The rule detects a suspicious admin account creation"
$SocRole=re.capture($e.security_result.detection_fields.value,(`\\\\"SocRole\\\\":\\\\s\\\\"([^\\\\]+)`))// Splits SocRole Value
$PermissionGroup=re.capture($e.security_result.detection_fields.value,(`\\\\"PermissionGroup\\\\":\\\\s\\\\"([^\\\\]+)`))// Splits PermissionGroup Value
Google Chronicle utilizes re2, which doesn't support Lookbehind, which will be partly the reason for the error "literal is not terminated".
Can you share the full rule, as well as the udm key field you want to match for the security_result.detection_fields field. As well as some values that you want to have matched, and values you don't want matched!
Google Chronicle utilizes re2, which doesn't support Lookbehind, which will be partly the reason for the error "literal is not terminated".
Can you share the full rule, as well as the udm key field you want to match for the security_result.detection_fields field. As well as some values that you want to have matched, and values you don't want matched!
Hi Ayman,
Thank you for reply.
And does re2 support Lookahead?
Sure, here is the full rule:
rule soar_user_creation_admin {
meta:
author ="NastyaS"
description ="The rule detects a suspicious admin account creation"
Unfortunately Lookahead or Lookbehinds aren't supported in re2 as far as I am aware. However the alternative is to match and group values. I don't have the data required to test the logic of the rule, however it should work. - https://regex101.com/r/riJNQ4/1
rule soar_user_creation_admin {
meta:
author ="NastyaS"
description ="The rule detects a suspicious admin account creation"
$SocRole=re.capture($e.security_result.detection_fields.value,(`\\\\"SocRole\\\\":\\\\s\\\\"([^\\\\]+)`))// Splits SocRole Value
$PermissionGroup=re.capture($e.security_result.detection_fields.value,(`\\\\"PermissionGroup\\\\":\\\\s\\\\"([^\\\\]+)`))// Splits PermissionGroup Value
Unfortunately Lookahead or Lookbehinds aren't supported in re2 as far as I am aware. However the alternative is to match and group values. I don't have the data required to test the logic of the rule, however it should work. - https://regex101.com/r/riJNQ4/1
rule soar_user_creation_admin {
meta:
author ="NastyaS"
description ="The rule detects a suspicious admin account creation"
$SocRole=re.capture($e.security_result.detection_fields.value,(`\\\\"SocRole\\\\":\\\\s\\\\"([^\\\\]+)`))// Splits SocRole Value
$PermissionGroup=re.capture($e.security_result.detection_fields.value,(`\\\\"PermissionGroup\\\\":\\\\s\\\\"([^\\\\]+)`))// Splits PermissionGroup Value
Very difficult to know for certain the proposed solution I gave would work, without having the trial data to see, however the same POC worked for an alternative rule idea.