You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: defender-endpoint/mde-plugin-wsl.md
+45-66Lines changed: 45 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,39 +1,19 @@
1
1
---
2
2
title: Microsoft Defender for Endpoint plug-in for Windows Subsystem for Linux (WSL)
3
-
description: Learn how to set up and use the MDE plugin for Windows Subsystem for Linux
3
+
description: Learn how to set up and use the MDE plugin for Windows Subsystem for Linux.
4
4
author: siosulli
5
5
ms.author: siosulli
6
6
manager: deniseb
7
-
ms.reviewer: pahuijbr
7
+
ms.reviewer: pahuijbr; gokulgiju
8
8
ms.service: defender-endpoint
9
9
ms.topic: how-to
10
10
ms.localizationpriority: medium
11
11
ms.collection:
12
12
- m365-security
13
13
- tier2
14
14
audience: ITPro
15
-
ms.date: 04/09/2024
15
+
ms.date: 04/25/2024
16
16
search.appverid: MET150
17
-
18
-
---
19
-
20
-
---
21
-
title: Microsoft Defender for Endpoint plug-in for Windows Subsystem for Linux (WSL)
22
-
description: Learn how to set up and use the MDE plugin for Windows Subsystem for Linux
23
-
author: siosulli
24
-
ms.author: siosulli
25
-
manager: deniseb
26
-
ms.reviewer: pahuijbr
27
-
ms.service: defender-endpoint
28
-
ms.topic: how-to
29
-
ms.localizationpriority: medium
30
-
ms.collection:
31
-
- m365-security
32
-
- tier2
33
-
audience: ITPro
34
-
ms.date: 04/09/2024
35
-
search.appverid: MET150
36
-
37
17
---
38
18
39
19
# Microsoft Defender for Endpoint plug-in for Windows Subsystem for Linux (WSL)
@@ -46,11 +26,13 @@ The Windows Subsystem for Linux (WSL) 2, which replaces the previous version of
46
26
47
27
Be aware of the following before you start:
48
28
49
-
1. The plug-in does not currently support automatic updates. When a new version is released, a new MSI package needs to be applied to perform the update. This can be done through any of the software deployment tools. Updates will come through Microsoft updates.
29
+
1. The plug-in doesn't yet automatically update. When a new plug-in version is released, the new MSI package needs to be applied to perform the update. You can apply the new package by using any tool that deploys software. Updates are coming soon through Microsoft Update. If preferred, you can continue to use the MSI package method.
50
30
51
31
2. As it takes a few minutes for the plug-in to fully instantiate and up to 30 minutes for a WSL2 instance to onboard itself, short-lived WSL container instances might result in the WSL2 instance not showing up in the Microsoft Defender portal ([https://security.microsoft.com](https://security.microsoft.com)). Once a (any) distribution has been running long enough (at least 30 minutes), it does show up.
52
32
53
-
3. The use of a custom kernel in combination with the plug-in is not supported. When you attempt to launch WSL with the plugin installed, you will encounter the error *A fatal error was returned by plugin 'DefenderforEndpointPlug-in'. Error message: 'Custom Kernel/Configuration not supported.'*.
33
+
3. If you're using a proxy in your (test) environment, make sure that the plug-in is set up to use it correctly. WSL is typically not automatically configured to use a proxy. For more information, see the section, [Setting a proxy for Defender running in WSL](#setting-a-proxy-for-defender-running-in-wsl).
34
+
35
+
4. The use of a custom kernel in combination with the plug-in isn't supported. When you attempt to launch WSL with the plugin installed, you'll encounter the error *A fatal error was returned by plugin 'DefenderforEndpointPlug-in'. Error message: 'Custom Kernel/Configuration not supported.'*.
54
36
55
37
## Software prerequisites
56
38
@@ -60,7 +42,7 @@ Be aware of the following before you start:
60
42
61
43
- Defender for Endpoint must be onboarded and running on the Windows host OS.
62
44
63
-
- The host OS must be running Windows 10 Client, version 2004 and higher (build 19044 and higher) or Windows 11 Client to support the Windows Subsystem for Linux versions that can work with the plug-in.
45
+
- The host OS must be running Windows 10, version 2004 and higher (build 19044 and higher) or Windows 11 to support the Windows Subsystem for Linux versions that can work with the plug-in.
64
46
65
47
## Software components and installer file names
66
48
@@ -80,31 +62,31 @@ Components installed:
80
62
81
63
## Installation steps
82
64
83
-
If you Windows Subsystem for Linux isn't installed yet, follow these steps:
65
+
If your Windows Subsystem for Linux isn't installed yet, follow these steps:
84
66
85
67
1. Open Terminal or Command Prompt. (In Windows, go to **Start** > **Command Prompt**. Or, right-click the start button and then select **Terminal**.)
86
68
87
69
2. Run the command `wsl -–install`.
88
70
89
-
### 1. Confirm WSL is installed and running
90
-
91
-
1. Using Terminal or Command Prompt, run `wsl –update` to make sure you have the latest version.
71
+
### Confirm WSL is installed and running
92
72
93
-
2. Run the`wsl` command to ensure WSL is running before testing.
73
+
1. Using Terminal or Command Prompt, run`wsl –update`to make sure you have the latest version.
94
74
95
-
### 2. Install the plug-in
75
+
2. Run the `wsl` command to ensure WSL is running before testing.
96
76
77
+
### Install the plug-in
97
78
98
-
After WSL is running and fully up to date, follow these steps to install the plug-in:
79
+
After WSL is running and fully up to date, follow these steps to install the plug-in:
99
80
100
-
1. Install the MSI file downloaded from the onboarding section in the Microsoft Defender portal (**Settings** > **Endpoints** > **Onboarding** > **Windows Subsystem for Linux 2 (plug-in)**.)
81
+
1. Install the MSI file downloaded from the onboarding section in the Microsoft Defender portal (**Settings** > **Endpoints** > **Onboarding** > **Windows Subsystem for Linux 2 (plug-in)**.)
101
82
102
-
2. Open a command prompt/terminal and run `wsl`.
83
+
2. Open a command prompt/terminal and run `wsl`.
103
84
104
85
You can [deploy the package using Microsoft Intune](/mem/intune/apps/lob-apps-windows).
105
86
106
87
> [!NOTE]
107
88
> If `WslService` is running, it stops during the installation process. You do not need to onboard the subsystem separately; instead, the plug-in automatically onboards to the tenant the Windows host is onboarded to.
89
+
108
90
## Installation validation checklist
109
91
110
92
1. After update or installation, wait for at least five minutes for the plug-in to fully initialize and write log output.
@@ -115,7 +97,7 @@ If you Windows Subsystem for Linux isn't installed yet, follow these steps:
115
97
116
98
4. Run the command `.\healthcheck.exe`.
117
99
118
-
5. Review the details of Defender and WSL and make sure they match or exceed the following:
100
+
5. Review the details of Defender and WSL and make sure they match or exceed the following requirements:
119
101
120
102
-**Defender Plug-in Version**: `0.23.1102.4`
121
103
-**WSL Version**: `2.0.7.0` or later
@@ -126,27 +108,24 @@ If you Windows Subsystem for Linux isn't installed yet, follow these steps:
126
108
127
109
This section describes how to configure proxy connectivity for the Defender for Endpoint plug-in. If your enterprise uses a proxy to provide connectivity to Defender for Endpoint running on the Windows host, continue reading to determine whether you need to configure it for the plug-in.
128
110
129
-
If you want to use the host [windows EDR telemetry proxy](configure-proxy-internet.md) configuration for MDE for the WSL plug-in, nothing more is required. This configuration is adopted by the plug-in automatically.
111
+
Reuse the Defender for Endpoint static proxy setting (`TelemetryProxyServer`).
130
112
131
-
If you want to use the host [winhttp proxy](https://learn.microsoft.com/defender-endpoint/configure-proxy-internet?view=o365-worldwide#configure-the-proxy-server-manually-using-netsh-command) configuration for MDE for WSL plug-in, nothing more is required. This configuration is adopted by the plug-in automatically.
113
+
If you want to use the host [static proxy](configure-proxy-internet.md) configuration for MDE for the WSL plug-in, nothing more is required. This configuration is adopted by the plug-in automatically.
132
114
133
-
If you want to use the host [network and network proxy setting](https://support.microsoft.com/windows/use-a-proxy-server-in-windows-03096c53-0554-4ffe-b6ab-8b1deee8dae1#ID0EFD=Windows_11) for MDE for WSL plug-in, nothing more is required. This configuration is adopted by the plug-in automatically.
115
+
If you want to use the host network and network proxy setting for MDE for WSL plug-in, nothing more is required. This configuration is adopted by the plug-in automatically.
134
116
135
117
## Plug-in Proxy selection
136
118
137
-
If your host machine contains multiple proxy settings, the plug-in will select the proxy configurations with the following hierarchy
119
+
If your host machine contains multiple proxy settings, the plug-in selects the proxy configurations with the following hierarchy:
138
120
139
-
1. Defender for Endpoint static proxy setting (`TelemetryProxyServer`)
121
+
1. Defender for Endpoint static proxy setting (`TelemetryProxyServer`).
140
122
141
-
2. Winhttp proxy (configured through netsh command)
123
+
2.`Winhttp` proxy (configured through `netsh` command).
142
124
143
-
3. Network & Internet proxy settings
125
+
3. Network & Internet proxy settings.
144
126
145
-
**Example:** If your host machine has both Winhttp proxy as well as Network & Internet proxy, plug-in will select `Winhttp proxy` as the proxy configuration for plug-in.
127
+
Example: If your host machine has both *Winhttp proxy* and *Network & Internet proxy*, the plug-in selects `Winhttp proxy` as the proxy configuration.
146
128
147
-
> [!NOTE]
148
-
> The `DefenderProxyServer` registry key is no longer supported. Follow the above mentioned steps to configure proxy in plug-in.
149
-
150
129
## Connectivity test for Defender running in WSL
151
130
152
131
The following procedure describes how to confirm that Defender in Endpoint in WSL has internet connectivity.
@@ -155,23 +134,24 @@ The following procedure describes how to confirm that Defender in Endpoint in WS
155
134
156
135
2. Create a registry key with the following details:
157
136
158
-
-**Name:**`ConnectivityTest`
159
-
-**Type:**`REG_DWORD`
160
-
-**Value:**`Number of seconds plug-in must wait before running test. (Recommended: 60 seconds)`
3. Once the registry is set, restart wsl using the following steps:
164
143
165
-
1. Open Command Prompt and run `wsl --shutdown`.
144
+
1. Open Command Prompt and run the command, `wsl --shutdown`.
166
145
167
146
2. Run the command `wsl`.
168
147
169
148
4. Wait for 5 minutes and then run `healthcheck.exe` (located at `C:\Program Files\Microsoft Defender for Endpoint plug-in for WSL\tools` for the results of the connectivity test).
170
149
171
-
If successful, the connectivity test shows success.
150
+
If successful, you can see that the connectivity test was successful.
172
151
173
152
> [!NOTE]
174
153
> To set a proxy for use in WSL containers (the distributions running on the subsystem), see [Advanced settings configuration in WSL](/windows/wsl/wsl-config).
154
+
175
155
## Verifying functionality and SOC analyst experience
176
156
177
157
After installing the plug-in, the subsystem and all its running containers are onboarded to the [Microsoft Defender portal](https://security.microsoft.com).
@@ -206,6 +186,7 @@ To test the plug-in after installation, follow these steps:
206
186
207
187
> [!NOTE]
208
188
> It takes about 5 minutes for the events to appear on the Microsoft Defender portal
189
+
209
190
Treat the machine as if it were a regular Linux host in your environment to perform testing against. In particular, we would like to get your feedback on the ability to surface potentially malicious behavior using the new plug-in.
210
191
211
192
### Advanced hunting
@@ -265,9 +246,9 @@ DeviceProcessEvents
265
246
4. If you don't see any devices in the Microsoft Defender portal, or you don't see any events in the timeline, check these things:
266
247
267
248
- If you aren't seeing a machine object, make sure sufficient time has passed for onboarding to complete (typically up to 10 minutes).
268
-
249
+
269
250
- Make sure to use the right filters, and that you have the appropriate permissions assigned to view all device objects. (For example, is your account/group is restricted to a specific group?)
270
-
251
+
271
252
- Use the health check tool to provide an overview of overall plug-in health. Open Terminal, and run the `healthcheck.exe` tool from `C:\Program Files\Microsoft Defender for Endpoint plug-in for WSL\tools`.
272
253
273
254
:::image type="content" source="media/mdeplugin-wsl/wsl-health-check-support.png" alt-text="Screenshot showing status in PowerShell." lightbox="media/mdeplugin-wsl/wsl-health-check-support.png":::
@@ -288,28 +269,26 @@ DeviceProcessEvents
288
269
289
270
:::image type="content" source="media/mdeplugin-wsl/wsl-health-check-overview.png" alt-text="Screenshot showing status in PowerShell output." lightbox="media/mdeplugin-wsl/wsl-health-check-overview.png":::
290
271
291
-
6. Microsoft Defender Endpoint for WSL supports Linux distributions running on WSL 2. If they are associated with WSL 1, you may face issues. Therefore, it is advised to disable WSL 1. To do so with the Intune policy, perform the following steps :
272
+
6. Microsoft Defender Endpoint for WSL supports Linux distributions running on WSL 2. If they're associated with WSL 1, you might encounter issues. Therefore, it is advised to disable WSL 1. To do so with the Intune policy, perform the following steps :
292
273
293
274
1. Navigate to your Microsoft Intune admin center portal.
294
275
295
-
2. Go to Devices -> Configuration Profiles -> Create -> New Policy.
296
-
297
-
3. Select Windows 10 and later -> Settings catalog.
276
+
2. Go to **Devices** > **Configuration Profiles** > **Create** > **New Policy**.
298
277
299
-
4. Create a name for the new profile and search for “Windows Subsystem for Linux” to see and add the full list of available settings.
278
+
3. Select **Windows 10 and later** > **Settings catalog**.
300
279
301
-
5. Set the Allow WSL1 setting to Disabled.
302
-
303
-
This will ensure only WSL 2 distributions can be used.
280
+
4. Create a name for the new profile, and search for **Windows Subsystem for Linux**to see and add the full list of available settings.
281
+
282
+
5. Set the **Allow WSL1** setting to **Disabled**, to ensure that only WSL 2 distributions can be used.
304
283
305
284
Alternately, if you want to keep using WSL 1, or not use the Intune Policy, you can selectively associate your installed distributions to run on WSL 2, by running the command in PowerShell:
306
-
285
+
307
286
```powershell
308
287
wsl --set-version <YourDistroName> 2
309
288
```
310
289
311
290
To have WSL 2 as your default WSL version for new distributions to be installed in the system, run the following command in PowerShell:
0 commit comments