Mặc dù nhiều user Linux ngoài enterprise có thể không hiểu điểm của công cụ Microsoft trên Linux, những người bên trong sẽ hiểu chúng có thể invaluable. Khả năng tích hợp với Active Directory và nhiều hệ sinh thái Microsoft đã chiếm chỗ workplace là huge cho desktop Linux, và có thể làm distro yêu thích của bạn viable OS hơn ở workplace. Một phần quan trọng của enterprise là security. Hướng dẫn này chỉ cách cài và dùng Microsoft Defender trên Linux để chắc chắn IT department quét threat trên máy bạn.
Cách Cài Đặt Microsoft Defender Trong Linux
Để cài Microsoft defender trên Linux, instruction khác nhau tùy distro. Microsoft chưa đưa package vào repo, nên bạn phải chắc dependencies đúng và add repo.
Distro Dựa Trên RPM
Bạn cần yum-utils hoặc dnf-utils:
sudo dnf instll yum-utils
Để config Microsoft repo, syntax cơ bản:
https://packages.microsoft.com/config/[distro]/[version]/[channel].repo
Bạn có thể explore mirror để xem muốn gì. Tôi dùng prod.repo cho consistency, vì tất cả distro có prod.repo hoặc prod.list. Với Fedora, lệnh sẽ là:
sudo yum-config-manager --add-repo=https://packages.microsoft.com/config/fedora/33/prod.repo
Cho hệ thống CentOS tôi model, lệnh sẽ là:
sudo yum-config-manager --add-repo=https://packages.microsoft.com/config/centos/8/prod.repo
Tôi dùng lệnh yum vì target RHEL, CentOS, Oracle Linux, nhưng bạn cũng dùng dnf. Bạn cũng cần import Microsoft GPG key:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
Chạy quick update:
sudo yum update
Sau đó, bạn có thể cài package. Tên là mdatp, Microsoft Defender Advanced Threat Protection.
sudo yum install mdatp
Hệ Thống Debian/Ubuntu
Bạn cần thêm dependencies:
sudo apt install curl libplist-utils
Sau đó follow quy trình giống nhau:
curl -o microsoft.list https://packages.microsoft.com/config/ubuntu/20.04/prod.list sudo mv ./microsoft.list /etc/apt/sources.list.d/microsoft-prod.list sudo apt install gpg curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo apt install apt-transport-https sudo apt update sudo apt install mdatp
Cài repo, GPG key, dependencies, và mdatp.
Sử Dụng Microsoft Defender Trên Linux
Chạy Quét (Running Scans)
Một trong những điều chính bạn muốn làm là scan hệ thống threat. Mở terminal gõ:
mdatp scan full
Sẽ scan bao nhiêu file nó có access (trong trường hợp tôi 329,812) và report threat nó biết. Bạn cũng chạy quick hoặc custom scan. Option custom cho phép chỉ định directory/file hoặc ignore exclusion bạn set trước. Bạn có thể chạy scan như:
mdatp scan custom --path /PATH/TO/DIRECTORY --ignore-exclusions
Nếu bạn set exclusion như dưới, bạn có thể chạy scan trên.
Cập Nhật Signature (Updating Signatures)
Để update virus signature trên Microsoft Defender Linux, update như package khác.
sudo yum update mdatp sudo apt-get upgrade mdatp
Thiết Lập Exclusion (Setting Exclusions)
Để tạo exclusion cho file known good không bị report, bạn làm vài cách. Để exclude file type, dùng lệnh:
mdatp exclusion extension add --name .png
Sẽ lấy tất cả file .png đưa vào exclusion list. Tôi không nhất thiết khuyến nghị, nhưng nếu bạn có file type cụ thể bạn tạo biết sẽ không cần scan, dùng lệnh đó.
Để tạo exclusion cho directory, dùng lệnh tương tự:
mdatp exclusion folder add --path /PATH/TO/DIRECTORY/
Bây giờ, directory bạn nói mdatp exclude sẽ không bị scan. Hữu ích nếu bạn có security testing tool trên hệ thống, vì chúng chứa virus signature có thể trip antivirus.
Hy vọng bạn thích hướng dẫn cài và dùng Microsoft Defender Linux. Nếu không keen dùng Microsoft Defender, xem antivirus khác cho Linux hoặc học cách scan rootkit và virus trong Linux.