Detection rules › YARA-L

YARA-L rules: 0o

AWS Unusual Number Of Failed Authentication Attempts From The Same IP

#
Severity
medium
Type
Alert
Time window
5m
Match by
ip
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detects unusual number of failed authentications from the same IP for valid users.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rule Body

// Copyright 2023 Google LLC. Licensed under Apache-2.0.

rule aws_unusual_number_of_failed_authentications_from_the_same_ip {

  meta:
    author = "Google Cloud Security"
    description = "Detects unusual number of failed authentications from the same IP for valid users."
    rule_id = "mr_cf1787a4-0145-4093-ad35-2de17f1980ce"
    rule_name = "AWS Unusual Number Of Failed Authentication Attempts From The Same IP"
    mitre_attack_tactic = "Credential Access"
    mitre_attack_technique = "Brute Force: Credential Stuffing"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1110/004/"
    mitre_attack_version = "v13.1"
    type = "Alert"
    data_source = "AWS CloudTrail"
    platform = "AWS"
    severity = "Medium"
    priority = "Medium"

  events:
    $fail.metadata.vendor_name = "AMAZON"
    $fail.metadata.product_name = "AWS CloudTrail"
    $fail.metadata.event_type = "USER_LOGIN"
    $fail.metadata.product_event_type = "ConsoleLogin"
    $fail.security_result.action = "BLOCK"
    $fail.security_result.description = "Reason: Failed authentication"
    $fail.principal.ip = $ip

  match:
    $ip over 5m

  outcome:
    $risk_score = max(
        // Unauthorized geographies
        if($fail.principal.ip_geo_artifact.location.country_or_region = "Cuba", 40) +
        if($fail.principal.ip_geo_artifact.location.country_or_region = "Iran", 40) +
        if($fail.principal.ip_geo_artifact.location.country_or_region = "North Korea" , 40) +
        if($fail.principal.ip_geo_artifact.location.country_or_region = "Russia", 40) +
        if($fail.principal.ip_geo_artifact.location.country_or_region = "Syria", 40)
    )
    $mitre_attack_tactic = "Credential Access"
    $mitre_attack_technique = "Brute Force: Credential Stuffing"
    $mitre_attack_technique_id = "T1110.004"
    $event_count = count_distinct($fail.metadata.id)
    $network_http_user_agent = array_distinct($fail.network.http.user_agent)
    $principal_ip = array_distinct($fail.principal.ip)
    $principal_ip_country = array_distinct($fail.principal.ip_geo_artifact.location.country_or_region)
    $principal_ip_state = array_distinct($fail.principal.ip_geo_artifact.location.state)
    $principal_user_display_name = array_distinct($fail.principal.user.user_display_name)
    $dc_target_user_display_name = count_distinct($fail.target.user.user_display_name)
    $is_mfa_used = array_distinct($fail.extensions.auth.auth_details)
    $target_resource_name = array_distinct($fail.target.resource.name)
    $target_resource_product_object_id = array_distinct($fail.target.resource.product_object_id)

  condition:
    $fail and $dc_target_user_display_name > 5
}

YARA-L Rule Structure

Condition

Fires when at least one $fail event in the 5m window and $dc_target_user_display_name > 5.

Events

$fail USER_LOGIN

  • metadata.product_event_type = "ConsoleLogin"
  • security_result.action = "BLOCK"
  • security_result.description = "Reason: Failed authentication"

Match and Correlation

Match key
$ip (principal.ip)
Within
5m

Outcome

Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.

FieldExpression
risk_scoremax( if($fail.principal.ip_geo_artifact.location.country_or_region = "Cuba", 40) + if($fail.principal.ip_geo_artifact.location.country_or_region = "Iran", 40) + if($fail.principal.ip_geo_artifact.location.country_or_region = "North Korea" , 40) + if($fail.principal.ip_geo_artifact.location.country_or_region = "Russia", 40) + if($fail.principal.ip_geo_artifact.location.country_or_region = "Syria", 40) )
event_countcount_distinct($fail.metadata.id)
network_http_user_agentarray_distinct($fail.network.http.user_agent)
principal_iparray_distinct($fail.principal.ip)
principal_ip_countryarray_distinct($fail.principal.ip_geo_artifact.location.country_or_region)
principal_ip_statearray_distinct($fail.principal.ip_geo_artifact.location.state)
principal_user_display_namearray_distinct($fail.principal.user.user_display_name)
dc_target_user_display_namecount_distinct($fail.target.user.user_display_name)
is_mfa_usedarray_distinct($fail.extensions.auth.auth_details)
target_resource_namearray_distinct($fail.target.resource.name)
target_resource_product_object_idarray_distinct($fail.target.resource.product_object_id)

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.

Telemetry Coverage

PlatformRecord / event type
AzureDelete group

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

// Copyright 2025 Google LLC. Licensed under Apache-2.0.

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
}

YARA-L Rule Structure

Condition

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"

Match and Correlation

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

Outcome

Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.

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)

GCTI Benign Binaries Contacts Tor Exit Node

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

Alert on Benign Binary contacting a TOR IP

MITRE ATT&CK Coverage

