Join our Newsletter — 33% off our NHI Course
Home› Guides› Controlled Folder Access Guide: Ransomware Protection for Protected…
Guide Endpoint Security

Controlled Folder Access Guide: Ransomware Protection for Protected Folders and Allowed Apps

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 13 min read
On this page

Ransomware does its damage by rewriting files, and Controlled Folder Access (CFA) in Microsoft Defender Antivirus stops untrusted processes from changing files in the folders you choose to protect. This guide explains what CFA protects by default, how trust decisions for allowed apps work, and how to move from Audit Mode to Block mode without breaking line-of-business software. It covers deployment through Intune, Group Policy, the Policy CSP and PowerShell, the Windows events and advanced hunting data you need to monitor it, and where CFA sits next to attack surface reduction (ASR) rules and backups. It is written for endpoint administrators and Windows security engineers who own Defender policy.

This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.

Key takeaways

  • CFA is a write gate, not a detector. Only trusted apps may modify or delete files in protected folders or write to disk boot sectors; everything else is blocked (or logged in Audit Mode).
  • Defender Antivirus must be in Active mode with real-time protection on. CFA does nothing in Passive mode, EDR in block mode, limited periodic scanning or when Defender Antivirus is off.
  • The default folder list is fixed, so add your own. Document, picture, music and video libraries are covered; finance shares, project folders and redirected data need explicit entries.
  • Start in Audit Mode and collect event 1124. Review which processes would have been blocked, allow the legitimate ones by exact path, then switch to Block and watch event 1123.
  • CFA complements, never replaces, backups and ASR. It narrows who can write, the ASR ransomware rule judges suspicious files, and offline or immutable backups recover what still gets through.

What Controlled Folder Access does

Microsoft describes CFA as a Microsoft Defender Antivirus feature and one of the attack surface reduction capabilities of Microsoft Defender for Endpoint. It has three elements: protected folders, trusted apps and disk sectors (boot record protection). When an untrusted process tries to change a file in a protected folder, the change is refused, the user sees a notification, and a "Protected memory access blocked" entry appears in Protection History in the Windows Security app.

Trust is decided first by Defender itself: most apps are trusted automatically based on prevalence and reputation. Microsoft states this automatic list is not shown in the Windows Security app or in the PowerShell cmdlets, so you cannot review it, only add to it. Script engines are the important exception: PowerShell and similar engines are not trusted by CFA, even through a Defender for Endpoint "allow" indicator, and can only be allowed by adding them as allowed apps.

The feature maps directly to the encryption and destruction stage of a ransomware attack: ATT&CK T1486 Data Encrypted for Impact for files, and T1561.001 Disk Content Wipe and T1542.003 Bootkit for writes to boot sectors.

Requirements

  • Antivirus state: Defender Antivirus must be the primary antivirus in Active mode with real-time protection on.
  • Platform: Windows only. CFA is available on any Windows edition that includes Defender Antivirus, including Windows 11 Home. Centralised management, reporting and alerting apply to Windows 10 or later Pro and Enterprise, Windows Server 2012 R2 or later, and Azure Local 23H2 or later. Server 2016 and 2012 R2 use the modern unified solution.
  • Licensing for monitoring: Microsoft 365 E5 is not required to use CFA, but advanced hunting needs Defender for Endpoint Plan 2, and the device timeline needs Plan 2 or Defender for Business.

Protected folders and defaults

The default protected list cannot be modified or removed. It applies to user accounts and to system profiles such as LocalService, NetworkService and systemprofile.

Default protected locationNotes
Hard drive boot sectorsGoverned by the disk modification modes (3 and 4) as well as full Block
C:\Users\<username>\DocumentsRedirected locations are protected instead, for example a OneDrive Known Folder Move path
C:\Users\<username>\FavoritesPer-user
C:\Users\<username>\Music, \Pictures, \VideosPer-user
C:\Users\Public\Documents, \Music, \Pictures, \VideosShared on the device

Run (Get-MpPreference).ControlledFolderAccessDefaultProtectedFolders in an elevated session to list them on a device; it returns output only when CFA is on.

Adding your own folders

  • Subfolders are included: adding a folder protects everything below it, so target the data root, not each project.
  • Environment variables yes, wildcards no: protected folder paths accept environment variables but not wildcards.
  • Network shares and mapped drives are supported, but Microsoft warns that untrusted processes touching protected shares can significantly reduce network performance because of the extra queries to the file server. Pilot share protection on a few devices first.
  • No loopback shares: if C:\demo is shared as \\mycomputer\demo, protect C:\demo.
  • Prioritise by business impact: local working copies of finance, legal, engineering and design data, plus any folder that syncs to a file server or cloud drive, since encrypted local copies can sync upstream.

Allowed apps and trust decisions

Every allowed app widens the gate, so treat the list like a firewall rule set: each entry has an owner, a reason and a review date.

