Linux 클라이언트 분석기 실행

Linux 엔드포인트용 Microsoft Defender 문제가 있고 지원이 필요한 경우 클라이언트 분석기 도구에서 출력을 제공하라는 메시지가 표시될 수 있습니다. 관리자와 지원 팀이 엔드포인트용 Microsoft Defender 문제를 해결하는 데 도움이 되는 진단 도구입니다. 설치, 구성, 서비스 상태, 로그, 연결 상태 등에 대한 자세한 정보를 수집합니다. 이 도구는 주로 시스템 상태를 확인하고, 구성의 유효성을 검사하고, 잠재적인 문제를 해결하는 데 사용됩니다.

다음 방법 중 하나로 Client Analyzer 진단 정보를 수집할 수 있습니다:

  1. 명령 라인: 클라이언트 분석기를 기기에서 로컬로 실행하세요. run-the-binary-version-of-the-client-analyzer 또는 run-the-python-based-client-analyzer를 참조하세요.

  2. 실시간 응답: 실시간 응답 세션 중에 클라이언트 분석기를 원격으로 실행합니다. use-live-response-to-collect-diagnostics-log를 참조하세요

  3. 조사 패키지: Microsoft Defender 포털의 장치 페이지에서 조사 패키지를 수집하세요. Linux에서는 Client Analyzer 진단 기능이 포함되어 있습니다. collect-investigation-package-from-devices 참조

팁

클라이언트 분석기의 개요를 보려면 이 비디오를 시청하세요. 엔드포인트용 Defender 클라이언트 분석기 개요

클라이언트 분석기의 이진 버전 실행

클라이언트 분석기의 이진 버전은 다음 두 가지 방법으로 사용할 수 있습니다.

  • Linux Microsoft Defender 함께 제공
  • 독립 실행형 도구로 제공됨

Microsoft Defender for Linux와 함께 제공된 클라이언트 분석기 바이너리를 실행합니다.

참고

엔드포인트용 Microsoft Defender 버전 101.25082.0000부터 클라이언트 분석기는 에이전트와 함께 배송됩니다. 다음 위치에서 찾을 수 있습니다. /opt/microsoft/mdatp/tools/client_analyzer/binary

이 도구를 실행하면 .zip 디렉터리에 /tmp 파일로 진단 패키지가 생성됩니다.

클라이언트 분석기를 실행하려면 다음 단계를 수행합니다.

  1. 디렉터리 로 이동합니다./opt/microsoft/mdatp/tools/client_analyzer/binary

    cd /opt/microsoft/mdatp/tools/client_analyzer/binary
    
  2. 루트 권한으로 도구를 실행하여 진단 패키지를 생성합니다.

    sudo ./MDESupportTool -d
    

클라이언트 분석기 독립 실행형 이진 도구 다운로드 및 실행

독립 실행형 ClientAnalyzer 이진 파일을 사용하려면 다음 단계를 완료합니다.

  1. 조사해야 할 Linux 머신에 XMDE 클라이언트 분석기 바이너리 도구를 다운로드하세요. 터미널을 사용하는 경우 다음 명령을 입력하여 도구를 다운로드합니다.

    wget --quiet -O XMDEClientAnalyzerBinary.zip "https://go.microsoft.com/fwlink/?linkid=2336125"
    
  2. 다운로드를 확인합니다.

    echo '5F906591D33D675F14D73D5B658A796CEC7480B023B18D45C5D687713A4D4FBB XMDEClientAnalyzerBinary.zip' | sha256sum -c
    
  3. 컴퓨터에서 의 XMDEClientAnalyzerBinary.zip 내용을 추출합니다.

    unzip -q XMDEClientAnalyzerBinary.zip -d XMDEClientAnalyzerBinary
    
  4. 디렉터리를 변경합니다.

    cd XMDEClientAnalyzerBinary
    
  5. 두 개의 새 zip 파일이 생성됩니다.

    • SupportToolLinuxamd64Binary.zip: x86 Linux 디바이스의 경우
    • SupportToolLinuxarm64Binary.zip: ARM Linux 디바이스의 경우
  6. 사용 중인 Linux OS 아키텍처에 따라 해당 ZIP 파일의 압축을 푸세요. 예를 들어 여기서 SupportToolLinuxamd64Binary.zip 는 파일을 사용합니다.

    unzip -q SupportToolLinuxamd64Binary.zip
    
  7. 루트 권한으로 도구를 실행하여 진단 패키지를 생성합니다.

    sudo ./MDESupportTool -d
    

Python 기반 클라이언트 분석기 실행

