Detection rules › YARA-L

Entra ID Successful Group Deletion

Severity
low
Type
alert
Time window
5m
Match by
user
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detects when a group is deleted.

Event coverage

Rule body yaral

/*
 * Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

rule entra_id_group_deletion_success {

  meta:
    author = "Google Cloud Security"
    description = "Detects when a group is deleted."
    rule_id = "mr_d6a3162a-3ec5-45c1-a7cd-ff2988582924"
    rule_name = "Entra ID Successful Group Deletion"
    type = "alert"
    platform = "azure"
    data_source = "azure ad audit"
    severity = "Low"
    priority = "Low"

  events:
    $group.metadata.event_type = "GROUP_DELETION"
    $group.metadata.product_event_type = "Delete group"
    $group.metadata.product_name = "Azure AD Directory Audit"
    $group.metadata.vendor_name = "Microsoft"
    $group.security_result.action = "ALLOW"
    $group.principal.user.userid = $user

  match:
    $user over 5m

  outcome:
    $risk_score = 35
    $event_count = count_distinct($group.metadata.id)
    $user_agent = array_distinct($group.network.http.user_agent)
    $principal_ip = array_distinct($group.principal.ip)
    $principal_user_userid = array_distinct($group.principal.user.email_addresses)
    $group_name = array_distinct($group.target.resource.name)
    $group_guid = array_distinct($group.target.resource.product_object_id)

  condition:
    $group
}

Detection logic

Fires when at least one $group event in the 5m window.

Events

$group GROUP_DELETION

  • metadata.product_event_type = "Delete group"
  • security_result.action = "ALLOW"

Correlation

Match key
$user (principal.user.userid)
Within
5m

Outcome

Fields the detection emits on a match. $risk_score drives alerting; Chronicle surfaces the rest on the detection.

FieldExpression
risk_score35
event_countcount_distinct($group.metadata.id)
user_agentarray_distinct($group.network.http.user_agent)
principal_iparray_distinct($group.principal.ip)
principal_user_useridarray_distinct($group.principal.user.email_addresses)
group_namearray_distinct($group.target.resource.name)
group_guidarray_distinct($group.target.resource.product_object_id)