TacticTechniques
Command & Control

Telemetry Coverage

Rule Body

// Copyright 2023 Google LLC. Licensed under Apache-2.0.

rule gcti_benign_binaries_contacts_tor_exit_node {

  meta:
    author = "Google Cloud Security"
    description = "Alert on Benign Binary contacting a TOR IP"
    rule_id = "mr_8bb13cf7-d66b-41f2-9bbc-0a1884a77f70"
    rule_name = "GCTI Benign Binaries Contacts Tor Exit Node"
    tactic = "TA0011"
    technique = "T1090.003"
    type = "alert"
    tags = "tor, benign binaries"
    data_source = "crowdstrike"
    severity = "High"
    priority = "High"

  events:
    $network.metadata.event_type = "NETWORK_CONNECTION"
    $network.principal.process.file.sha256 = $benign_hash
    $network.target.ip = $ip

    // Benign Files provided by GCTI Feed
    $gcti_feed.graph.entity.file.sha256 = $benign_hash
    $gcti_feed.graph.metadata.vendor_name = "Google Cloud Threat Intelligence"
    $gcti_feed.graph.metadata.product_name = "GCTI Feed"
    $gcti_feed.graph.metadata.entity_type = "FILE"
    $gcti_feed.graph.metadata.threat.threat_feed_name = "Benign Binaries"
    $gcti_feed.graph.metadata.source_type = "GLOBAL_CONTEXT"

    // Tor IP listing provided by GCTI Feed
    $tor.graph.entity.artifact.ip = $ip
    $tor.graph.metadata.entity_type = "IP_ADDRESS"
    $tor.graph.metadata.threat.threat_feed_name = "Tor Exit Nodes"
    $tor.graph.metadata.vendor_name = "Google Cloud Threat Intelligence"
    $tor.graph.metadata.product_name = "GCTI Feed"
    $tor.graph.metadata.source_type = "GLOBAL_CONTEXT"

  match:
    $ip over 5m

  outcome:
    $risk_score = max(
        if($tor.graph.metadata.threat.confidence = "HIGH_CONFIDENCE", 70) +
        // Unauthorized target geographies
        if($network.target.ip_geo_artifact.location.country_or_region = "Cuba", 20) +
        if($network.target.ip_geo_artifact.location.country_or_region = "Iran", 20) +
        if($network.target.ip_geo_artifact.location.country_or_region = "North Korea", 20) +
        if($network.target.ip_geo_artifact.location.country_or_region = "Russia", 20) +
        if($network.target.ip_geo_artifact.location.country_or_region = "Syria", 20)
    )
    $event_count = count_distinct($network.metadata.id)
    $tor_ip_country = array_distinct($network.target.ip_geo_artifact.location.country_or_region)
    // added to populate alert graph with additional context
    $principal_ip = array_distinct($network.principal.ip)
    // Commented out target.ip because it is already represented in graph as match variable. If match changes, can uncomment to add to results
    //$target_ip = array_distinct($network.target.ip)
    $principal_process_pid = array_distinct($network.principal.process.pid)
    $principal_process_command_line = array_distinct($network.principal.process.command_line)
    $principal_process_file_sha256 = array_distinct($network.principal.process.file.sha256)
    $principal_process_file_full_path = array_distinct($network.principal.process.file.full_path)
    $principal_process_product_specific_process_id = array_distinct($network.principal.process.product_specific_process_id)
    $principal_process_parent_process_product_specific_process_id = array_distinct($network.principal.process.parent_process.product_specific_process_id)
    $target_process_pid = array_distinct($network.target.process.pid)
    $target_process_command_line = array_distinct($network.target.process.command_line)
    $target_process_file_sha256 = array_distinct($network.target.process.file.sha256)
    $target_process_file_full_path = array_distinct($network.target.process.file.full_path)
    $target_process_product_specific_process_id = array_distinct($network.target.process.product_specific_process_id)
    //$target_process_parent_process_product_specific_process_id = array_distinct($network.target.process.parent_process.product_specific_process_id)
    $principal_user_userid = array_distinct($network.principal.user.userid)
    $target_user_userid = array_distinct($network.target.user.userid)

  condition:
    $network and $gcti_feed and $tor
}

YARA-L Rule Structure

Condition

Fires when at least one $network event in the 5m window and $gcti_feed matches entity context and $tor matches entity context.

Events

$gcti_feed entity context (FILE)

  • graph.metadata.vendor_name = "Google Cloud Threat Intelligence"
  • graph.metadata.product_name = "GCTI Feed"
  • graph.metadata.entity_type = "FILE"
  • graph.metadata.threat.threat_feed_name = "Benign Binaries"
  • graph.metadata.source_type = "GLOBAL_CONTEXT"

$network NETWORK_CONNECTION (3, 5156)

No field filters (binds the event for correlation only).

$tor entity context (IP_ADDRESS)

  • graph.metadata.entity_type = "IP_ADDRESS"
  • graph.metadata.threat.threat_feed_name = "Tor Exit Nodes"
  • graph.metadata.vendor_name = "Google Cloud Threat Intelligence"
  • graph.metadata.product_name = "GCTI Feed"
  • graph.metadata.source_type = "GLOBAL_CONTEXT"

