You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: defender-endpoint/schedule-antivirus-scan-anacron.md
+35-24Lines changed: 35 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
-
title: Schedule an antivirus scan using Anacron in Microsoft Defender for Endpoint on Linux
2
+
title: Schedule an antivirus scan using Anacron with Microsoft Defender for Endpoint on Linux
3
3
description: Learn how to schedule an antivirus scan in Microsoft Defender for Endpoint on Linux for better protection of your organization's assets.
4
4
ms.service: defender-endpoint
5
5
ms.author: deniseb
6
6
author: denisebmsft
7
7
ms.localizationpriority: medium
8
-
ms.date: 12/02/2023
8
+
ms.date: 03/24/2025
9
9
manager: deniseb
10
10
audience: ITPro
11
11
ms.collection:
@@ -17,18 +17,15 @@ ms.subservice: linux
17
17
search.appverid: met150
18
18
---
19
19
20
-
# Schedule an antivirus scan using Anacron in Microsoft Defender for Endpoint on Linux
20
+
# Schedule an antivirus scan using Anacron with Microsoft Defender for Endpoint on Linux
21
21
22
22
**Applies to:**
23
23
24
24
- Microsoft Defender for Endpoint for servers
25
25
- Microsoft Defender for Servers Plan 1 or Plan 2
26
26
- Microsoft Defender Antivirus
27
27
28
-
To run a scan of Microsoft Defender Antivirus for Linux, see [Supported Commands](linux-resources.md#supported-commands).
29
-
30
-
> [!NOTE]
31
-
> This article supports Microsoft Defender for Endpoint on Linux for Red Hat Enterprise Linux distributions (RHEL).
28
+
To run a scan of Microsoft Defender Antivirus for Linux, see [Supported commands](linux-resources.md#supported-commands).
32
29
33
30
## System requirements
34
31
@@ -37,23 +34,27 @@ See the following system requirements needed to schedule Microsoft Defender Anti
37
34
- Linux distributions and versions: Red Hat Enterprise Linux 7.2 or higher.
38
35
- The **FANOTIFY** option in kernel must be enabled.
39
36
37
+
Also see [Prerequisites for Microsoft Defender for Endpoint on Linux](mde-linux-prerequisites.md).
38
+
40
39
## Scheduling Microsoft Defender Antivirus scan in Red Hat Linux
41
40
42
-
You can schedule cron jobs to initiate Microsoft Defender Antivirus scans on a schedule. For more information, see [How to schedule scans with Microsoft Defender for Endpoint on Linux](schedule-antivirus-scan-crontab.md). This process works well if the device is always up and running.
41
+
You can [schedule cron jobs to initiate Microsoft Defender Antivirus scans on a schedule](schedule-antivirus-scan-crontab.md). This process works well if the device is always up and running.
43
42
44
-
But if the Linux devices are shut down or offline during the cron schedule, the scan won't run. In these situations, you can use **anacron** to read the timestamp and find the last executed job. If the device was shut down during the scheduled cron job, it needs to wait until the next scheduled time. By using **anacron**, the system will detect the last time the scan was run. If the device didn't run the cron job, it will automatically start it.
43
+
But if the Linux devices are shut down or offline during the cron schedule, scans don't run. In these situations, you can use **anacron** to read the timestamp and find the last executed job. If the device was shut down during the scheduled cron job, it needs to wait until the next scheduled time. By using **anacron**, the system will detect the last time the scan was run. If the device didn't run the cron job, it will automatically start it.
45
44
46
45
### Schedule Microsoft Defender Antivirus scans in Red Hat Linux
3. Review and edit your Anacron file, which contains the following information:
57
58
58
59
```shell
59
60
# /etc/anacrontab: configuration file for anacron
@@ -66,19 +67,24 @@ Use the following steps to schedule scans:
66
67
# delay will be 5 minutes + RANDOM_DELAY for cron.daily
67
68
```
68
69
69
-
1. Note the following items in the file.
70
-
1.**Shell:** Shell is referred as `/bin/sh`, and not as `/bin/bash`. Remember when writing the jobs.
71
-
1.**RANDOM_DELAY:** Describes the maximum time in minutes for the job. This value is used to offset the jobs so there wouldn't be too many jobs running at the same time. Using this delay is ideal for VDI solutions.
72
-
1.**START_HOURS_RANGE:** Describes the time range to run the job.
73
-
1.**cron.daily:** Describes 1 as the period of days required for the frequency of job executions. 5 is the delay in minutes that anacron waits after the device restarts.
70
+
Notice the following items in the file:
71
+
72
+
-**Shell** is referred as `/bin/sh`, and not as `/bin/bash`. Remember this when you're configuring jobs.
73
+
-**RANDOM_DELAY** describes the maximum time in minutes for the job. This value is used to offset the jobs so there aren't too many jobs running at the same time. Using this delay is ideal for VDI solutions.
74
+
-**START_HOURS_RANGE** describes the time range to run the job.
75
+
-**cron.daily** describes `1` as the period of days required for the frequency of job executions. `5 is the delay in minutes that anacron waits after the device restarts.
74
76
75
-
1. Review look at the anacron jobs:
77
+
4. Review your anacron jobs by using the following command:
Copy file name to clipboardExpand all lines: defender-endpoint/schedule-antivirus-scan-crontab.md
+16-13Lines changed: 16 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: How to schedule scans with Microsoft Defender for Endpoint (Linux)
2
+
title: Schedule an antivirus scan using crontab with Microsoft Defender for Endpoint on Linux
3
3
description: Learn how to schedule an automatic scanning time for Microsoft Defender for Endpoint (Linux) to better protect your organization's assets.
4
4
ms.service: defender-endpoint
5
5
ms.author: deniseb
@@ -15,17 +15,17 @@ ms.collection:
15
15
ms.topic: conceptual
16
16
ms.subservice: linux
17
17
search.appverid: met150
18
-
ms.date: 10/11/2024
18
+
ms.date: 03/24/2025
19
19
---
20
20
21
-
# Schedule scans with Microsoft Defender for Endpoint (Linux)
21
+
# Schedule an antivirus scan using crontab with Microsoft Defender for Endpoint on Linux
22
22
23
23
**Applies to:**
24
24
25
25
- Microsoft Defender for Endpoint for servers
26
26
- Microsoft Defender for Servers Plan 1 or Plan 2
27
27
28
-
To run a scan for Linux, see [Supported Commands](linux-resources.md#supported-commands).
28
+
To run a scan for Linux, see [Supported commands](linux-resources.md#supported-commands).
29
29
30
30
For Linux (and Unix), you can use a tool called **crontab** (similar to Task Scheduler in Windows) to run scheduled tasks.
31
31
@@ -41,9 +41,9 @@ For Linux (and Unix), you can use a tool called **crontab** (similar to Task Sch
41
41
> -`America/Chicago`
42
42
> -`America/Denver`
43
43
44
-
## To set the Cron job
44
+
## Set the Cron job
45
45
46
-
Use the following commands:
46
+
To set the cron job, use the commands in this article.
47
47
48
48
### Backup crontab entries
49
49
@@ -72,9 +72,7 @@ You might see:
72
72
0 * * * * /etc/opt/microsoft/mdatp/logrorate.sh
73
73
```
74
74
75
-
Press "Insert"
76
-
77
-
Add the following entries:
75
+
Press **Insert**, and then add the following entries:
78
76
79
77
```bash
80
78
CRON_TZ=America/Los_Angeles
@@ -85,9 +83,7 @@ CRON_TZ=America/Los_Angeles
85
83
> [!NOTE]
86
84
> In this example, we have set it to 00 minutes, 2 a.m. (hour in 24 hour format), any day of the month, any month, on Saturdays. Meaning it will run Saturdays at 2:00 a.m. Pacific (UTC -8).
87
85
88
-
Press "Esc"
89
-
90
-
Type "`:wq`" without the double quotes.
86
+
Press **Esc**, and then type "`:wq`" without the double quotes.
91
87
92
88
> [!NOTE]
93
89
> w == write, q == quit
@@ -134,7 +130,7 @@ For more information, see [Chef documentation](https://docs.chef.io/resources/cr
134
130
Resource Type: cron
135
131
```
136
132
137
-
See <https://puppet.com/docs/puppet/5.5/types/cron.html> for more information.
133
+
For more information, see [Puppet documentation: Resource Type: cron](https://puppet.com/docs/puppet/5.5/types/cron.html).
138
134
139
135
**Automating with Puppet: Cron jobs and scheduled tasks**
140
136
@@ -231,4 +227,11 @@ crontab -u username -r
231
227
| | | | +—- day of week (values: 0 - 6) (Sunday=0 or 7) (special characters: , \- \* / L W C) <br>
232
228
| | | | |*****command to be executed
233
229
```
230
+
231
+
## See also
232
+
233
+
-[Microsoft Defender for Endpoint on Linux](microsoft-defender-endpoint-linux.md)
234
+
-[Prerequisites for Microsoft Defender for Endpoint on Linux](mde-linux-prerequisites.md)
235
+
-[Configure security settings and policies for Microsoft Defender for Endpoint on Linux](linux-preferences.md)
236
+
234
237
[!INCLUDE [Microsoft Defender for Endpoint Tech Community](../includes/defender-mde-techcommunity.md)]
Copy file name to clipboardExpand all lines: defender-office-365/preset-security-policies.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ ms.custom:
16
16
description: Admins can learn how to apply Standard and Strict policy settings across the protection features of Exchange Online Protection (EOP) and Microsoft Defender for Office 365
- ✅ <a href="https://learn.microsoft.com/defender-office-365/mdo-about#defender-for-office-365-plan-1-vs-plan-2-cheat-sheet" target="_blank">Microsoft Defender for Office 365 Plan 1 and Plan 2</a>
@@ -33,9 +33,9 @@ Depending on your organization, preset security policies provide many of the pro
33
33
34
34
The following preset security policies are available:
35
35
36
-
-**Standard** preset security policy
37
-
-**Strict** preset security policy
38
-
-**Built-in protection** preset security policy (default policies for Safe Attachments and Safe Links protection in Defender for Office 365)
36
+
-**Standard** preset security policy.
37
+
-**Strict** preset security policy.
38
+
-**Built-in protection** preset security policy (default policies for Safe Attachments and Safe Links protection in Defender for Office 365; applied to all users who aren't specifically excluded, or who aren't included in the **Standard** or **Strict** preset security policies, or in custom Safe Attachments or Safe Links policies).
39
39
40
40
For details about these preset security policies, see the [Appendix](#appendix) section at the end of this article.
41
41
@@ -190,7 +190,7 @@ To disable the **Standard protection** or **Strict protection** preset security
190
190
> [!TIP]
191
191
> The **Built-in protection** preset security policy is applied to all users in organizations with any amount of licenses for Defender for Office 365. Application of this protection is in the spirit of securing the broadest set of users until admins specifically configure Defender for Office 365 protections. Because **Built-in protection** is enabled by default, customers don't need to worry about violating product licensing terms. However, we recommend purchasing enough Defender for Office 365 licenses to ensure **Built-in protection** continues for all users.
192
192
>
193
-
> The **Built-in protection** preset security policy doesn't affect recipients who are defined in the **Standard** or **Strict** preset security policies, or in custom Safe Links or Safe Attachments policies. Therefore, we typically don't recommend exceptions to the **Built-in protection** preset security policy, unless you want to exclude users who aren't eligible for Safe Links and Safe Attachments protections (users who lack Defender for Office 365 licenses).
193
+
> <u>The **Built-in protection** preset security policy doesn't affect recipients who are defined in the **Standard** or **Strict** preset security policies, or in custom Safe Links or Safe Attachments policies</u>. Therefore, we typically don't recommend exceptions to the **Built-in protection** preset security policy, unless you want to exclude users who aren't eligible for Safe Links and Safe Attachments protections (users who lack Defender for Office 365 licenses).
194
194
195
195
1. In the Microsoft Defender portal at <https://security.microsoft.com>, go to **Email & Collaboration**\>**Policies & Rules**\>**Threat policies**\>**Preset Security Policies** in the **Templated policies** section. Or, to go directly to the **Preset security policies** page, use <https://security.microsoft.com/presetSecurityPolicies>.
0 commit comments