Onboarding Linux servers with Microsoft Defender for Endpoint - mattnovitsch/M365 GitHub Wiki

Summary:

This will walk you through the process of onboarding Microsoft Defender for Endpoint on Redhat Linux devices.

Deployment Steps:

  1. Now we need to download the onboarding script to your workstation from Defender XDR:
    Navigate to https://security.microsoft.com/

  2. Navigate to Settings > Endpoints > Onboarding

  3. Select Linux Servers and then Download onboarding package. image

  4. Unzip the file and remember its location. image

  5. Open an Administrative PowerShell.

  6. We will use the SCP command to upload the py script to the Linux Server:
    scp -P 22 .\MicrosoftDefenderATPOnboardingLinuxServer.py <username>@<IP Address or servername>:/home/<username>/Desktop/
    • It should prompt you for your password.
    image

  7. Install yum-utils if it isn't installed yet: sudo yum install yum-utils sudo yum-config-manager --add-repo=https://packages.microsoft.com/config/rhel/9/prod.repo

  8. Install the Microsoft GPG public key: sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

  9. Check and/or Install Python.
    python --version
    sudo dnf install python3

  10. Install MDE
    sudo yum install mdatp

  11. Change directory to the location where you placed the onboarding package.
    cd Desktop

  12. Run the python script to create the onboarding package.
    sudo python MicrosoftDefenderATPOnboardingLinuxServer.py

  13. Check the MDE client is pointing to your tenant:
    mdatp health --field org_id

  14. You should see your OrgID returned, if you do then you are complete. It should show up in the console within 15 minutes to a couple of hours(mine were both in 15 minutes).

Troubleshooting Steps:

If you need to turn off or uninstall MDE from the device:

  • For Uninstall: sudo yum remove mdatp
  • For stopping the service: sudo service mdatp stop
  • For restarting the service:sudo service mdatp restart

Official references and sources:

Next Steps:

Now that we have the Linux device onboarded with MDE, we need to push policies to them. Please see the next section: How to push policy to Linux devices from Intune

⚠️ **GitHub.com Fallback** ⚠️