Match and Correlation

Match key
$ip (target.ip)
Within
5m

Outcome

Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.

FieldExpression
risk_scoremax( if($tor.graph.metadata.threat.confidence = "HIGH_CONFIDENCE", 70) + if($network.target.ip_geo_artifact.location.country_or_region = "Cuba", 20) + if($network.target.ip_geo_artifact.location.country_or_region = "Iran", 20) + if($network.target.ip_geo_artifact.location.country_or_region = "North Korea", 20) + if($network.target.ip_geo_artifact.location.country_or_region = "Russia", 20) + if($network.target.ip_geo_artifact.location.country_or_region = "Syria", 20) )
event_countcount_distinct($network.metadata.id)
tor_ip_countryarray_distinct($network.target.ip_geo_artifact.location.country_or_region)
principal_iparray_distinct($network.principal.ip)
principal_process_pidarray_distinct($network.principal.process.pid)
principal_process_command_linearray_distinct($network.principal.process.command_line)
principal_process_file_sha256array_distinct($network.principal.process.file.sha256)
principal_process_file_full_patharray_distinct($network.principal.process.file.full_path)
principal_process_product_specific_process_idarray_distinct($network.principal.process.product_specific_process_id)
principal_process_parent_process_product_specific_process_idarray_distinct($network.principal.process.parent_process.product_specific_process_id)
target_process_pidarray_distinct($network.target.process.pid)
target_process_command_linearray_distinct($network.target.process.command_line)
target_process_file_sha256array_distinct($network.target.process.file.sha256)
target_process_file_full_patharray_distinct($network.target.process.file.full_path)
target_process_product_specific_process_idarray_distinct($network.target.process.product_specific_process_id)
principal_user_useridarray_distinct($network.principal.user.userid)
target_user_useridarray_distinct($network.target.user.userid)

OneLogin User Authentication Factor Removed

#
Severity
high
Type
Alert
Author
Google Cloud Security
Source
github.com/chronicle/detection-rules

Detects when a user removes an authentication factor or otp device.

MITRE ATT&CK Coverage

References

Rule Body

// Copyright 2024 Google LLC. Licensed under Apache-2.0.

rule onelogin_user_authentication_factor_removed {

  meta:
    author = "Google Cloud Security"
    description = "Detects when a user removes an authentication factor or otp device."
    rule_id = "mr_1b251f11-1699-4707-9027-a279dea7d47e"
    rule_name = "OneLogin User Authentication Factor Removed"
    reference = "https://onelogin.service-now.com/kb_view_customer.do?sysparm_article=KB0010426"
    mitre_attack_tactic = "Defense Evasion"
    mitre_attack_technique = "Modify Authentication Process: Multi-Factor Authentication"
    mitre_attack_url = "https://attack.mitre.org/techniques/T1556/006/"
    mitre_attack_version = "v15.1"
    type = "Alert"
    data_source = "OneLogin"
    severity = "High"
    priority = "High"

  events:
     $user.metadata.event_type = "USER_RESOURCE_ACCESS"
     $user.metadata.product_name = "ONELOGIN_SSO"
     $user.metadata.vendor_name = "ONELOGIN"
     $user.metadata.product_event_type = "24" //otp_device deregistered for user

  outcome:
    $risk_score = max(75)
    $mitre_attack_tactic = "Defense Evasion"
    $mitre_attack_technique = "Modify Authentication Process: Multi-Factor Authentication"
    $principal_user_userid = array_distinct($user.principal.user.userid)
    $principal_user_user_display_name = array_distinct($user.principal.user.user_display_name)
    $principal_user_email_addresses = array_distinct($user.principal.user.email_addresses)
    $principal_ip = array_distinct($user.principal.ip)
    $principal_ip_country = array_distinct($user.principal.ip_geo_artifact.location.country_or_region)
    $principal_ip_state = array_distinct($user.principal.ip_geo_artifact.location.state)
    $target_user_userid = array_distinct($user.target.user.userid)
    $otp_device_name = array_distinct($user.additional.fields["otp_device_name"])

  condition:
    $user
}

YARA-L Rule Structure

Condition

Fires when at least one $user event.

Events

$user USER_RESOURCE_ACCESS

  • metadata.product_event_type = "24"

Outcome

Outcome variables add context to a detection. When the rule generates an alert, $risk_score is displayed with it.

FieldExpression
risk_scoremax(75)
principal_user_useridarray_distinct($user.principal.user.userid)
principal_user_user_display_namearray_distinct($user.principal.user.user_display_name)
principal_user_email_addressesarray_distinct($user.principal.user.email_addresses)
principal_iparray_distinct($user.principal.ip)
principal_ip_countryarray_distinct($user.principal.ip_geo_artifact.location.country_or_region)
principal_ip_statearray_distinct($user.principal.ip_geo_artifact.location.state)
target_user_useridarray_distinct($user.target.user.userid)
otp_device_namearray_distinct($user.additional.fields["otp_device_name"])

Back to all YARA-L rules