o365_add_user_to_admin_role


Description

Adding users to administrative roles is not malicious, but due to the sensitivity of certain roles, validation should occur when this occurs

Query · yara_l

events:
    $app.metadata.event_type = "USER_UNCATEGORIZED"
    $app.metadata.product_event_type = "Add member to role."
    $app.metadata.product_name = "Office 365"
    $app.metadata.vendor_name = "Microsoft"
    $app.security_result.action = "ALLOW"
    $app.target.resource.attribute.roles.name in %msgraph_watchlist_roles
    $app.principal.user.userid = $userid

  match:
    $userid over 5m

  outcome:
    $risk_score = 65
    $event_count = count_distinct($app.metadata.id)
    $security_summary = array_distinct($app.security_result.summary)
    $user_agent = array_distinct($app.network.http.user_agent)
    $assigned_role = array_distinct($app.target.resource.attribute.roles.name)
    //added to populate alert graph with additional context
    //$principal_user_userid = array_distinct($app.principal.user.userid)
    $target_user_userid = array_distinct($app.target.user.userid)

  condition:
    $app
Raw source o365_add_user_to_admin_role · YARA-L
Esc
Published by chronicle/detection-rules ↗, licensed under Apache 2.0 ↗. Reproduced here unmodified.
rule o365_add_user_to_admin_role {

  meta:
    author = "Google Cloud Security"
    description = "Adding users to administrative roles is not malicious, but due to the sensitivity of certain roles, validation should occur when this occurs"
    rule_id = "mr_ee28c257-d2c7-490c-addf-aef35d07f29d"
    rule_name = "O365 Add User To Admin Role"
    assumption = "The list msgraph_watchlist_roles is populated with role names, example: Application Administrator"
    mitre_attack_tactic = "TA0003"
    mitre_attack_technique = "T1098.003"
    type = "alert"
    platform = "azure"
    data_source = "o365"
    severity = "Medium"
    priority = "Medium"

  events:
    $app.metadata.event_type = "USER_UNCATEGORIZED"
    $app.metadata.product_event_type = "Add member to role."
    $app.metadata.product_name = "Office 365"
    $app.metadata.vendor_name = "Microsoft"
    $app.security_result.action = "ALLOW"
    $app.target.resource.attribute.roles.name in %msgraph_watchlist_roles
    $app.principal.user.userid = $userid

  match:
    $userid over 5m

  outcome:
    $risk_score = 65
    $event_count = count_distinct($app.metadata.id)
    $security_summary = array_distinct($app.security_result.summary)
    $user_agent = array_distinct($app.network.http.user_agent)
    $assigned_role = array_distinct($app.target.resource.attribute.roles.name)
    //added to populate alert graph with additional context
    //$principal_user_userid = array_distinct($app.principal.user.userid)
    $target_user_userid = array_distinct($app.target.user.userid)

  condition:
    $app
}

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.