Skip to content

Commit 93f1c85

Browse files
authored
Update mde-plugin-wsl.md
1 parent 663a5d5 commit 93f1c85

File tree

1 file changed

+45
-66
lines changed

1 file changed

+45
-66
lines changed

defender-endpoint/mde-plugin-wsl.md

Lines changed: 45 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
11
---
22
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.
44
author: siosulli
55
ms.author: siosulli
66
manager: deniseb
7-
ms.reviewer: pahuijbr
7+
ms.reviewer: pahuijbr; gokulgiju
88
ms.service: defender-endpoint
99
ms.topic: how-to
1010
ms.localizationpriority: medium
1111
ms.collection:
1212
- m365-security
1313
- tier2
1414
audience: ITPro
15-
ms.date: 04/09/2024
15+
ms.date: 04/25/2024
1616
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-
3717
---
3818

3919
# 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
4626

4727
Be aware of the following before you start:
4828

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.
5030

5131
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.
5232

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.'*.
5436

5537
## Software prerequisites
5638

@@ -60,7 +42,7 @@ Be aware of the following before you start:
6042

6143
- Defender for Endpoint must be onboarded and running on the Windows host OS.
6244

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.
6446

6547
## Software components and installer file names
6648

@@ -80,31 +62,31 @@ Components installed:
8062

8163
## Installation steps
8264

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:
8466

8567
1. Open Terminal or Command Prompt. (In Windows, go to **Start** > **Command Prompt**. Or, right-click the start button and then select **Terminal**.)
8668

8769
2. Run the command `wsl -–install`.
8870

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
9272

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.
9474

95-
### 2. Install the plug-in
75+
2. Run the `wsl` command to ensure WSL is running before testing.
9676

77+
### Install the plug-in
9778

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:
9980

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)**.)
10182

102-
2. Open a command prompt/terminal and run `wsl`.
83+
2. Open a command prompt/terminal and run `wsl`.
10384

10485
You can [deploy the package using Microsoft Intune](/mem/intune/apps/lob-apps-windows).
10586

10687
> [!NOTE]
10788
> 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+
10890
## Installation validation checklist
10991

11092
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:
11597

11698
4. Run the command `.\healthcheck.exe`.
11799

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:
119101

120102
- **Defender Plug-in Version**: `0.23.1102.4`
121103
- **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:
126108

127109
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.
128110

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`).
130112

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.
132114

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.
134116

135117
## Plug-in Proxy selection
136118

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:
138120

139-
1. Defender for Endpoint static proxy setting (`TelemetryProxyServer`)
121+
1. Defender for Endpoint static proxy setting (`TelemetryProxyServer`).
140122

141-
2. Winhttp proxy (configured through netsh command)
123+
2. `Winhttp` proxy (configured through `netsh` command).
142124

143-
3. Network & Internet proxy settings
125+
3. Network & Internet proxy settings.
144126

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.
146128

147-
> [!NOTE]
148-
> The `DefenderProxyServer` registry key is no longer supported. Follow the above mentioned steps to configure proxy in plug-in.
149-
150129
## Connectivity test for Defender running in WSL
151130

152131
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
155134

156135
2. Create a registry key with the following details:
157136

158-
- **Name:** `ConnectivityTest`
159-
- **Type:** `REG_DWORD`
160-
- **Value:** `Number of seconds plug-in must wait before running test. (Recommended: 60 seconds)`
161-
- **Path:** `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\Plugins\DefenderPlug-in`
137+
- **Name**: `ConnectivityTest`
138+
- **Type**: `REG_DWORD`
139+
- **Value**: `Number of seconds plug-in must wait before running test. (Recommended: 60 seconds)`
140+
- **Path**: `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\Plugins\DefenderPlug-in`
162141

163142
3. Once the registry is set, restart wsl using the following steps:
164143

165-
1. Open Command Prompt and run `wsl --shutdown`.
144+
1. Open Command Prompt and run the command, `wsl --shutdown`.
166145

167146
2. Run the command `wsl`.
168147

169148
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).
170149

171-
If successful, the connectivity test shows success.
150+
If successful, you can see that the connectivity test was successful.
172151

173152
> [!NOTE]
174153
> 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+
175155
## Verifying functionality and SOC analyst experience
176156

177157
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:
206186

207187
> [!NOTE]
208188
> It takes about 5 minutes for the events to appear on the Microsoft Defender portal
189+
209190
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.
210191

211192
### Advanced hunting
@@ -265,9 +246,9 @@ DeviceProcessEvents
265246
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:
266247

267248
- 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+
269250
- 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+
271252
- 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`.
272253

273254
:::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
288269

289270
:::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":::
290271

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 :
292273

293274
1. Navigate to your Microsoft Intune admin center portal.
294275

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**.
298277

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**.
300279

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.
304283

305284
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+
307286
```powershell
308287
wsl --set-version <YourDistroName> 2
309288
```
310289

311290
To have WSL 2 as your default WSL version for new distributions to be installed in the system, run the following command in PowerShell:
312-
291+
313292
```powershell
314293
wsl --set-default-version 2
315-
```
294+
```

0 commit comments

Comments
 (0)