Query Details

Conditional Access User Failures

Query

# CA Application SignIn Failures

## Query Information

#### MITRE ATT&CK Technique(s)

| Technique ID | Title    | Link    |
| ---  | --- | --- |
| T1078.004 | Valid Accounts: Cloud Accounts | https://attack.mitre.org/techniques/T1078/004/|

#### Description
This KQL query lists all users that trigger failed signin requests due to conditional access failures. This can indicate that a certain policy is not well configured and need to be changed in order for accounts to be able to access the application. On the other hand it can also be that the failed signins are valid credentials that adversaries have obtained and they are used to try and gain acces to certain applications in your environment. The CA policy will only block if the previous authentication requirements have already been met (e.g. username + password (+mfa)). It can be beneficial to understand why certain users trigger a large amount of CA policies, either their credentials are leaked/stolen or they do not follow the right procedures to access the cloud environment.

#### Risk
Adversaries have access to cloud credentials and are stopped due to CA policies.

#### References
- https://learn.microsoft.com/en-us/azure/active-directory/architecture/security-operations-consumer-accounts
- https://learn.microsoft.com/en-us/azure/active-directory/conditional-access/


## Sentinel
```KQL
SigninLogs
| where ResultType != 0
| where ResultDescription has "Conditional Access"
| summarize Total = count(), ResultTypes = make_set(ResultType), ResultDescriptions = make_set(ResultDescription) by UserPrincipalName
| sort by Total
```

Explanation

This query is used to identify users who have triggered failed sign-in requests due to conditional access failures. It helps to determine if there are any issues with the configuration of the conditional access policies or if adversaries are attempting to gain unauthorized access using valid credentials. The query provides information on the total number of failed sign-ins, the types of results, and the descriptions of the results for each user. The results are sorted by the total number of failed sign-ins.

Details

Bert-Jan Pals profile picture

Bert-Jan Pals

Released: October 22, 2023

Tables

SigninLogs

Keywords

SigninLogs,ResultType,ResultDescription,ConditionalAccess,Total,ResultTypes,ResultDescriptions,UserPrincipalName

Operators

where!=hassummarizecount()make_set()bysort by

Actions