簡介
你可以透過各種工具和方法在 Linux 上部署 Defender for Endpoint 。 本文說明如何透過安裝程式腳本自動化部署 Defender for Endpoint 在 Linux 上。 這個腳本會識別發行版和版本,選擇正確的儲存庫,設定裝置拉取最新的代理版本,並利用啟動套件將裝置導入 Defender for Endpoint。 此方法強烈推薦以簡化部署流程。
如需使用其他方法,請參考 相關內容章節。
重要事項
如果你想並行運行多個安全解決方案,請參閱 效能、設定與支援的考量。
你可能已經為適用於端點的 Microsoft Defender 裝置設定了相互安全排除。 如果你仍需設定相互排除以避免衝突,請參閱「新增 適用於端點的 Microsoft Defender」到你現有解決方案的排除清單中。
前置條件與系統需求
在開始之前,請參考 Linux 上 Defender for Endpoint 的前置條件 說明與系統需求。
部署程序
請依照以下步驟從 Microsoft Defender 入口網站下載入職套件:
在 Microsoft Defender 入口網站中,展開「系統」區塊,選擇「設定>端點>管理>裝置啟動」。
在第一個下拉選單中,選擇 Linux Server 作為作業系統。
在第二個下拉選單中,選擇「 本地腳本 」作為部署方法。
選取 [下載上線套件]。 將檔案儲存為
WindowsDefenderATPOnboardingPackage.zip。從命令提示字元擷取壓縮檔內容:
unzip WindowsDefenderATPOnboardingPackage.zipArchive: WindowsDefenderATPOnboardingPackage.zip inflating: MicrosoftDefenderATPOnboardingLinuxServer.py警告
重新打包 Defender for Endpoint 安裝套件並非支援的情境。 這樣做可能會對產品的完整性產生負面影響,導致不良後果,包括但不限於觸發竄改警示及更新未生效。
重要事項
若漏接此步驟,執行的任何指令都會顯示警告訊息,表示該產品未授權。 另外,mdatp health 指令回傳的值是 false。
下載我們公開 GitHub 倉庫提供的安裝程式 bash 腳本。
授予安裝程式腳本執行檔權限:
chmod +x mde_installer.sh執行安裝程式腳本,並提供導入套件作為參數,安裝代理程式並將裝置接入至 Defender 入口網站。
sudo ./mde_installer.sh --install --onboard ./MicrosoftDefenderATPOnboardingLinuxServer.py --channel prod --min_req此指令會將最新的代理程式版本部署至生產通道,檢查最小系統需求,並將裝置接入 Defender Portal。
此外,你還可以根據需求通過更多參數來修改安裝。 查看幫助以了解所有可用選項:
❯ ./mde_installer.sh --help mde_installer.sh v0.7.0 usage: basename ./mde_installer.sh [OPTIONS] Options: -c|--channel specify the channel(insiders-fast / insiders-slow / prod) from which you want to install. Default: prod -i|--install install the product -r|--remove uninstall the product -u|--upgrade upgrade the existing product to a newer version if available -l|--downgrade downgrade the existing product to a older version if available -o|--onboard onboard the product with <onboarding_script> -f|--offboard offboard the product with <offboarding_script> -p|--passive-mode set real time protection to passive mode -a|--rtp-mode set real time protection to active mode. passive-mode and rtp-mode are mutually exclusive -t|--tag set a tag by declaring <name> and <value>, e.g: -t GROUP Coders -m|--min_req enforce minimum requirements -x|--skip_conflict skip conflicting application verification -w|--clean remove repo from package manager for a specific channel -y|--yes assume yes for all mid-process prompts (default, deprecated) -n|--no remove assume yes sign -s|--verbose verbose output -v|--version print out script version -d|--debug set debug mode --log-path <PATH> also log output to PATH --http-proxy <URL> set http proxy --https-proxy <URL> set https proxy --ftp-proxy <URL> set ftp proxy --mdatp specific version of mde to be installed. will use the latest if not provided -b|--install-path specify the installation and configuration path for MDE. Default: / -h|--help display help案例 命令 安裝到自訂路徑位置 sudo ./mde_installer.sh --install --onboard ./MicrosoftDefenderATPOnboardingLinuxServer.py --channel prod --min_req --install-path /custom/path/location安裝特定的代理版本 sudo ./mde_installer.sh --install --channel prod --onboard ./MicrosoftDefenderATPOnboardingLinuxServer.py --min_req –-mdatp 101.24082.0004升級至最新代理版本 sudo ./mde_installer.sh --upgrade升級到特定代理版本 sudo ./mde_installer.sh --upgrade –-mdatp 101.24082.0004降級至特定代理版本 sudo ./mde_installer.sh --downgrade –-mdatp 101.24082.0004卸載代理 sudo ./mde_installer.sh --remove關於如何安裝自訂路徑的細節,請參考: 在 Linux 上安裝 Defender for Endpoint 以自訂路徑為例。
注意事項
在安裝產品後升級作業系統到新的主要版本時,必須重新安裝產品。 你需要先在 Linux 上卸載現有的 Defender for Endpoint,升級作業系統,然後在 Linux 上重新設定 Defender for Endpoint。
安裝 Defender for Endpoint 後,安裝路徑無法更改。 若要使用不同路徑,請先在新位置卸載並重新安裝產品。
確認部署狀態
在 Microsoft Defender 入口網站中,打開裝置清單。 裝置可能要等 5 到 20 分鐘才會出現在傳送門裡。
執行防毒軟體偵測測試,確認裝置已正確上線並回報給服務單位。 對新上線的裝置執行以下步驟:
確保啟用即時保護 (
true以執行以下指令) 表示:mdatp health --field real_time_protection_enabled如果沒有啟用,請執行以下指令:
mdatp config real-time-protection --value enabled打開終端機視窗並執行以下指令以執行偵測測試:
curl -o /tmp/eicar.com.txt https://secure.eicar.org/eicar.com.txt你可以使用以下任一指令對壓縮檔執行更多偵測測試:
curl -o /tmp/eicar_com.zip https://secure.eicar.org/eicar_com.zip curl -o /tmp/eicarcom2.zip https://secure.eicar.org/eicarcom2.zip這些檔案應該會被 Linux 上的 Defender for Endpoint 隔離。 請使用以下指令列出所有偵測到的威脅:
mdatp threat list
執行 EDR 偵測測試並模擬偵測,以確認裝置已正確上線並向服務單位報告。 對新上線的裝置執行以下步驟:
下載並解壓腳 本檔 到內建的 Linux 伺服器。
授予腳本執行檔權限:
chmod +x mde_linux_edr_diy.sh執行下列命令:
./mde_linux_edr_diy.sh幾分鐘後,Microsoft Defender 全面偵測回應應會升起偵測。
檢查警示細節、機器時間軸,並執行你平常的調查步驟。
適用於端點的 Microsoft Defender 套件外部套件依賴關係
如果 適用於端點的 Microsoft Defender 安裝因缺少相依關係錯誤而失敗,您可以手動下載所需的相依。
以下為該 mdatp 套件提供外部套件相依關係:
- 該
mdatp RPM套件需要——glibc >= 2.17 - 對於 DEBIAN 來說,該
mdatp套件需要libc6 >= 2.23 - 對於 Mariner,該
mdatp套件需要attr,diffutils,libacl,libattrlibselinux-utils,,。selinux-policypolicycoreutils
注意事項
從版本 101.24082.0004開始,Linux 上的 Defender for Endpoint 不再支援事件 Auditd 提供者。 我們正全面轉向更有效率的 eBPF 技術。
如果你 eBPF 的機器不支援,或有特定需求必須維持在 Auditd,且你的機器使用 Linux 版本 101.24072.0001 或更早版本的 Defender for Endpoint,則對審核套件存在 mdatp其他依賴。
對於比 101.25032.0000之前的版本:
- RPM 套件需求:
mde-netfilter,pcre - DEBIAN 套件需求:
mde-netfilter,libpcre3 - 該
mde-netfilter套件還有以下套件相依關係:- 對於 DEBIAN,mde-netfilter 套件需要libnetfilter-queue1和libglib2.0-0- 對於 RPM,mde-netfilter 套件需要libmnl、libnfnetlink、libnetfilter_queue,且glib2從版本101.25042.0003開始,uuid-runtime 不再需要作為外部依賴。
安裝問題的疑難排解
如果你遇到安裝問題,為了自我排查,請遵循以下步驟:
關於安裝錯誤發生時自動產生的日誌,請參見 「安裝日誌問題」。
有關常見安裝問題的資訊,請參見 安裝問題。
若裝置健康狀況為
false,請參見 Defender for Endpoint 代理健康問題。關於產品效能問題,請參見 故障排除效能問題。
關於代理與連線問題,請參見 「排除雲端連線問題」。
要獲得 Microsoft 的支援,請開啟支援單,並提供使用 用戶端分析器建立的日誌檔案。
如何切換頻道
例如,要將頻道從 Insiders-Fast 切換到製作頻道,請執行以下操作:
在 Linux 上卸載
Insiders-Fast channelDefender for Endpoint 版本。sudo yum remove mdatp在 Linux Insiders-Fast 倉庫中停用 Defender for Endpoint。
sudo yum repolist注意事項
輸出應該會顯示
packages-microsoft-com-fast-prod。sudo yum-config-manager --disable packages-microsoft-com-fast-prod使用 Linux 的生產通道重新部署 適用於端點的 Microsoft Defender。
Linux 上的 Defender for Endpoint 可從以下其中一個通道部署 (標記為 [channel]) :
insiders-fastinsiders-slowprod
這些頻道各自對應一個 Linux 軟體倉庫。 本文的說明說明如何設定您的裝置以使用這些儲存庫之一。
頻道的選擇決定了你裝置所提供的更新類型與頻率。 內部人快速裝置是最早獲得更新和新功能的,接著是內部人慢速,最後是生產環境。
為了預覽新功能並提供早期回饋,建議您在企業中設定部分裝置使用 insiders-fast 或 insiders-slow。
警告
初始安裝後切換通道需重新安裝產品。 切換產品通道:解除安裝現有套件,重新設定裝置使用新通道,並依照本文件步驟從新位置安裝套件。
如何在 Linux 上設定 Microsoft Defender 的政策
要設定防毒軟體與EDR設定,請參閱以下文章:
- Defender for Endpoint 安全設定管理說明如何在 Microsoft Defender 入口網站中設定。 (此方法建議採用 )
- Linux 版 Defender for Endpoint 的設定偏好設定是你可以設定的。
相關內容
- Linux 上 適用於端點的 Microsoft Defender 的 Prerequisites
- 在 Linux 上部署 Defender for Endpoint 搭配 Ansible
- 使用 Chef 在 Linux 上部署適用於端點的 Microsoft Defender
- 在 Linux 上部署 Defender for Endpoint with Puppet
- 在 Linux 上部署 Defender for Endpoint 搭配 Saltstack
- 手動在 Linux 上部署 Defender for Endpoint
- 用 Defender for Endpoint 將非 Azure 電腦連接到 Microsoft Defender for Cloud, (直接使用 Defender for Cloud)
- Linux for SAP 上 Defender for Endpoint 的部署指引
- 在 Linux 上安裝 Defender for Endpoint 到自訂路徑
提示
想要深入了解? Engage 與 Microsoft Security 社群互動,加入我們的技術社群:適用於端點的 Microsoft Defender Defender 技術社群