{"id":30990,"date":"2025-10-08T20:21:35","date_gmt":"2025-10-08T20:21:35","guid":{"rendered":"https:\/\/endusersupports.com\/?p=30990"},"modified":"2026-05-09T07:26:01","modified_gmt":"2026-05-09T07:26:01","slug":"how-to-create-detection-rule-in-microsoft-defender-for-endpoints","status":"publish","type":"post","link":"https:\/\/endusersupports.com\/index.php\/2025\/10\/08\/how-to-create-detection-rule-in-microsoft-defender-for-endpoints\/","title":{"rendered":"How to Create Detection Rule in Microsoft Defender for Endpoints"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"30990\" class=\"elementor elementor-30990\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9d91522 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9d91522\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5752a8f\" data-id=\"5752a8f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9c07f7d elementor-widget elementor-widget-text-editor\" data-id=\"9c07f7d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #ffffff;\"><b>How to create Detection rule in Microsoft Defender<\/b><\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2b920e3 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2b920e3\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-312facb\" data-id=\"312facb\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-34d73af elementor-widget elementor-widget-text-editor\" data-id=\"34d73af\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div>A custom detection rule is a rule you create using KQL that runs on endpoint telemetry and raises an alert when your defined suspicious conditions are met.<\/div><div><div>\u00a0<\/div><div>A Custom Detection Rule in Microsoft Defender for Endpoint (MDE) is a user\u2011defined rule that automatically generates alerts based on Advanced Hunting queries. It allows security teams to detect environment\u2011specific threats that aren\u2019t covered by Microsoft\u2019s built\u2011in detections.<\/div><\/div><div>\u00a0<\/div><div><h6><strong>Custom Detection Rules uses.<\/strong><\/h6><div><div><p>Microsoft\u2019s default detections cover common and known attack patterns.<br \/>Custom detection rules are used when you want to detect:<\/p><ul><li>Organization\u2011specific attack techniques<\/li><li>Abuse of internal tools or scripts<\/li><li>Rare admin or PowerShell activity<\/li><li>Suspicious behavior not blocked but worth alerting on<\/li><li>Early indicators of compromise (IOC\u2011based or behavior\u2011based)<\/li><\/ul><h6><strong>How Custom Detection Rules Work<\/strong><\/h6><\/div><div><ol><li>Telemetry is collected from endpoints (processes, files, network, registry, logons, etc.)<\/li><li>A KQL query (Advanced Hunting query) is defined<\/li><li>MDE runs the query on a schedule<\/li><li>If conditions match \u2192 Alert is generated<\/li><li>Alert is added to an Incident for triage and response<\/li><\/ol><p><span style=\"color: #0000ff;\">\u00a0Custom detection rules detect and alert \u2014 they do not block activity.<\/span><\/p><h6>KQL Query<\/h6><div><p>Uses Advanced Hunting tables, such as:<\/p><ul><li><code>DeviceProcessEvents<\/code><\/li><li><code>DeviceNetworkEvents<\/code><\/li><li><code>DeviceFileEvents<\/code><\/li><li><code>DeviceLogonEvents<\/code><\/li><li><code>DeviceRegistryEvents<\/code><\/li><\/ul><p><!--ScriptorStartFragment--><\/p><blockquote><div class=\"scriptor-paragraph\">DeviceProcessEvents<\/div><div class=\"scriptor-paragraph\">| where InitiatingProcessFileName == &#8220;winword.exe&#8221;<\/div><div class=\"scriptor-paragraph\">| where FileName in (&#8220;powershell.exe&#8221;, &#8220;cmd.exe&#8221;)<\/div><\/blockquote><div><h6>Rule Frequency<\/h6><p>Controls how often the rule runs:<\/p><ul><li>Every hour<\/li><li>Every day<\/li><li>Custom interval<\/li><\/ul><div><h6>Alert Threshold<\/h6><p>Defines when an alert should trigger:<\/p><ul><li>Any matching event<\/li><li>After a certain number of events<\/li><li>Grouped by:<ul><li>Device<\/li><li>User<\/li><li>Process<\/li><\/ul><\/li><\/ul><\/div><\/div><\/div><\/div><\/div><\/div>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>How to create Detection rule in Microsoft Defender A custom detection rule is a rule you create using KQL that runs on endpoint telemetry and raises an alert when your defined suspicious conditions are met.\u00a0A Custom Detection Rule in Microsoft Defender for Endpoint (MDE) is a user\u2011defined rule that automatically generates alerts based on Advanced [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":31034,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-30990","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-defender-for-endpoint"],"views":14,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts\/30990","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/comments?post=30990"}],"version-history":[{"count":10,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts\/30990\/revisions"}],"predecessor-version":[{"id":31023,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/posts\/30990\/revisions\/31023"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/media\/31034"}],"wp:attachment":[{"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/media?parent=30990"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/categories?post=30990"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/endusersupports.com\/index.php\/wp-json\/wp\/v2\/tags?post=30990"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}