Trust mechanismHow it worksWhen to use it
Automatic reputationDefender trusts most apps by prevalence and reputation; the list is not visibleDefault for mainstream software; no action needed
Allowed app by pathExact path, with environment variables and wildcards in the folder portion only; only the app at that location is allowedIn-house tools, niche line-of-business apps, script engines that genuinely must write to protected data
Certificate indicatorDefender for Endpoint certificate-based indicators allow signed executablesVendor or internal software signed with a stable certificate that updates often (paths change, signer does not)

Path rules that catch people out

  • Wildcards only in folders: %ProgramFiles%\Fabrikam\DriveManager\*\DriveService.exe is valid; a wildcard in the file name is not.
  • User variables resolve per user: CFA supports %LOCALAPPDATA% and %USERPROFILE% and resolves them in the context of the user running the app. ASR and antivirus exclusions only support system variables, so do not copy entries between the two lists without checking.
  • Restart after allowing: an allowed app takes effect when the app or service starts. A running service keeps generating events until it restarts.
  • Avoid user-writable locations: allowing an executable under %LOCALAPPDATA% or C:\Windows\Temp means anyone who can drop a file with that name in that path inherits the trust. Prefer paths under Program Files, or a certificate indicator.
  • Script engines last: allowing powershell.exe or a scripting host allows every script it runs. Look for a signed helper or a scheduled task under a dedicated account before allowing an engine.

Audit mode to block mode rollout

ModeValue (CSP / PowerShell)Behaviour
Disabled (default)0 / DisabledCFA off; custom folders and allowed apps have no effect
Enabled (Block)1 / EnabledUntrusted apps cannot modify or delete protected files or write to disk sectors
Audit Mode2 / AuditModeAttempts on files and sectors are logged, nothing is blocked
Block disk modification only3 / BlockDiskModificationOnlySector writes blocked and logged; protected files not affected
Audit disk modification only4 / AuditDiskModificationOnlySector writes logged; file changes neither logged nor blocked
  1. Prepare: confirm Defender Antivirus is Active with real-time protection on across the target group (devices running another primary antivirus will not enforce CFA). Agree the custom folder list with data owners.
  2. Audit broadly: deploy Audit Mode (2) with your custom folders to a representative ring: IT, a finance team, engineering workstations, kiosks. Run it through at least one month-end or release cycle so periodic tools show up.
  3. Check disk tools separately: Microsoft recommends Audit disk modification only (4) first, to confirm no imaging, backup, encryption or partitioning tool writes to sectors before blocking them.
  4. Triage events 1124 and 1128: group by initiating process and path. Allow the legitimate ones (path or certificate), and question the rest: an unexpected writer to Documents may be a real finding.
  5. Block in rings: switch the pilot to Enabled (1), then expand by department. Keep a helpdesk route for blocked-app requests with a target turnaround, so users do not pressure for CFA to be turned off.
  6. Roll back narrowly: if a critical app breaks, add it as an allowed app or move only the affected group back to Audit Mode. Avoid setting the whole estate to Disabled, which also drops the audit signal.

Deployment via Intune, Group Policy and PowerShell

MethodWhereModes supported
IntuneEndpoint security > Attack surface reduction, platform Windows, profile Attack Surface Reduction Rules; settings Enable controlled folder access, protected folders and allowed applications (Add or Import CSV)All
Defender portalEndpoint security policies, template Attack surface reduction rules (same settings as Intune)All
Any MDM (Policy CSP)./Device/Vendor/MSFT/Policy/Config/Defender/EnableControlledFolderAccess, ControlledFolderAccessProtectedFolders, ControlledFolderAccessAllowedApplications (values separated by |)All
Configuration ManagerWindows Defender Exploit Guard policyNo disk-only modes
Group PolicyComputer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Microsoft Defender Exploit Guard > Controlled Folder AccessAll
PowerShellSet-MpPreference, Add-MpPreference, Remove-MpPreference in an elevated sessionAll
Windows Security appVirus & threat protection > Manage settings > Manage controlled folder accessOn and Off only
  • Group Policy: setting "Configure controlled folder access" to Enabled is not enough; choose Block (or Audit Mode) in the drop-down. In "Configure protected folders" and "Configure allowed applications", each path is a Value name with Value 0. Quotes, leading or trailing spaces and extra characters are not supported.
  • PowerShell overwrites: Set-MpPreference -ControlledFolderAccessAllowedApplications replaces the entire list. Use Add-MpPreference and Remove-MpPreference for incremental changes, and read the current values with Get-MpPreference first.
  • One policy source per device: pick Intune or Group Policy for a given device group and record the choice. Two sources setting different folder lists is the most common reason a device does not match the intended policy.
  • Change control: keep the folder and allowed app lists in version control (the Intune CSV import format makes this straightforward) so every entry has a ticket and reviewer.

Monitoring events and troubleshooting

Events are written to Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational. Microsoft publishes an XML custom view for CFA events in its ASR Windows events article.

