Detect Github CLI commands in Microsoft Defender for Endpoint (MDE) Advanced Hunting on December 30, 2022 Get link Facebook X Pinterest Email Other Apps I will introduce how to detect the log when issuing CLI commands with Advanced Hunting of Microsoft Defender for Endpoint (MDE). ## Overview of response method - Devices with Microsoft Defender for Endpoint (MDE) onboarded collect device process events. - Attempt to detect collected device process events using Microsoft Defender for Endpoint (MDE) Advanced Hunting custom alerts. - Github is used as a sample to introduce the procedure, but other platforms such as Gitlab and Bitbacket can also be detected as long as information remains in the event of the device process. ## Setting method 1. Create a new query in MDE [Pursuit] > [Advanced Pursuit] and enter the following query contents. DeviceProcessEvents | where Timestamp > ago(12h) | where ProcessCommandLine contains "github.com" | project DeviceId, Timestamp,InitiatingProcessAccountUpn, ProcessCommandLine, ReportId 2. On the same screen, create a custom alert that detects commands on [Create detection rule]. 3. The items for custom alert settings are as follows. (Enter any value for items that are not specified.) - For "Detection name", I think it would be good to define an easy-to-understand title such as "Githab command issued". - Set "Frequency" to "every 3 hours". - Set "Category" to "Suspicious Activity". - Specify "DeviceID" for "Affected entity". - "Action" does not need to be specified. - Specify any range for "Range". ## Check - Make sure the custom detection you created is registered in Pursuit > Detection Rules in MDE. - Send a command to Github and check the operation. - Alerts can be viewed in MDE under [Incidents & Alerts] > [Incidents]. Comments
Comments
Post a Comment