Lesson 137 — The Sign-In Was Successful but the Session Wasn't Normal
The account signed in successfully.
MFA was satisfied. Conditional Access did not block the request. The application was familiar. If the investigation stopped at authentication, the event might look harmless.
But authentication is only the doorway. What matters next is what the identity actually did after it got inside. In this lesson we take the successful sign-in context from Microsoft Entra and then move into CloudAppEvents to investigate post-authentication activity across Microsoft 365 and connected cloud applications.

What you will investigate
A successful sign-in followed by cloud activity that does not fit the user's normal behaviour.
The investigation begins
Learning objectives
Use sign-in context to anchor an investigation, then hunt post-authentication activity in CloudAppEvents, compare the user's normal application/action profile, inspect uncommon-user enrichment and reconstruct what the identity did after authentication.
Why this does not duplicate Lesson 131
Lesson 131 investigated whether the sign-in itself made sense for the identity. Lesson 137 assumes the authentication succeeded and asks a different question: what did the authenticated session do next?
Step 1 — anchor the investigation on the successful sign-in
Start in SigninLogs. Capture the successful event's time, source, application, resource, device and access-control context. This gives us the doorway into the session.
let TargetUser = "alex.wilson@contoso.com"; SigninLogs | where TimeGenerated > ago(24h) | where UserPrincipalName =~ TargetUser | where ResultType == "0" | project TimeGenerated, UserPrincipalName, AppDisplayName, ResourceDisplayName, IPAddress, Location, ClientAppUsed, ConditionalAccessStatus, AuthenticationRequirement, DeviceDetail, CorrelationId | order by TimeGenerated desc
Keep the timestamp
The exact sign-in time is crucial because the next stage of the investigation is temporal. We want to know what cloud activity begins immediately after authentication and whether it uses the same or related source context.
Successful authentication is not a behavioural verdict
A legitimate authentication flow can still lead into malicious activity if credentials, tokens or sessions are abused. Treat success as a fact about authentication, not as proof of benign behaviour.
Step 2 — move into CloudAppEvents
CloudAppEvents contains activity involving accounts and objects in Office 365 and other cloud applications connected through Microsoft Defender for Cloud Apps. Use it to see what the identity did after authentication.
let TargetUser = "alex.wilson@contoso.com"; CloudAppEvents | where Timestamp > ago(24h) | where AccountId =~ TargetUser or AccountDisplayName =~ TargetUser | project Timestamp, Application, ActionType, ActivityType, ObjectName, ObjectType, IPAddress, CountryCode, City, UserAgent | order by Timestamp asc
Important environment note
SigninLogs is commonly queried in Log Analytics or Sentinel, while CloudAppEvents is part of Microsoft Defender XDR advanced hunting. Treat the timestamp and identity as your pivots unless your environment has brought the relevant data into a common hunting surface.
CloudAppEvents requires data
The table depends on Microsoft Defender for Cloud Apps and connected cloud application activity. If the service or Microsoft 365 activities are not connected, the table may be empty or unavailable.
Step 3 — establish the user's normal application and action profile
A session becomes interesting when its actions differ from what the user normally does. Summarize the last seven days by application and action type.
let TargetUser = "alex.wilson@contoso.com"; CloudAppEvents | where Timestamp > ago(7d) | where AccountId =~ TargetUser or AccountDisplayName =~ TargetUser | summarize ActivityCount=count(), FirstSeen=min(Timestamp), LastSeen=max(Timestamp) by Application, ActionType | order by ActivityCount desc
Normal behaviour is personal
A finance user may regularly export reports. A security administrator may perform privileged operations. A user who normally reads email and documents but suddenly performs rare administrative or bulk actions deserves a different level of scrutiny.
Application alone is not enough
A familiar application can contain unfamiliar behaviour. Seeing “SharePoint” or “Exchange Online” does not tell you whether the activity inside that application was normal for the identity.
Step 4 — use uncommon-user enrichment
Microsoft Defender for Cloud Apps can enrich events with UncommonForUser and LastSeenForUser. These fields can help identify attributes that are unusual for the account.
let TargetUser = "alex.wilson@contoso.com"; CloudAppEvents | where Timestamp > ago(7d) | where AccountId =~ TargetUser or AccountDisplayName =~ TargetUser | where tostring(UncommonForUser) != "" | project Timestamp, Application, ActionType, IPAddress, CountryCode, City, UncommonForUser, LastSeenForUser | order by Timestamp desc
What UncommonForUser means
The field lists event attributes that Defender for Cloud Apps considers uncommon for the user. It is an investigative accelerator, not an automatic malicious classification.
What LastSeenForUser adds
LastSeenForUser can indicate how recently a specific attribute was seen for the identity. A negative value can indicate an attribute being seen for the first time, while positive values represent days since it was last observed.
Step 5 — look for bursts of post-authentication activity
Attackers often move quickly once they have access. Group cloud activity into short windows and count both the volume and variety of actions.
let TargetUser = "alex.wilson@contoso.com"; CloudAppEvents | where Timestamp > ago(24h) | where AccountId =~ TargetUser or AccountDisplayName =~ TargetUser | summarize ActivityCount=count(), ActionCount=dcount(ActionType), Apps=make_set(Application, 20), Actions=make_set(ActionType, 30), Countries=make_set(CountryCode, 10) by bin(Timestamp, 15m), IPAddress | order by Timestamp asc
Volume can be a clue
A sudden burst of many actions across multiple applications can be interesting, especially if the user's normal behaviour is quiet. But bulk legitimate work, automation and administrative tools can produce similar patterns.
Variety matters too
One repetitive action may be automation. A rapid sequence of mailbox, file, sharing and administrative activity can tell a different story. Count action diversity as well as raw event volume.
Step 6 — build the post-authentication timeline
Now lay the cloud activity out chronologically and keep the network, user-agent and anomaly-enrichment fields beside each action.
let TargetUser = "alex.wilson@contoso.com"; CloudAppEvents | where Timestamp > ago(24h) | where AccountId =~ TargetUser or AccountDisplayName =~ TargetUser | project Timestamp, Application, ActionType, ActivityType, ObjectName, ObjectType, IPAddress, CountryCode, City, Isp, UserAgent, IsAdminOperation, IsAnonymousProxy, UncommonForUser, LastSeenForUser | order by Timestamp asc
Compare source continuity
If the post-authentication activity uses the same IP or expected source as the sign-in, that is useful context. If the cloud activity suddenly appears from another country, proxy or unfamiliar client, the session deserves deeper investigation.
Look at the objects
ObjectName, ObjectType and activity fields can reveal whether the account touched files, folders or other resources that do not match its normal work. Behaviour becomes easier to explain when you know what was acted upon.
Evidence table
| Observation | What it supports | What it does not prove |
|---|---|---|
| Successful sign-in | The authentication completed successfully. | That the subsequent session is benign. |
| Familiar application | The user accessed an application they have used before. | That the actions inside it were normal. |
| UncommonForUser populated | Some event attributes are unusual for the identity. | That the event is malicious. |
| First-seen attribute | An attribute has not previously been observed for the user in the enrichment history. | That an attacker introduced it. |
| High activity burst | Many cloud actions occurred in a short window. | That automation or bulk legitimate work is impossible. |
| New source or user agent after sign-in | The session context differs from earlier observed activity. | That session hijacking is confirmed without corroboration. |
Agent Foskett's investigation
Investigation questions to ask next
- What exact cloud actions occurred after the sign-in?
- Were those actions normal for this user and application?
- Did the account touch unusual files, folders or other objects?
- Were any activities marked uncommon for the user?
- Did the IP address, country, ISP or user agent change after authentication?
- Did the session perform administrative operations?
- Did activity volume or action diversity suddenly increase?
- Were sharing, download, mailbox or permission changes involved?
- Did the same session affect other identities or resources?
- Should sessions be revoked while the investigation continues?
Lesson 137 key takeaways
- A successful sign-in is the beginning of a session, not the end of an investigation.
- Use
SigninLogsto anchor the authentication context. - Use
CloudAppEventsto investigate post-authentication cloud behaviour where available. - Cloud application activity should be compared with the user's own baseline.
- Familiar applications can still contain abnormal actions.
UncommonForUserandLastSeenForUsercan accelerate anomaly investigation.- Short bursts and diverse actions can reveal suspicious session behaviour.
- Network and user-agent continuity help test whether the session remains consistent.
- CloudAppEvents availability depends on Defender for Cloud Apps and connected activity sources.
- The most useful question after successful authentication is often: what happened next?
Continue your KQL investigation training
Related Agent Foskett Investigations
🔎 KQL Academy — Module 11: Identity Threat Hunting
Investigate abnormal post-authentication sessions with KQL
Lesson 137 of the Agent Foskett KQL Academy teaches analysts how to anchor a successful Microsoft Entra sign-in with SigninLogs and then investigate post-authentication cloud behaviour using Microsoft Defender XDR CloudAppEvents.
CloudAppEvents identity investigation in Microsoft Defender XDR
CloudAppEvents provides activity involving accounts and objects in Microsoft 365 and other connected cloud applications. Analysts can use application, action, object, source, user-agent and uncommon-user enrichment to determine whether an authenticated session still fits the legitimate identity.