클라이언트 분석기의 Python 버전은 다음 두 가지 방법으로 사용할 수 있습니다.

  • Linux Microsoft Defender 함께 제공
  • 독립 실행형 도구로 제공됨

참고

  • 분석기는 루트에서 결과 출력을 생성할 때 운영 체제에 설치된 몇 가지 추가 PIP 패키지(decorator, sh, distro, lxml및 psutil)에 따라 달라집니다. 설치되지 않은 경우 분석기는 Python 패키지의 공식 리포지토리에서 가져오려고 시도합니다.
  • 또한 이 도구는 현재 디바이스에 Python 버전 3 이상을 설치해야 합니다.
  • MDE Linux 버전 1.7.0용 Client Analyzer부터 Python 가상 환경(venv)에서 Python 기반 클라이언트 분석기 실행을 지원할 수 있습니다. 가상 환경을 사용하는 것은 선택 사항이며 필요하지 않습니다.
  • 디바이스가 프록시 뒤에 있는 경우 프록시 서버를 환경 변수로 스크립트에 mde_support_tool.sh 전달할 수 있습니다. 예: https_proxy=https://myproxy.contoso.com:8080 ./mde_support_tool.sh"

경고

Python 기반 클라이언트 분석기를 실행하려면 PIP 패키지를 설치해야 하므로 사용자 환경에서 몇 가지 문제가 발생할 수 있습니다. 문제가 발생하지 않도록 하려면 사용자 PIP 환경에 패키지를 설치하는 것이 좋습니다.

Linux Microsoft Defender 함께 제공되는 클라이언트 분석기 python 버전 실행

참고

엔드포인트용 Defender 버전 101.25082.0000부터 클라이언트 분석기는 에이전트와 함께 배송됩니다. 다음 위치에서 찾을 수 있습니다. /opt/microsoft/mdatp/tools/client_analyzer/python

이 클라이언트 분석기를 실행하려면 다음 단계를 수행합니다.

  1. 디렉터리로 이동합니다./opt/microsoft/mdatp/tools/client_analyzer/python

    cd /opt/microsoft/mdatp/tools/client_analyzer/python
    
  2. 루트 권한으로 를 실행하여 필요한 종속성을 설치합니다.

    sudo ./mde_support_tool.sh
    
  3. 진단 패키지를 수집하고 결과 보관 파일을 생성하려면 루트 권한으로 다시 실행합니다.

    sudo ./mde_support_tool.sh -d
    

클라이언트 분석기 독립 실행형 Python 버전 다운로드 및 실행

  1. 조사해야 하는 Linux 컴퓨터에서 XMDE 클라이언트 분석기 도구를 다운로드합니다. 터미널을 사용하는 경우 다음 명령을 입력하여 도구를 다운로드합니다.

    wget --quiet -O XMDEClientAnalyzerPython.zip "https://go.microsoft.com/fwlink/?linkid=2336046"
    
  2. 다운로드를 확인합니다.

    echo '0B7C350A1C19E049416B1C8FB7ED857569DDCC32FB90453A3FCCD083487C0B4E XMDEClientAnalyzerPython.zip' | sha256sum -c
    
  3. 컴퓨터에서 의 XMDEClientAnalyzer.zip 내용을 추출합니다.

    unzip -q XMDEClientAnalyzerPython.zip -d XMDEClientAnalyzerPython
    
  4. 디렉터리를 변경합니다.

    cd XMDEClientAnalyzerPython
    
  5. 도구 실행 파일 권한을 부여합니다.

    chmod a+x mde_support_tool.sh
    
  6. 비루트 사용자로 실행하여 필요한 종속성을 설치합니다.

    ./mde_support_tool.sh
    
  7. 진단 패키지를 수집하고 결과 보관 파일을 생성하려면 루트 권한으로 다시 실행합니다.

    sudo ./mde_support_tool.sh -d
    

팁

온보딩 문제에 대한 자세한 내용은 이 비디오를 시청하세요. 엔드포인트용 Defender 클라이언트 분석기 온보딩 문제

명령줄 옵션

클라이언트 분석기는 다음 명령줄 옵션을 제공합니다.


usage: MDESupportTool [-h] [--output OUTPUT] [--outdir OUTDIR] [--no-zip]
                      [--force] [--diagnostic] [--skip-mdatp]
                      [--bypass-disclaimer] [--interactive] [--delay DELAY]
                      [--mdatp-log {trace,info,warning,error,debug,verbose}]
                      [--max-log-size MAX_LOG_SIZE]
                      {certinfocollection,performance,installation,exclude,ratelimit,skipfaultyrules,trace,observespikes,connectivitytest}
                      ...

