o365_onedrive_anonymous_link_created_updated
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 creation of anonymous links because of the risk of data leakage. This rule detects the creation or modification of anonymous links in OneDrive.
Query · yara_l
events:
(
(
$file.metadata.event_type = "USER_RESOURCE_CREATION" and
$file.metadata.product_event_type = "AnonymousLinkCreated"
)
or
(
$file.metadata.event_type = "STATUS_UPDATE" and
$file.metadata.product_event_type = "AnonymousLinkUpdated"
)
)
$file.metadata.product_name = "Office 365"
$file.metadata.vendor_name = "Microsoft"
$file.principal.user.userid = $user
match:
$user 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)
//The IP address for creation is a Microsoft IP address while update is the system making the change
$principal_ip = array_distinct($file.principal.ip)
$target_application = array_distinct($file.target.application)
$principal_user_userid = array_distinct($file.principal.user.userid)
$target_file_full_path = array_distinct($file.target.file.full_path)
$target_url = array_distinct($file.target.url)
condition:
$file