Event IDMeaningWhat to do with it
1123Blocked CFA eventAlert on bursts across many files; review single blocks of known apps as allow candidates
1124Audited CFA eventPrimary input to the allow-list during Audit Mode
1127Blocked CFA sector writeTreat as high priority unless a known disk tool explains it
1128Audited CFA sector writeUse to identify imaging, encryption or partitioning tools before blocking
5007Defender settings changedAlert when CFA mode or lists change outside a change window, a sign of tampering or drift

With Defender for Endpoint Plan 2, query the DeviceEvents table for ActionType ControlledFolderAccessViolationAudited and ControlledFolderAccessViolationBlocked, projecting DeviceName, FileName, FolderPath, InitiatingProcessFileName and InitiatingProcessCommandLine. The device timeline (Event group: ASR events) shows the same activity per device. See the Defender for Endpoint Advanced Hunting Tables Guide.

Troubleshooting

  • Nothing logged: check that Defender Antivirus is Active (not passive behind another antivirus) and real-time protection is on, then confirm the mode value with Get-MpPreference.
  • Allowed app still blocked: restart the app or service, check the exact path (a same-named binary elsewhere is not allowed), and check that a wildcard is not in the file name.
  • Reason unclear: run the Microsoft Defender Client Analyzer with the -cfa argument to see the reason for each detection.
  • Slow file shares: review whether protected network paths are being touched by an untrusted process at volume; allow the process or narrow the share list.

Metrics that show it is working

  • Coverage: percentage of Windows endpoints with CFA in Block mode (target: all user endpoints in scope).
  • Audit backlog: distinct processes in 1124 events still awaiting a decision, and age of the oldest.
  • Allow-list hygiene: number of allowed apps, the share in user-writable paths, and the share reviewed in the last 12 months.
  • Unexplained changes: count of 5007 events touching CFA settings without a matching change ticket (target: zero).
  • Request turnaround: median time to resolve a blocked-app request.

Where CFA fits with ASR rules and backups

CFA is configured in the same Intune attack surface reduction profile as ASR rules but answers a different question. ASR rules block behaviours, and the "Use advanced protection against ransomware" rule (GUID c1db55ab-c21a-4637-bb3f-a12568109d35) judges suspicious files that look like ransomware. CFA instead asks whether this process may write to this folder at all. Run both. See How to Deploy Attack Surface Reduction Rules.

Neither protects files an attacker reaches with a trusted process, files outside protected folders, or data already on servers that the endpoint does not run. Recovery still depends on backups the attacker cannot reach. See the Backup Security and Immutable Backup Guide and the 3-2-1-1-0 Backup Rule Explained.

FrameworkReferenceHow CFA contributes
MITRE ATT&CKT1486 Data Encrypted for Impact; T1561.001 Disk Content Wipe; T1542.003 BootkitBlocks untrusted writes to protected files and boot sectors
NIST CSF 2.0PR.DS-01; DE.CM-09Protects data at rest; CFA events feed monitoring
NIST SP 800-53 Rev 5SI-3 Malicious Code Protection; SI-4 System Monitoring; CP-9 System Backup (complementary)Endpoint malicious code protection with logged outcomes
CIS Controls v8.1Control 10 Malware Defenses; Control 11 Data Recovery (complementary)Anti-malware layer on endpoints; backups cover residual risk
ISO/IEC 27001:2022Annex A 8.7 Protection against malwareTechnical control within the malware protection requirement

Where identity fits

CFA trust follows the process, not the account. A trusted backup agent or sync client runs under a service account, and if that account or its credentials are taken over, its writes are still trusted. Keep allowed apps few, run them under dedicated, least-privilege service accounts, and monitor those accounts. See the Backup Identity Isolation Guide.

Practitioner checklist

  • Confirm Defender Antivirus is in Active mode with real-time protection on for every device in scope.
  • Agree a custom protected folder list with data owners, including redirected and synced folders.
  • Deploy Audit Mode (2), and Audit disk modification only (4) where disk tools exist, to a representative ring.
  • Triage events 1124 and 1128 by process and path; allow by exact path or certificate indicator, never broadly.
  • Avoid allowed app entries in user-writable paths and keep script engines off the list where possible.
  • Move to Enabled (1) ring by ring with a defined helpdesk route and rollback to Audit Mode per group.
  • Manage each device group from one policy source and keep folder and app lists in version control.
  • Alert on bursts of event 1123, any 1127, and 5007 changes to CFA settings outside change windows.
  • Review the allowed app list at least yearly and remove entries for retired software.
  • Pair CFA with the ASR ransomware rule and tested immutable or offline backups.

Standards and references

Related NHI Mgmt Group resources: Microsoft Defender for Endpoint Guide, How to Deploy Attack Surface Reduction Rules, Endpoint Security Guide, Backup Security and Immutable Backup Guide.

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.