MDE Diagnostics Tool

positional arguments:
  {certinfocollection,performance,installation,exclude,ratelimit,skipfaultyrules,trace,observespikes,connectivitytest}
    certinfocollection  Collect cert information: Subject name and Hashes
    performance         Collect extensive machine performance tracing for
                        analysis of a performance scenario that can be
                        reproduced on demand
    installation        Collect different installation/onboarding reports
    exclude             Exclude specific processes from audit-d monitoring.
    ratelimit           Set the rate limit for auditd events. Rate limit will
                        update the limits for auditd events for all the
                        applications using auditd, which could impact
                        applications other than MDE.
    skipfaultyrules     Continue loading rules in spite of an error. This
                        summarizes the results of loading the rules. The exit
                        code will not be success if any rule fails to load.
    trace               Use OS tracing facilities to record Defender
                        performance traces.
    observespikes       Collect the process logs in case of spike or mdatp
                        crash
    connectivitytest    Perform connectivity test for MDE

optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output path to export report
  --outdir OUTDIR       Directory where diagnostics file will be generated.
  --no-zip, -nz         If set a directory will be created instead of an
                        archive file.
  --force, -f           Will overwrite if output directory exists.
  --diagnostic, -d      Collect extensive machine diagnostic information.
  --skip-mdatp          Skip any mdatp command. Use this when the mdatp
                        command is unresponsive.
  --bypass-disclaimer   Do not display disclaimer banner.
  --interactive, -i     Interactive diagnostic,
  --delay DELAY, -dd DELAY
                        Delay diagnostic by how many minutes (0~2880), use
                        this to wait for more debug logs before it collects.
  --mdatp-log {trace,info,warning,error,debug,verbose}
                        Set MDATP log level. If you use interactive or delay
                        mode, the log level will set to debug automatically,
                        and reset after 48h.
  --max-log-size MAX_LOG_SIZE
                        Maximum log file size in MB before rotating(Will
                        restart mdatp).

진단 모드

진단 모드는 메모리, 디스크 및 MDATP 로그와 같은 광범위한 컴퓨터 정보 집합을 수집하는 데 사용됩니다. 이 파일 집합은 엔드포인트용 Defender와 관련된 문제를 디버그하는 데 필요한 기본 정보 집합을 제공합니다.

지원되는 옵션은 다음과 같습니다.


optional arguments:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output path to export report
  --outdir OUTDIR       Directory where diagnostics file will be generated.
  --no-zip, -nz         If set a directory will be created instead of an
                        archive file.
  --force, -f           Will overwrite if output directory exists.
  --diagnostic, -d      Collect extensive machine diagnostic information.
  --skip-mdatp          Skip any mdatp command. Use this when the mdatp
                        command is unresponsive.
  --bypass-disclaimer   Do not display disclaimer banner.
  --interactive, -i     Interactive diagnostic,
  --delay DELAY, -dd DELAY
                        Delay diagnostic by how many minutes (0~2880), use
                        this to wait for more debug logs before it collects.
  --mdatp-log {trace,info,warning,error,debug,verbose}
                        Set MDATP log level. If you use interactive or delay
                        mode, the log level will set to debug automatically,
                        and reset after 48h.
  --max-log-size MAX_LOG_SIZE
                        Maximum log file size in MB before rotating(Will
                        restart mdatp).

사용 예제: sudo ./MDESupportTool -d

참고

로그 수준 자동 설정 기능은 에이전트 버전 101.24052.0002 이상에서만 사용할 수 있습니다.

이 모드를 사용할 때 생성된 파일은 다음 표에 요약되어 있습니다.

