onelogin_otp_brute_force_attack
Description
Detects a successful login after multiple failed OTP intents
Query · yara_l
events:
$failed_otp.metadata.event_type = "USER_RESOURCE_ACCESS"
$failed_otp.metadata.product_name = "ONELOGIN_SSO"
$failed_otp.metadata.vendor_name = "ONELOGIN"
$failed_otp.metadata.product_event_type = "1002" //failed otp challenge
$failed_otp.principal.user.userid = $userid
$success_otp.metadata.event_type = "USER_LOGIN"
$success_otp.metadata.product_name = "ONELOGIN_SSO"
$success_otp.metadata.vendor_name = "ONELOGIN"
$success_otp.metadata.product_event_type = "1400" //User verified otp device
$success_otp.principal.user.userid = $userid
$login.metadata.event_type = "USER_LOGIN"
$login.metadata.product_name = "ONELOGIN_SSO"
$login.metadata.vendor_name = "ONELOGIN"
$login.metadata.product_event_type = "5" //User logged into onelogin
$login.principal.user.userid = $userid
$failed_otp.metadata.event_timestamp.seconds <= $success_otp.metadata.event_timestamp.seconds
$success_otp.metadata.event_timestamp.seconds <= $login.metadata.event_timestamp.seconds
match:
$userid over 15m
outcome:
$risk_score = max(75)
$mitre_attack_tactic = "Credential Access"
$mitre_attack_technique = "Brute Force"
$target_user_agent = array_distinct($login.network.http.user_agent)
$principal_ip = array_distinct($login.principal.ip)
$principal_ip_country = array_distinct($login.principal.ip_geo_artifact.location.country_or_region)
$principal_ip_state = array_distinct($login.principal.ip_geo_artifact.location.state)
$principal_user_user_display_name = array_distinct($login.principal.user.user_display_name)
$target_user_userid = array_distinct($login.target.user.userid)
$otp_device_name = array_distinct($success_otp.additional.fields["otp_device_name"])
$otp_device_id = array_distinct($success_otp.principal.asset_id)
condition:
#failed_otp >= 4 and $success_otp and $login