o365_onedrive_anonymous_filedownload


Description

Anonymous links can be used to export files from OneDrive. While this isn't always a sign of malicious activity, some organizations do not support the use of anonymous links because of the risk of data leakage. This rule detects when anonymous links are used to download files from OneDrive.

Query · yara_l

events:
    $file.metadata.event_type = "USER_RESOURCE_UPDATE_CONTENT"
    $file.metadata.product_event_type = "FileDownloaded"
    $file.metadata.product_name = "Office 365"
    $file.metadata.vendor_name = "Microsoft"
    (
        $file.principal.user.userid = /^urn:spo:anon#/ or
        $file.principal.user.userid = "anonymous"
    )
    $file.principal.ip = $ip

  match:
    $ip over 5m

  outcome:
    $risk_score = 35
    $event_count = count_distinct($file.metadata.id)
    $referral_url = array_distinct($file.network.http.referral_url)
    $user_agent = array_distinct($file.network.http.user_agent)
    $principal_application = array_distinct($file.principal.application)
    $principal_ip = array_distinct($file.principal.ip)
    $target_application = array_distinct($file.target.application)
    $principal_user_userid = array_distinct($file.principal.user.userid)
    $src_file_full_path = array_distinct($file.src.file.full_path)
    $src_url = array_distinct($file.src.url)

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

  meta:
    author = "Google Cloud Security"
    description = "Anonymous links can be used to export files from OneDrive. While this isn't always a sign of malicious activity, some organizations do not support the use of anonymous links because of the risk of data leakage. This rule detects when anonymous links are used to download files from OneDrive."
    rule_id = "mr_f713e2b0-31b1-4165-8764-59a5e2c5eabb"
    rule_name = "O365 OneDrive Anonymous File Downloaded"
    tactic = "TA0010"
    technique = "T1048.002"
    type = "hunt"
    platform = "azure"
    data_source = "o365"
    severity = "Medium"
    priority = "Medium"

  events:
    $file.metadata.event_type = "USER_RESOURCE_UPDATE_CONTENT"
    $file.metadata.product_event_type = "FileDownloaded"
    $file.metadata.product_name = "Office 365"
    $file.metadata.vendor_name = "Microsoft"
    (
        $file.principal.user.userid = /^urn:spo:anon#/ or
        $file.principal.user.userid = "anonymous"
    )
    $file.principal.ip = $ip

  match:
    $ip over 5m

  outcome:
    $risk_score = 35
    $event_count = count_distinct($file.metadata.id)
    $referral_url = array_distinct($file.network.http.referral_url)
    $user_agent = array_distinct($file.network.http.user_agent)
    $principal_application = array_distinct($file.principal.application)
    $principal_ip = array_distinct($file.principal.ip)
    $target_application = array_distinct($file.target.application)
    $principal_user_userid = array_distinct($file.principal.user.userid)
    $src_file_full_path = array_distinct($file.src.file.full_path)
    $src_url = array_distinct($file.src.url)

  condition:
    $file
}

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.