파일 설명
mde_diagnostic.zip 엔드포인트용 Defender 로그 및 구성
health.txt Defender for Endpoint의 상태
(엔드포인트용 Defender가 설치된 경우에만 표시)
health_details_features.txt Defender for Endpoint의 다른 기능 상태
(엔드포인트용 Defender가 설치된 경우에만 표시)
permissions.txt 엔드포인트용 Defender에서 소유/사용하는 폴더의 사용 권한 문제
(엔드포인트용 Defender가 설치된 경우에만 표시)
crashes 엔드포인트용 Defender에서 생성된 크래시 덤프
process_information.txt 도구가 실행되었을 때 컴퓨터에서 실행되는 프로세스
proc_directory_info.txt 엔드포인트용 Defender 프로세스의 가상 메모리 매핑
(엔드포인트용 Defender가 설치된 경우에만 표시)
auditd_info.txt 감사된 상태, 규칙, 로그
auditd_log_analysis.txt auditd가 처리한 이벤트 요약
auditd_logs.zip 감사된 로그 파일
ebpf_kernel_config.txt 현재 로드된 Linux 커널 구성
ebpf_enabled_func.txt 현재 추적에 사용하도록 설정된 모든 커널 함수 목록
ebpf_syscalls.zip 시스템 호출 추적에 대한 정보
ebpf_raw_syscalls.zip 원시 시스템 호출과 관련된 이벤트 추적
ebpf_maps_info.txt eBPF 지도의 ID 및 크기 정보
syslog.zip /var/log/syslog 아래의 파일
messages.zip /var/log/messages 아래의 파일
conflicting_processes_information.txt 엔드포인트용 Defender 충돌 프로세스
exclusions.txt 바이러스 백신 제외 목록
definitions.txt 바이러스 백신 정의 정보
mde_directories.txt 엔드포인트용 Defender 디렉터리에 있는 파일 목록
disk_usage.txt 디스크 사용량 세부 정보
mde_user.txt Defender for Endpoint 사용자 정보
mde_definitions_mount.txt 엔드포인트용 Defender 정의 탑재 지점
service_status.txt Defender for Endpoint 서비스 상태
service_file.txt 엔드포인트용 Defender 서비스 파일
hardware_info.txt 하드웨어 정보
mount.txt 탑재 지점 정보
uname.txt 커널 정보
memory.txt 시스템 메모리 정보
meminfo.txt 시스템의 메모리 사용량에 대한 자세한 정보
cpuinfo.txt CPU 정보
lsns_info.txt Linux 네임스페이스 정보
lsof.txt 엔드포인트용 Defender 파일 설명자 정보 열기
(이 표 뒤의 참고 사항 참조)
sestatus.txt 엔드포인트용 Defender 파일 설명자 정보 열기
lsmod.txt Linux 커널의 모듈 상태
dmesg.txt 커널 링 버퍼의 메시지
kernel_lockdown.txt 커널 잠금 정보
rtp_statistics.txt 엔드포인트용 Defender RTP(실시간 보호) 통계
(엔드포인트용 Defender가 설치된 경우에만 표시)
libc_info.txt libc 라이브러리 정보
uptime_info.txt 마지막 다시 시작 이후의 시간
last_info.txt 마지막으로 로그인한 사용자 목록
locale_info.txt 현재 로캘 표시
tmp_files_owned_by_mdatp.txt 그룹이 mdatp인 /tmp 파일
(엔드포인트용 Defender가 설치된 경우에만 표시)
mdatp_config.txt Defender for Endpoint의 모든 구성
(엔드포인트용 Defender가 설치된 경우에만 표시)
mpenginedb.db
mpenginedb.db-wal
mpenginedb.db-shm
바이러스 백신 정의 파일
(엔드포인트용 Defender가 설치된 경우에만 표시)
iptables_rules.txt Linux iptables 규칙
network_info.txt 네트워크 정보
sysctl_info.txt 커널 설정 정보
hostname_diagnostics.txt 호스트 이름 진단 정보
mde_event_statistics.txt Defender for Endpoint 이벤트 통계
(엔드포인트용 Defender가 설치된 경우에만 표시)
mde_ebpf_statistics.txt 엔드포인트용 Defender eBPF 통계
(엔드포인트용 Defender가 설치된 경우에만 표시)
kernel_logs.zip 커널 로그
mdc_log.zip 클라우드 로그에 대한 Microsoft Defender
netext_config.txt
threat_list.txt 엔드포인트용 Defender에서 검색한 위협 목록
(엔드포인트용 Defender가 설치된 경우에만 표시)
top_output.txt 도구가 실행되었을 때 컴퓨터에서 실행되는 프로세스
top_summary.txt 실행 중인 프로세스의 메모리 및 CPU 사용 현황 분석

Client Analyzer에 대한 선택적 인수

클라이언트 분석기는 추가 데이터 수집에 대해 다음과 같은 선택적 인수를 제공합니다.

성능 정보 수집

주문형으로 재현할 수 있는 성능 시나리오를 분석하기 위해 엔드포인트용 Defender 프로세스의 광범위한 컴퓨터 성능 추적을 수집합니다.

-h, --help            show this help message and exit
--frequency FREQUENCY
                      profile at this frequency
--length LENGTH       length of time to collect (in seconds)

사용 예제: sudo ./MDESupportTool performance --frequency 500

이 모드는 다음 파일을 생성합니다.

파일 설명
perf_benchmark.tar.gz 엔드포인트용 Defender가 성능 데이터를 처리합니다.

참고

진단 모드에 해당하는 파일도 생성됩니다.

