Power Automate (formerly Microsoft Flow) is a low-code automation platform bundled into every Microsoft 365 licence. Any standard user can build a cloud flow that reads their mailbox, their SharePoint sites, and their OneDrive, and sends that data anywhere a connector reaches — Gmail, Dropbox, an arbitrary HTTP endpoint, an attacker-owned SMTP account. After a Business Email Compromise (BEC) or token-theft intrusion, a threat actor who cannot keep a malicious inbox rule alive (those are hunted — see SOP-85) instead builds a flow: it survives password resets, survives session revocation of the interactive account, runs server-side in the cloud with no endpoint footprint, and re-fires every time a new mail arrives or on a timer. This is living-off-the-cloud persistence and silent exfiltration in one object.
Key data sources: OfficeActivity (Workload MicrosoftFlow — CreateFlow, EditFlow, PutConnection, EditPermissions), CloudAppEvents (Power Platform / Defender for Cloud Apps activity), AuditLogs (Entra — consent grants, DLP-policy change, environment role grant), and EmailEvents (the auto-forward side-effect of a mail-trigger flow). Treat a flow built by a recently-compromised or risky account that connects a mailbox/SharePoint trigger to an external destination as a confirmed persistence + exfiltration event.
☰ Table of Contents
01 — BACKGROUND
TECHNIQUE OVERVIEWA cloud flow has three parts: a trigger (when a new email arrives, when a file is created in SharePoint, a recurrence timer), one or more connections (Office 365 Outlook, SharePoint, plus an output connector the attacker controls — HTTP, SMTP, Gmail, Dropbox, Azure Blob), and actions that move data between them. The entire object lives in the Power Platform cloud. There is no file on an endpoint to scan, no inbox rule in the mailbox to enumerate with Get-InboxRule, and the flow keeps running under the connection's stored refresh token even after the user's interactive sessions are revoked. That decoupling is exactly why actors reach for it after an account takeover.
Because flow operations are logged in the Microsoft 365 unified audit log (surfaced as the OfficeActivity table with Workload == "MicrosoftFlow"), detection is an audit-log problem, not an endpoint problem. The signal you are hunting is a CreateFlow / EditFlow event, paired with a PutConnection to an output connector, performed by an account that has other compromise indicators.
| Field | Value |
|---|---|
| MITRE Techniques | T1567 — Exfiltration Over Web Service T1114.003 — Email Collection: Email Forwarding Rule (flow-based auto-forward) T1098 — Account Manipulation (persistence via a service connection) T1648 — Serverless Execution (cloud flow as the execution host) |
| Kill-chain Phase | Collection, Exfiltration, Persistence (post-compromise) |
| Primary Log Source | OfficeActivity (Workload=MicrosoftFlow), CloudAppEvents |
| Secondary Log Sources | AuditLogs (consent / DLP change / role grant), EmailEvents (auto-forward), SigninLogs (preceding takeover) |
| Common Operations | CreateFlow, EditFlow, PutConnection, DeleteConnection, EditPermissions (share flow to a second account) |
| Default Severity | SEV2 on flow+external-connector by a non-maker; SEV1 once exfiltration or mail-forwarding is confirmed |
| Detection Window | Query last 24 hours for triage; extend to 7–30 days when scoping a confirmed BEC — flows are built days after the initial takeover |
A flow is NOT an inbox rule. Hunting Set-InboxRule / New-InboxRule (SOP-85) will NOT surface flow-based forwarding. If a user reports missing or silently copied mail and you find no inbox rule and no transport rule, the next place to look is Power Automate.
Five concrete paths a SOC actually sees. In every one the attacker already holds the account (phishing, AiTM token theft, password spray — see SOP-04 / SOP-18 / SOP-90) and uses the flow as the outcome, not the entry point.
| # | Attack Path |
|---|---|
| A | Silent mail exfiltration. Trigger = "When a new email arrives (V3)" on Office 365 Outlook → action = send a copy to an attacker Gmail/SMTP connector or POST the body + attachments to an HTTP endpoint. No inbox rule exists; mail still lands normally in the user's inbox so the victim notices nothing. |
| B | SharePoint / OneDrive data theft. Trigger = "When a file is created or modified" on a sensitive library → action = copy the file to an attacker-controlled Dropbox / Azure Blob / HTTP connector. Fires continuously as staff add documents. |
| C | Scheduled bulk pull. Recurrence trigger (e.g. hourly) → list + fetch all items in a mailbox folder or document library → batch them to external storage. Survives session revocation because it runs server-side on a timer. |
| D | Shared-flow persistence. Attacker builds the flow, then uses EditPermissions to add a second (also-compromised or newly-created) account as a co-owner, so removing the first account does not remove the flow. T1098 persistence. |
| E | DLP-policy weakening. A privileged attacker edits a Power Platform data-loss-prevention policy to move the HTTP / custom connector from "Blocked" to "Business", unblocking arbitrary outbound destinations before building the exfil flow. |
| Log Source | What it gives you |
|---|---|
| OfficeActivity (MicrosoftFlow) | CreateFlow / EditFlow / PutConnection / EditPermissions with actor UPN, client IP, flow display name |
| CloudAppEvents | Defender for Cloud Apps Power Platform activity, including connection creation to risky apps and governance alerts |
| AuditLogs (Entra) | OAuth consent to new connector app, Power Platform environment role grant, DLP policy change |
| EmailEvents | The downstream auto-forward / external-copy of mail created by a mail-trigger flow |
| SigninLogs | The preceding account takeover (risky sign-in, impossible travel, AiTM) that explains the flow |
| Severity | Signal |
|---|---|
| SEV3 / LOW | Flow created by a known maker/developer, internal connectors only, matches normal business automation |
| SEV2 / MEDIUM | Flow + external/HTTP connector by a non-maker, OR by an account with any recent risk signal — investigate now |
| SEV1 / HIGH | Confirmed mailbox/SharePoint trigger → external destination, OR confirmed data egress, OR flow built by an account with a confirmed takeover in the same window |
02 — IDENTIFICATION
6 INDICATORSAnswer these before running queries. Two or more YES = treat as SEV2 and proceed through I1–I6; any confirmed external trigger-to-destination flow = SEV1.
- 1Was the flow created or edited by an account with any risk signal in the last 7 days (risky sign-in, AiTM, password-spray hit, impossible travel)?
- 2Does the flow use an external output connector — HTTP, SMTP, Gmail, Dropbox, Box, Azure Blob, or a custom connector?
- 3Is the trigger a mailbox event ("When a new email arrives"), a SharePoint/OneDrive file event, or a recurrence timer over sensitive data?
- 4Was a new connection (PutConnection) created minutes before or after the flow, to a service the user has never used?
- 5Did the user build this themselves and acknowledge it — or do they have no idea the flow exists?
Call the user. One question settles most of these: "Did you build an automation in Power Automate that forwards or copies your email / files?" A blank "a what?" moves this straight to SEV2 and you stop treating it as a maker's legitimate automation.
The CreateFlow / EditFlow operation is the moment the persistence object is born. An actor who has taken over an account builds the flow hours-to-days later; correlating the flow's creator and client IP against known-bad sign-in data is the fastest route from "someone made a flow" to "the attacker made a flow".
- 1Open Microsoft Sentinel → Logs and run the KQL below against
OfficeActivity(WorkloadMicrosoftFlow). No Sentinel? Use purview.microsoft.com → Audit → Search, Activities = "Created flow / Edited flow". - 2For every hit note the UserId (creator UPN), ClientIP, and the flow display name in the
OfficeObjectId/ parameters. - 3Pivot each creator UPN into SigninLogs / AADUserRiskEvents for the same window — a risky or AiTM sign-in from the same IP is the confirming link (cross-ref SOP-04 / SOP-18).
- 4Inspect the flow in make.powerautomate.com → My flows (or admin view admin.powerplatform.microsoft.com → Environments → [env] → Resources → Flows) to read its trigger and actions.
| Operation / Field | Meaning | Severity |
|---|---|---|
| CreateFlow | A new cloud flow was created — persistence object born | INVESTIGATE |
| EditFlow | An existing flow was modified — trigger/action/destination may have been repointed | INVESTIGATE |
| EditPermissions | Flow shared to another owner — shared-flow persistence (path D) | HIGH |
| Workload = MicrosoftFlow | Confirms the event is a Power Automate operation in the unified audit log | CONTEXT |
| ClientIP = known-bad / VPN / foreign | Flow built from the same IP as a risky sign-in = confirmed actor action | HIGH |
A flow can only send data somewhere it has a connection. The PutConnection operation to an output connector the user has never touched — HTTP, SMTP, Gmail, Dropbox, Azure Blob — is the exfiltration channel being wired up. A connection created within minutes of a CreateFlow is the single highest-fidelity pairing in this SOP.
- 1Run the KQL below for
Operation == "PutConnection"and inspect the connector name / API id in the parameters. - 2Flag any connector that is an egress channel: HTTP, SMTP, Gmail, Outlook.com, Dropbox, Box, Google Drive, Azure Blob Storage, FTP, or a custom connector.
- 3In make.powerautomate.com → Connections (or admin → Environments → [env] → Resources → Connections) confirm the connection owner and the destination account/URL it authenticates to.
- 4Correlate the PutConnection timestamp with the CreateFlow from I1 — the two within a few minutes, by the same actor, is a confirmed exfil build.
| Connector / Field | Meaning | Severity |
|---|---|---|
| shared_webcontents / HTTP | Raw HTTP action — can POST mail body + attachments to any URL | CRITICAL |
| shared_smtp / shared_gmail | Outbound SMTP / Gmail — relays mail to an external mailbox | CRITICAL |
| shared_dropbox / shared_box / shared_googledrive | Third-party storage — SharePoint/OneDrive files copied out | CRITICAL |
| shared_azureblob | Azure Blob — attacker-owned storage account exfil target | HIGH |
| Custom connector (shared_customapi*) | Attacker-defined API — arbitrary destination, hardest to attribute | HIGH |
The OfficeActivity schema for MicrosoftFlow varies by tenant and connector parsing — the connector may land in Parameters, OfficeObjectId, or a nested field. If the above returns nothing, broaden to all PutConnection events for the suspect actor and read the connection by hand in make.powerautomate.com rather than assuming no egress connector exists.
A mail-trigger flow produces the same outcome as a malicious forwarding rule — copies of inbound mail leaving the org — but leaves NO inbox rule and NO transport rule to find. If you see external auto-forwarded mail for a user and SOP-85 hunting comes up empty, a flow is the forwarder. This is the distinguishing check that separates SOP-118 from SOP-85.
- 1Run the
EmailEventsKQL below to find external-bound mail from the suspect user, then confirm in purview.microsoft.com → Audit that no New-InboxRule / Set-InboxRule / Set-Mailbox ForwardingSmtpAddress exists for them (SOP-85 scope). - 2If external forwarding is happening with no rule present, that is the flow signature — the forward is executing in the cloud, not in the mailbox.
- 3Match the volume/timing of the forwarded mail against the flow's trigger (new-email) and the connection destination from I2.
- 4Note the external recipient address — it is a primary IOC and a block target for C4.
| Indicator | Meaning | Severity |
|---|---|---|
| External recip + no inbox rule | Mail leaving the org with no rule to explain it = flow-based forward | HIGH |
| Sent via Gmail/SMTP connector | Forwarded through a connector mailbox, not the user's own Send | HIGH |
| Steady 1:1 inbound→outbound | Every inbound mail mirrored out = new-email trigger firing | MEDIUM |
Well-configured tenants block the HTTP and custom connectors via a Power Platform DLP policy. A privileged attacker must first weaken that policy (path E) or grant themselves an environment-maker role before the exfil flow can reach an arbitrary destination. OAuth consent to a new connector app is the equivalent enabling step. These control-plane changes are rarer and higher-fidelity than the flow itself.
- 1Run the
AuditLogsKQL below for consent grants and Power Platform role/DLP changes in the window. - 2In admin.powerplatform.microsoft.com → Policies → Data policies, review recent edits — a connector moved from Blocked to Business is the smoking gun for path E.
- 3Check environment Security roles / Settings → Users + permissions for a newly-granted Environment Maker or System Administrator role on the account from I1.
- 4Any consent to a new connector / enterprise app by the suspect account should be cross-referenced with SOP-21 (OAuth consent grant attack).
| Operation / Field | Meaning | Severity |
|---|---|---|
| Update policy (DLP) / connector reclassified | HTTP/custom connector unblocked — opens arbitrary egress | CRITICAL |
| Add member to role (Env. Maker) | Attacker granted rights to build flows in a shared environment | HIGH |
| Consent to application | New connector/app granted delegated or app permissions | HIGH |
| Add OAuth2PermissionGrant | Delegated scope added to a connector app — data access path | MEDIUM |
A SharePoint/OneDrive-trigger or scheduled flow (paths B and C) pulls files at machine speed. CloudAppEvents / OfficeActivity will show a burst of FileAccessed / FileDownloaded / FileSyncDownloadedFull by the flow's service connection — far more files, faster, than a human. This both confirms active exfiltration (flips the incident to SEV1) and measures the data-at-risk for the timeline reconstruction.
- 1Run the CloudAppEvents KQL for file-access bursts by the suspect account/connection; sort by count per hour.
- 2In Defender for Cloud Apps Activity log, filter App = Microsoft SharePoint Online / OneDrive and User = suspect — look for a mass-download spike with an automation/user-agent fingerprint.
- 3Open the flow's Run history in make.powerautomate.com to count successful runs and the data each moved — this quantifies the exfiltration for escalation.
- 4Record the earliest successful run — that is the start of the data-at-risk window for the Section 04 timeline.
| Indicator | Meaning | Severity |
|---|---|---|
| FileSyncDownloadedFull burst | Bulk library pull by the flow connection — active exfil | CRITICAL |
| Access rate >> human baseline | Hundreds of files/hour = automated, not interactive | HIGH |
| Repeating runs on a timer | Recurrence-trigger flow (path C) — persistent pull | MEDIUM |
Pull these before escalating — they drive Containment and the block list:
- 1Flow identity — display name, flow GUID, environment, owner UPN, and any co-owners from EditPermissions.
- 2Connection targets — connector type and the external account/URL each authenticates to (the exfil destination).
- 3External recipients / endpoints — forwarding address, HTTP URL, storage account, Dropbox/Box account.
- 4Actor context — creator UPN, ClientIP(s), and the correlated risky sign-in / takeover from SigninLogs.
- 5Scope — first successful run time, run count, and data volume moved (data-at-risk).
| True-Positive Signals | False-Positive Signals |
|---|---|
| Flow built by an account with a confirmed/risky sign-in in the same window | Flow built by a known maker/developer during working hours from a trusted device |
| Mailbox/SharePoint trigger wired to an HTTP / SMTP / Gmail / Dropbox / Blob connector | All connectors internal (Office 365, Teams, Approvals, SharePoint-to-SharePoint) |
| User has no knowledge the flow exists | User confirms they built it and explains the business purpose |
| PutConnection to a never-before-used external service minutes around CreateFlow | Connection to a sanctioned SaaS already in use org-wide with DLP allowing it |
| External auto-forward with NO corresponding inbox/transport rule | Documented, ticketed automation (e.g. invoices to an approved partner) |
"It's just a Power Automate flow" is not an exoneration. A flow that reads a mailbox or a document library and writes to an external connector is functionally an exfiltration channel regardless of who clicked Save. Decide on trigger + destination + actor risk, never on the object type.
03 — CONTAINMENT
STOP ITTurn the flow OFF before you delete it. Deleting first destroys the trigger/action/connection detail you need for scoping. Disable stops the bleeding; export/screenshot the definition, then delete in Eradication.
- 1Locate the flow by GUID/name. Before any change, open it and export / screenshot the trigger, actions, and connection references for evidence.
- 2Set the flow to Turn off (not delete). This immediately stops it firing on new triggers and on the timer.
- 3Go to Resources → Connections, find the egress connection(s) from I2, and delete them — this invalidates the stored token the flow runs under even if it is re-enabled.
- 4If the flow was shared (EditPermissions / path D), note every co-owner — each must be investigated and the flow removed from all of them.
Deleting the connection is what actually severs exfiltration. A flow runs under the connection's refresh token, not the user's live session — so even after you reset the password and revoke sessions in C3, an orphaned connection could keep a timer-triggered flow alive until the token expires. Kill the connection.
- 1On the user blade click Revoke sessions to invalidate all refresh tokens, then Reset password (and require MFA re-registration if MFA methods were tampered — cross-ref SOP-80).
- 2If takeover is confirmed, Block sign-in until the account is fully cleaned, and review Conditional Access for the user.
- 3Review the account's OAuth app consents (Enterprise applications → User consent) and revoke any attacker-granted connector app (cross-ref SOP-21).
- 4If the flow was shared to a second account (path D), repeat identity containment for every co-owner before closing.
Resetting the password alone does NOT stop the flow — the flow runs on the connection token, not the interactive session. Identity containment (C3) and connection deletion (C2) are both required; neither alone is sufficient.
- 1Block the external forwarding recipient(s) and any attacker HTTP/storage domain in security.microsoft.com → Settings → Endpoints → Indicators and at the mail gateway / proxy / firewall.
- 2If mail was auto-forwarded externally, enumerate what left via message trace and, where the forward re-entered other inboxes, soft-delete it via Threat Explorer → Actions → Soft delete.
- 3If a DLP policy was weakened (path E), restore the HTTP / custom connector to Blocked in admin.powerplatform.microsoft.com → Policies → Data policies immediately — this re-closes the class, not just this flow.
- 4Add the attacker's external address / endpoint / storage account to the org block lists so a rebuilt flow cannot reuse the same destination.
04 — ERADICATION
CLEAN UP- 1After evidence is preserved, delete the flow and all its connections from every owner's environment. Confirm no duplicate/shared copy remains (re-run I1 for EditPermissions).
- 2Remove any attacker-created or elevated environment role, revoke the attacker connector app's consent, and confirm the DLP policy is back to its hardened baseline (reverse path D/E).
- 3Hunt for parallel persistence the same actor may have planted — malicious inbox/transport rules (SOP-85), mailbox delegation (SOP-111), OAuth grants (SOP-21), and additional flows under other compromised accounts.
- 4Re-run I1, I2, I3 and I5 scoped to the account and tenant — expected result is 0 new flow/connection operations, 0 unexplained external forwards, 0 file-access bursts.
- 5Reconstruct the timeline: initial takeover (SigninLogs) → flow created → first successful run → data moved → containment. Quantify the data-at-risk for notification decisions.
- 6Reset credentials for every affected account, review for lateral movement from the same IP/actor, and confirm all co-owner accounts are clean.
- The malicious flow and all its connections are deleted from every owner / environment
- The egress connection token is invalidated and the external destination is blocked
- Weakened DLP policy / elevated role / attacker consent is reversed to baseline
- Identity is reset, sessions revoked, MFA re-registered for all affected accounts
- Re-run of I1/I2/I3/I5 returns 0 hits across the account and tenant
- Timeline reconstructed and data-at-risk quantified for escalation / notification
05 — ESCALATION
TIERS| Tier | Trigger Condition | Who to Notify | Action |
|---|---|---|---|
| L1 → L2 | Flow + external connector that L1 cannot verdict in 30 min, OR actor is a privileged account, OR >1 account involved | SOC Lead / L2 Analyst | Disable flow, hand over IOCs + actor context |
| L2 → IR | Confirmed takeover + exfiltration flow, shared-flow persistence, or DLP policy tampering | Incident Response Team | Full identity reset, tenant-wide flow hunt, timeline |
| IR → CISO | Customer/regulated data confirmed exfiltrated (GDPR / PCI / HIPAA), or exec/privileged mailbox forwarded externally | CISO / Legal / Privacy | Breach assessment, notification decision, BCP |
| External | Confirmed data exfiltration requiring regulator / affected-party notification, or MSSP / forensics needed | MSSP, forensics vendor, regulator, law enforcement | Engage per legal guidance and retention of evidence |
Bring to every escalation:
- 1Incident / alert ID and current confidence (TP confirmed / suspected / unverified).
- 2Affected account(s) + any co-owners, the flow name/GUID/environment, and the external destination(s).
- 3Timeline: takeover → flow created → first run → data moved → containment actions taken.
- 4Data-at-risk estimate (mail volume forwarded, file count/size exfiltrated) and containment status.
| MITRE ATT&CK | Technique |
|---|---|
| T1567 | Exfiltration Over Web Service (flow → HTTP / storage connector) |
| T1114.003 | Email Collection: Email Forwarding Rule (flow-based auto-forward) |
| T1098 | Account Manipulation (persistence via service connection / shared flow) |
| T1648 | Serverless Execution (cloud flow as the execution host) |
A flow persists independently of the user's password and sessions. If you close the ticket after only resetting the account, the flow may still be running on its connection token. Escalate to IR for a tenant-wide flow hunt any time a confirmed takeover built even one flow — assume there may be more.
Stay Threat-Ready
Follow CyberHawk Threat Intel for daily SOC analyst playbooks, detection engineering guides, and threat intelligence.