Skip to content

Commit 5df5ced

Browse files
committed
Update defender-endpoint-demonstration-controlled-folder-access.md
1 parent 2e7006b commit 5df5ced

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

defender-endpoint/defender-endpoint-demonstration-controlled-folder-access.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ms.collection:
1414
- demo
1515
ms.topic: article
1616
ms.subservice: asr
17-
ms.date: 02/16/2024
17+
ms.date: 10/11/2024
1818
---
1919

2020
# Controlled folder access (CFA) demonstrations (block ransomware)
@@ -44,10 +44,10 @@ Set-MpPreference -ControlledFolderAccessProtectedFolders C:\demo\
4444
## Rule states
4545

4646
|State | Mode| Numeric value |
47-
|:---|:---|:---|
48-
| Disabled | = Off | 0 |
49-
| Enabled | = Block mode | 1 |
50-
| Audit | = Audit mode | 2 |
47+
|---|---|---|
48+
| Disabled | Off | 0 |
49+
| Enabled | Block mode | 1 |
50+
| Audit | Audit mode | 2 |
5151

5252
## Verify configuration
5353

@@ -63,19 +63,19 @@ Get-MpPreference
6363

6464
### Setup
6565

66-
Download and run this [setup script](https://demo.wd.microsoft.com/Content/CFA_SetupScript.zip). Before running the script set execution policy to Unrestricted using this PowerShell command:
66+
Download and run this [setup script](https://demo.wd.microsoft.com/Content/CFA_SetupScript.zip). Before running the script, set execution policy to `Unrestricted` by using this PowerShell command:
6767

6868
```powershell
6969
Set-ExecutionPolicy Unrestricted
7070
```
7171

72-
You can perform these manual steps instead:
72+
Or, you can perform these manual steps instead:
7373

74-
1. Create a folder under c: named demo, "c:\demo".
74+
1. Create a folder under `c:` named `demo`, as in `c:\demo`.
7575

76-
2. Save this [clean file](https://demo.wd.microsoft.com/Content/testfile_safe.txt) into c:\demo (we need something to encrypt).
76+
2. Save this [clean file](https://demo.wd.microsoft.com/Content/testfile_safe.txt) into `c:\demo` (we need something to encrypt).
7777

78-
3. Execute PowerShell commands listed earlier in this article.
78+
3. Run the PowerShell commands listed earlier in this article.
7979

8080
Next, check that status of the *Aggressive Ransomware Prevention* ASR rule and disable it for the duration of this test if it's enabled:
8181

@@ -85,7 +85,7 @@ $idx = $(Get-MpPreference).AttackSurfaceReductionRules_Ids.IndexOf("C1DB55AB-C21
8585
if ($idx -ge 0) {Write-Host "Rule Status: " $(Get-MpPreference).AttackSurfaceReductionRules_Actions[$idx]} else {Write-Host "Rule does not exist on this machine"}
8686
```
8787

88-
If the rule exists and the status if 1 (Enabled) or 6(Warn), it must be disabled to run this test:
88+
If the rule exists and the status is `1 (Enabled)` or `6 (Warn)`, it must be disabled to run this test:
8989

9090
```powershell
9191
Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3F-A12568109D35 -AttackSurfaceReductionRules_Actions Disabled
@@ -94,55 +94,55 @@ Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3F-A12568
9494
### Scenario 1: CFA blocks ransomware test file
9595

9696
1. Turn on CFA using PowerShell command:
97-
98-
```powershell
99-
Set-MpPreference -EnableControlledFolderAccess Enabled
100-
```
97+
98+
```powershell
99+
Set-MpPreference -EnableControlledFolderAccess Enabled
100+
```
101101

102102
2. Add the demo folder to protected folders list using PowerShell command:
103103

104-
```powershell
105-
Set-MpPreference -ControlledFolderAccessProtectedFolders C:\demo\
106-
```
104+
```powershell
105+
Set-MpPreference -ControlledFolderAccessProtectedFolders C:\demo\
106+
```
107+
108+
3. Download the ransomware [test file](https://demo.wd.microsoft.com/Content/ransomware_testfile_unsigned.exe).
107109

108-
3. Download the ransomware [test file](https://demo.wd.microsoft.com/Content/ransomware_testfile_unsigned.exe)
109-
4. Execute the ransomware test file *this isn't ransomware, it simple tries to encrypt c:\demo
110+
4. Execute the ransomware test file. Note that it isn't ransomware; it simply tries to encrypt `c:\demo`.
110111

111112
#### Scenario 1 expected results
112113

113-
5 seconds after executing the ransomware test file you should see a notification CFA blocked the encryption attempt.
114+
About five seconds after executing the ransomware test file, you should see a notification that CFA blocked the encryption attempt.
114115

115116
### Scenario 2: What would happen without CFA
116117

117118
1. Turn off CFA using this PowerShell command:
118119

119-
```powershell
120-
Set-MpPreference -EnableControlledFolderAccess Disabled
121-
```
120+
```powershell
121+
Set-MpPreference -EnableControlledFolderAccess Disabled
122+
```
122123

123-
2. Execute the ransomware [test file](https://demo.wd.microsoft.com/Content/ransomware_testfile_unsigned.exe)
124+
2. Execute the ransomware [test file](https://demo.wd.microsoft.com/Content/ransomware_testfile_unsigned.exe).
124125

125126
#### Scenario 2 expected results
126127

127-
- The files in c:\demo are encrypted and you should get a warning message
128+
- The files in `c:\demo` are encrypted and you should get a warning message
128129
- Execute the ransomware test file again to decrypt the files
129130

130131
## Clean-up
131132

132-
Download and run this [cleanup script](https://demo.wd.microsoft.com/Content/ASR_CFA_CleanupScript.zip). You can perform these manual steps instead:
133+
1. Download and run this [cleanup script](https://demo.wd.microsoft.com/Content/ASR_CFA_CleanupScript.zip). You can perform these manual steps instead:
133134

134-
```powershell
135-
Set-MpPreference -EnableControlledFolderAccess Disabled
136-
```
135+
```powershell
136+
Set-MpPreference -EnableControlledFolderAccess Disabled
137+
```
137138

138-
Clean up c:\demo encryption by using the [encrypt/decrypt file](https://demo.wd.microsoft.com/Content/ransomware_cleanup_encrypt_decrypt.exe)
139+
2. Clean up `c:\demo` encryption by using the [encrypt/decrypt file](https://demo.wd.microsoft.com/Content/ransomware_cleanup_encrypt_decrypt.exe)
139140

140-
Finally, if the *Aggressive Ransomware Prevention* ASR rule was enabled and you disabled it at the beginning of this test, enable it again:
141+
3. If the *Aggressive Ransomware Prevention* ASR rule was enabled and you disabled it at the beginning of this test, enable it again:
141142

142-
143-
```powershell
144-
Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3F-A12568109D35 -AttackSurfaceReductionRules_Actions Enabled
145-
```
143+
```powershell
144+
Add-MpPreference -AttackSurfaceReductionRules_Ids C1DB55AB-C21A-4637-BB3F-A12568109D35 -AttackSurfaceReductionRules_Actions Enabled
145+
```
146146

147147
## See also
148148

0 commit comments

Comments
 (0)