tar는 형식 <pid of a MDE process>.data의 파일을 포함합니다. 다음 명령을 사용하여 데이터 파일을 읽을 수 있습니다.

perf report -i <pid>.data

연결 테스트 실행

이 모드는 엔드포인트용 Defender에 필요한 클라우드 리소스에 연결할 수 있는지 여부를 테스트합니다.


  -h, --help            show this help message and exit
  -o ONBOARDING_SCRIPT, --onboarding-script ONBOARDING_SCRIPT
                        Path to onboarding script
  -g GEO, --geo GEO     Geo string to test <US|UK|EU|AU|CH|IN>

사용 예제:

sudo ./MDESupportTool connectivitytest -o ~/MicrosoftDefenderATPOnboardingLinuxServer.py`

화면에 인쇄된 출력은 URL에 연결할 수 있는지 여부를 표시합니다.

다양한 설치/온보딩 보고서 수집

이 모드는 배포판 및 시스템 요구 사항과 같은 설치 관련 정보를 수집합니다.


  -h, --help                show this help message and exit
  -d, --distro              Check for distro support
  -m, --min-requirement     Check for the system info against offical minimum requirements
  -e, --external-dep        Check for externel package dependency
  -c, --connectivity        Check for connectivity for services used by MDE
  -a, --all                 Run all checks
  -o ONBOARDING_SCRIPT, --onboarding-script ONBOARDING_SCRIPT
                            Path to onboarding script
  -g GEO, --geo GEO         Geo string to test <US|UK|EU|AU|CH|IN>

사용 예제:

sudo ./MDESupportTool installation --all

단일 보고서가 installation_report.json 생성됩니다. 파일의 키는 다음과 같습니다.

키 설명
agent_version 엔드포인트용 Defender 버전이 설치되었습니다.
온보딩_상태 온보딩 및 링 정보
support_status MDE 현재 시스템 구성에서 지원됩니다.
배포판 에이전트가 설치된 배포판이 지원되거나 지원되지 않습니다.
connectivitytest 연결 테스트 상태.
최소 요구 사항 CPU 및 메모리에 대한 최소 요구 사항이 충족됩니다.
external_depedency 외부 종속성이 충족되는지 여부입니다.
mde_health MDE 에이전트의 상태 상태
폴더 권한 필요한 폴더 권한이 충족되는지 여부입니다.

제외 모드

이 모드는 audit-d 모니터링에 대한 제외 항목을 추가합니다.


  -h, --help            show this help message and exit
  -e <executable>, --exe <executable>
                        exclude by executable name, i.e: bash
  -p <process id>, --pid <process id>
                        exclude by process id, i.e: 911
  -d <directory>, --dir <directory>
                        exclude by target path, i.e: /var/foo/bar
  -x <executable> <directory>, --exe_dir <executable> <directory>
                        exclude by executable path and target path, i.e: /bin/bash /var/foo/bar
  -q <q_size>, --queue <q_size>
                        set dispatcher q_depth size
  -r, --remove          remove exclusion file
  -s, --stat            get statistics about common executables
  -l, --list            list auditd rules
  -o, --override        Override the existing auditd exclusion rules file for mdatp
  -c <syscall number>, --syscall <syscall number>
                        exclude all process of the given syscall

사용 예제:

sudo ./MDESupportTool exclude -d /var/foo/bar`

엔드포인트용 Defender에서 라이브 응답을 사용하여 지원 로그 수집

클라이언트 분석기는 Linux용 엔드포인트용 Microsoft Defender에 이미 포함된 버전을 사용하거나, 클라이언트 분석기를 바이너리 또는 Python 패키지로 다운로드하여 장치에서 압축을 풀어 실시간 응답 세션 중에 실행할 수 있습니다.

  • 설치의 경우 패키지가 unzip 필요합니다.
  • 실행의 경우 패키지가 acl 필요합니다.

중요

Windows는 캐리지 리턴 및 줄 바꿈 보이지 않는 문자를 사용하여 파일에서 한 줄의 끝과 새 줄의 시작을 나타냅니다. Linux 시스템은 파일의 각 줄 끝에 라인 피드(LF)라는 보이지 않는 문자만 사용합니다. 다음 스크립트를 사용하는 경우 Windows에서 수행하면 이 차이로 인해 스크립트가 실행되고 오류가 발생할 수 있습니다. 이에 대한 잠재적 해결 방법은 WSL(Linux용 Windows 하위 시스템) 및 패키지를 활용하여 Unix 및 dos2unix Linux 형식 표준에 맞게 스크립트를 다시 포맷하는 것입니다.

Linux용 Defender for Endpoint 문제 해결 문서