Skip to content

Commit ed9e80c

Browse files
committed
Learn Editor: Update run-analyzer-linux.md
1 parent 2c1c52b commit ed9e80c

File tree

1 file changed

+205
-37
lines changed

1 file changed

+205
-37
lines changed

defender-endpoint/run-analyzer-linux.md

Lines changed: 205 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,198 @@ ms.subservice: linux
1515

1616
# Run the client analyzer on Linux
1717

18+
#
19+
20+
**Applies to:**
21+
- [Microsoft Defender for Endpoint Plan 2](microsoft-defender-endpoint.md)
22+
- [Microsoft Defender XDR](/defender-xdr)
23+
24+
> Want to experience Defender for Endpoint? [Sign up for a free trial.](https://signup.microsoft.com/create-account/signup?products=7f379fee-c4f9-4278-b0a1-e4c8c2fcdf7e&ru=https://aka.ms/MDEp2OpenTrial?ocid=docs-wdatp-pullalerts-abovefoldlink)
25+
26+
When contacting support, you might be asked to provide the output package of the Microsoft Defender for Endpoint Client Analyzer tool.
27+
1828
The XMDEClientAnalyzer is used for diagnosing Microsoft Defender for Endpoint health or reliability issues on onboarded devices running Linux.
1929

20-
There are two ways to run the client analyzer tool:
30+
There are two different ways to run the client analyzer tool using live response or locally:
2131

2232
1. Using a binary version (no external Python dependency)
23-
2. Using a Python-based solution
33+
1. Using a Python-based solution
34+
35+
## Collect support logs in Microsoft Defender for Endpoint using live response
36+
37+
This section provides instructions on how to run the tool via Live Response on Linux machines.
38+
39+
## Linux
40+
41+
The XMDE Client Analyzer tool can be downloaded as a [binary](https://aka.ms/XMDEClientAnalyzerBinary) or [Python](https://aka.ms/XMDEClientAnalyzer) package that can be extracted and executed on Linux machines. Both versions of the XMDE Client Analyzer can be executed during a Live Response session.
42+
43+
### Prerequisites
44+
45+
- For installation the `unzip` package is required.
46+
47+
- For execution the `acl` package is required.
48+
49+
> [!IMPORTANT]
50+
> Window uses the Carriage Return and Line Feed invisible characters to represent the end of one line and beginning of a new line in a file, but Linux systems uses only the Line Feed invisible character at the end of its file lines. When using the following scripts, if done on Windows, this difference can result in errors and failures of the scripts to run. A potential solution to this is to utilize the Windows Subsystem for Linux and the `dos2unix` package to reformat the script so it aligns with the Unix and Linux format standard.
51+
52+
### Installing the XMDE Client Analyzer
53+
54+
Both versions of XMDE Client Analyzer, binary and Python, a self-contained package that must be downloaded and extracted before executing, and the complete set of steps for this process can be found:
55+
56+
- [Running the Binary version of the Client Analyzer](/defender-endpoint/run-analyzer-macos-linux)
57+
58+
- [Running the Python version of the Client Analyzer](/defender-endpoint/run-analyzer-macos-linux)
59+
60+
Due to the limited commands available in Live Response the steps detailed must be executed in a bash script, and by splitting the installation and execution portion of these commands it's possible to run the install script once, while running the execution script multiple times.
61+
62+
> [!IMPORTANT]
63+
> The example scripts assume the machine has direct internet access and can retrieve the XMDE Client Analyzer from Microsoft. If the machine does not have direct internet access then the installation scripts will need to be updated to fetch the XMDE Client Analyzer from a location the machines can access successfully.
64+
65+
#### Binary Client Analyzer Install Script
66+
67+
The following script performs the first six steps of the [Running the Binary version of the Client Analyzer](/defender-endpoint/run-analyzer-macos-linux). When complete, the XMDE Client Analyzer binary is available from the `/tmp/XMDEClientAnalyzerBinary/ClientAnalyzer` directory.
68+
69+
1. Create a bash file `InstallXMDEClientAnalyzer.sh` and paste the following content into it.
70+
71+
```bash
72+
#! /usr/bin/bash
73+
74+
echo "Starting Client Analyzer Script. Running As:"
75+
whoami
76+
77+
echo "Getting XMDEClientAnalyzerBinary"
78+
wget --quiet -O /tmp/XMDEClientAnalyzerBinary.zip https://aka.ms/XMDEClientAnalyzerBinary
79+
echo '9D0552DBBD1693D2E2ED55F36147019CFECFDC009E76BAC4186CF03CD691B469 /tmp/XMDEClientAnalyzerBinary.zip' | sha256sum -c
80+
81+
echo "Unzipping XMDEClientAnalyzerBinary.zip"
82+
unzip -q /tmp/XMDEClientAnalyzerBinary.zip -d /tmp/XMDEClientAnalyzerBinary
83+
84+
echo "Unzipping SupportToolLinuxBinary.zip"
85+
unzip -q /tmp/XMDEClientAnalyzerBinary/SupportToolLinuxBinary.zip -d /tmp/XMDEClientAnalyzerBinary/ClientAnalyzer
86+
87+
echo "MDESupportTool installed at /tmp/XMDEClientAnalyzerBinary/ClientAnalyzer"
88+
89+
```
90+
91+
#### Python Client Analyzer Install Script
92+
93+
The following script performs the first six steps of the [Running the Python version of the Client Analyzer](/defender-endpoint/run-analyzer-macos-linux). When complete, the XMDE Client Analyzer Python scripts are available from the `/tmp/XMDEClientAnalyzer` directory.
94+
95+
1. Create a bash file `InstallXMDEClientAnalyzer.sh` and paste the following content into it.
96+
97+
```bash
98+
#! /usr/bin/bash
99+
100+
echo "Starting Client Analyzer Install Script. Running As:"
101+
whoami
102+
103+
echo "Getting XMDEClientAnalyzer.zip"
104+
wget --quiet -O XMDEClientAnalyzer.zip https://aka.ms/XMDEClientAnalyzer
105+
echo '36C2B13AE657456119F3DC2A898FD9D354499A33F65015670CE2CD8A937F3C66 XMDEClientAnalyzer.zip' | sha256sum -c
106+
107+
echo "Unzipping XMDEClientAnalyzer.zip"
108+
unzip -q XMDEClientAnalyzer.zip -d /tmp/XMDEClientAnalyzer
109+
110+
echo "Setting execute permissions on mde_support_tool.sh script"
111+
cd /tmp/XMDEClientAnalyzer
112+
chmod a+x mde_support_tool.sh
113+
114+
echo "Performing final support tool setup"
115+
./mde_support_tool.sh
116+
117+
```
118+
119+
#### Running the Client Analyzer Install Scripts
120+
121+
1. Initiate a [Live Response session](live-response.md#initiate-a-live-response-session-on-a-device) on the machine you need to investigate.
122+
123+
2. Select **Upload file to library**.
124+
125+
3. Select **Choose file**.
126+
127+
4. Select the downloaded file named `InstallXMDEClientAnalyzer.sh`, and then select **Confirm**.
128+
129+
5. While still in the LiveResponse session, use the following commands to install the analyzer:
130+
131+
```console
132+
run InstallXMDEClientAnalyzer.sh
133+
```
134+
135+
### Running the XMDE Client Analyzer
136+
137+
Live Response doesn't support running the XMDE Client Analyzer or Python directly, so an execution script is necessary.
138+
139+
> [!IMPORTANT]
140+
> The following scripts assume the XMDE Client Analyzer was installed using the same locations from the scripts mentioned earlier. If your organization has chosen to install the scripts into a different location, then the following scripts need to be updated to align with your organization's chosen installation location.
141+
142+
#### Binary Client Analyzer Run Script
143+
144+
The Binary Client Analyzer accepts command line parameters to perform different analysis tests. To provide similar capabilities during Live Response the execution script takes advantage of the `$@` bash variable to pass all input parameters provided to the script to the XMDE Client Analyzer.
145+
146+
1. Create a bash file `MDESupportTool.sh` and paste the following content into it.
147+
148+
```bash
149+
#! /usr/bin/bash
150+
151+
echo "cd /tmp/XMDEClientAnalyzerBinary/ClientAnalyzer"
152+
cd /tmp/XMDEClientAnalyzerBinary/ClientAnalyzer
153+
154+
echo "Running MDESupportTool"
155+
./MDESupportTool $@
156+
157+
```
158+
159+
#### Python Client Analyzer Run Script
160+
161+
The Python Client Analyzer accepts command line parameters to perform different analysis tests. To provide similar capabilities during Live Response the execution script takes advantage of the `$@` bash variable to pass all input parameters provided to the script to the XMDE Client Analyzer.
162+
163+
1. Create a bash file `MDESupportTool.sh` and paste the following content into it.
164+
165+
```bash
166+
#! /usr/bin/bash
167+
168+
echo "cd /tmp/XMDEClientAnalyzer"
169+
cd /tmp/XMDEClientAnalyzer
170+
171+
echo "Running mde_support_tool"
172+
./mde_support_tool.sh $@
173+
174+
```
175+
176+
#### Running the Client Analyzer Script
177+
178+
> [!NOTE]
179+
> If you have an active Live Response session you can skip Step 1.
180+
181+
1. Initiate a [Live Response session](live-response.md#initiate-a-live-response-session-on-a-device) on the machine you need to investigate.
182+
183+
2. Select **Upload file to library**.
184+
185+
3. Select **Choose file**.
186+
187+
4. Select the downloaded file named `MDESupportTool.sh`, and then select **Confirm**.
188+
189+
1. While still in the Live Response session, use the following commands to run the analyzer and collect the resulting file.
190+
191+
```
192+
run MDESupportTool.sh -parameters "--bypass-disclaimer -d"
193+
GetFile "/tmp/your_archive_file_name_here.zip"
194+
```
195+
196+
## Collect Microsoft Defender for Endpoint support logs locally
197+
198+
This section provides instructions on how to run the tool locally on the Linux machines.
24199

25200
## Running the binary version of the client analyzer
26201

27202
1. Download the [XMDE Client Analyzer Binary](https://aka.ms/XMDEClientAnalyzerBinary) tool to the Linux machine you need to investigate.
28203
If you're using a terminal, download the tool by entering the following command:
29204

30-
```bash
31-
wget --quiet -O XMDEClientAnalyzerBinary.zip https://aka.ms/XMDEClientAnalyzerBinary
32-
```
33-
34-
1. Verify the download.
205+
```
206+
```bash
207+
wget --quiet -O XMDEClientAnalyzerBinary.zip https://aka.ms/XMDEClientAnalyzerBinary
208+
```
209+
```1. Verify the download.
35210
36211
- Linux
37212
@@ -98,20 +273,14 @@ If you're using a terminal, download the tool by entering the following command:
98273
wget --quiet -O XMDEClientAnalyzer.zip https://aka.ms/XMDEClientAnalyzer
99274
```
100275

101-
2. Verify the download
276+
1. Verify the download
102277

103-
- Linux
278+
- Linux
104279

105-
```bash
280+
```bash
106281
echo '84C9718FF3D29DA0EEE650FB2FC0625549A05CD1228AC253DBB92C8B1D9F1D11 XMDEClientAnalyzer.zip' | sha256sum -c
107282
```
108283

109-
- macOS
110-
111-
```bash
112-
echo '84C9718FF3D29DA0EEE650FB2FC0625549A05CD1228AC253DBB92C8B1D9F1D11 XMDEClientAnalyzer.zip' | shasum -a 256 -c
113-
```
114-
115284
3. Extract the contents of XMDEClientAnalyzer.zip on the machine.
116285
If you're using a terminal, extract the files by using the following command:
117286
@@ -186,25 +355,6 @@ Collect extensive machine performance tracing for analysis of a performance scen
186355
187356
Usage example: `sudo ./MDESupportTool performance --frequency 2`
188357
189-
#### Use OS trace (for macOS only)
190-
191-
Use OS tracing facilities to record Defender for Endpoint performance traces.
192-
193-
> [!NOTE]
194-
> This functionality exists in the Python solution only.
195-
196-
```console
197-
-h, --help show this help message and exit
198-
--length LENGTH Length of time to record the trace (in seconds).
199-
--mask MASK Mask to select with event to trace. Defaults to all
200-
```
201-
202-
On running this command for the first time, it installs a Profile configuration.
203-
204-
Follow this to approve profile installation: [Apple Support Guide](https://support.apple.com/guide/mac-help/configuration-profiles-standardize-settings-mh35561/mac#:~:text=Install%20a%20configuration%20profile%20you%E2%80%99ve%20received).
205-
206-
Usage example `./mde_support_tool.sh trace --length 5`
207-
208358
#### Exclude mode
209359
210360
Add exclusions for audit-d monitoring.
@@ -268,15 +418,15 @@ Usage example: `sudo ./mde_support_tool.sh skipfaultyrules -e true`
268418
> [!NOTE]
269419
> This functionality will be skipping the faulty rules. The faulty rule then needs to be further identified and fixed.
270420
271-
## Result package contents on macOS and Linux
421+
## Result package contents on Linux
272422
273423
- report.html
274424
275425
Description: The main HTML output file that contains the findings and guidance from running the client analyzer tool on the device. This file is only generated when running the Python-based version of the client analyzer tool.
276426
277427
- mde_diagnostic.zip
278428
279-
Description: Same diagnostic output that gets generated when running *mdatp diagnostic create* on either [macOS](mac-resources.md#collecting-diagnostic-information) or [Linux](linux-resources.md#collect-diagnostic-information).
429+
Description: Same diagnostic output that gets generated when running *mdatp diagnostic create* on [Linux](linux-resources.md#collect-diagnostic-information).
280430
281431
- mde.xml
282432
@@ -305,4 +455,22 @@ Usage example: `sudo ./mde_support_tool.sh skipfaultyrules -e true`
305455
- perf_benchmark.tar.gz
306456
307457
Description: The performance test reports. You'll see this only if you're using the performance parameter.
458+
See also
459+
460+
- [Client analyzer overview](overview-client-analyzer.md)
461+
462+
- [Download and run the client analyzer](download-client-analyzer.md)
463+
464+
- [Run the client analyzer on Windows](run-analyzer-windows.md)
465+
466+
- [Run the client analyzer on macOS or Linux](run-analyzer-macos-linux.md)
467+
468+
- [Data collection for advanced troubleshooting on Windows](data-collection-analyzer.md)
469+
470+
- [Understand the analyzer HTML report](analyzer-report.md)
471+
308472
[!INCLUDE [Microsoft Defender for Endpoint Tech Community](../includes/defender-mde-techcommunity.md)]
473+
474+
475+
476+

0 commit comments

Comments
 (0)