Best practices for configuring the core file monitoring feature
The core file monitoring feature of Security Center monitors file access on your servers in real time, including read, write, delete, rename, and permission change operations. It sends timely alerts to help prevent critical files from being stolen or tampered with. This topic describes guidelines and examples for configuring core file monitoring rules, and explains how to set up DingTalk chatbot alert notifications to help you make better use of this feature.
How core file monitoring complements host intrusion detection
Cybersecurity best practices recommend a multi-layered defense-in-depth strategy. Host intrusion detection identifies suspicious intrusion behaviors in most scenarios. Its detection logic is based on behavioral patterns and focuses on known or unknown malicious behaviors and system activities. Core file monitoring focuses on the integrity of files and directories in the file system and detects unauthorized changes.
The two features complement each other to provide more comprehensive security protection and improve the ability to detect complex threats. Understanding attacker behavior is critical during a security incident. If an attacker reads or modifies files within the scope of rule protection, the alert records from core file monitoring help operations staff trace the attacker's specific activities and perform effective incident response and forensic analysis.
Core file monitoring also detects internal threats such as malicious insider behavior or operational errors. All such activities are recorded by core file monitoring.
Rule configuration guidelines and examples
This section provides configuration guidelines and examples for core file monitoring rules, covering common scenarios and rule configuration instructions. Rules may trigger false positives when they match legitimate operations on different systems. The last column in the following table provides examples of normal operations that may trigger corresponding policy alerts.
To minimize the impact of false positives on system operations, use a gradual rollout approach before broadly deploying rules:
-
Pilot testing — When initially configuring rules, select a small number of machines for a pilot deployment.
-
Close monitoring — During the rule trial period, closely observe the conditions under which each rule is triggered to verify rule accuracy and applicability.
-
Iterative refinement — Based on detection results, add whitelist rules for confirmed benign operations in a timely manner to ensure critical operations do not trigger alerts and reduce the volume of alerts requiring attention.
-
Full deployment — After multiple trials and rule optimizations, when rule triggers stabilize and false positives largely disappear, deploy the configurations to more servers.
|
Type |
Description |
Subtype |
Actions |
Example file paths |
Potential false positives |
|
Core system files |
These directories contain most system commands and shared libraries. Monitoring these directories helps detect potential attacker tampering, including planting malicious binaries or altering system library dependencies. |
System executable binary directories |
write, delete |
|
Package management installations or updates also write to these directories. Additionally, manually compiling and installing software from source (typically using make && make install) may involve writes to these directories. Configure appropriate whitelist rules based on your actual situation to avoid alerts from such normal operations. |
|
Shared library directories |
write, delete |
|
|||
|
Configuration files |
Attackers may modify various critical system configuration files for different malicious purposes. For example:
|
User and permission files |
write |
|
Normal user management commands such as useradd, usermod, userdel, and passwd may write to these files. You can add appropriate whitelist rules based on your specific operational procedures, or use the alert data as audit logs. |
|
Critical system configuration files |
write, delete |
|
Routine operational changes to network settings, name resolution, and kernel parameters may modify these files. |
||
|
Configuration files for operational applications |
write |
|
During system maintenance, configuration updates, security hardening, or periodic key rotation, these files may be modified. Configure corresponding whitelist rules. |
||
|
Security audit configuration files |
write, delete |
|
Initial setup of the audit framework, or adjustments to monitoring policies based on compliance or security requirements, may require modifications to these files. |
||
|
Web service configuration files |
write |
|
Initial web service configuration, post-installation setup, module additions and removals, and web service updates may all result in modifications to these monitored files. |
||
|
Database configuration files |
write |
|
Database service installation and operational changes may cause modifications to these configuration files. Add whitelist rules based on your actual situation. |
||
|
Common persistence locations |
Attackers typically add scheduled tasks, malicious services, or startup scripts to maintain persistent access during periodic execution or after system restarts. |
Cron-related files |
write |
|
Normal operations may add, adjust, or remove existing crontab entries, thereby modifying corresponding files. |
|
Service-related files |
write |
|
Installing service-based applications involves adding or modifying system services. |
||
|
Shell configuration files |
write |
|
Operations staff may modify these files when changing default environment settings or creating aliases for frequently used long commands. |
||
|
Web service code directories |
Configuring file monitoring rules for web service code directories helps ensure web application security. Attackers typically exploit vulnerabilities or unauthorized access to upload webshell malicious files. Through these webshell files, attackers can further remotely access, control, and manage compromised servers. Monitoring web service code directories effectively detects potential webshell uploads and unauthorized changes, including web page tampering, malicious script injection, and other malicious activities. |
Web code directories |
write, permission change |
|
During normal business and maintenance operations, service updates and deployments, as well as CMS plugin and theme installations and updates, may write web script files to code directories. Automation deployment tools (such as Jenkins, GitLab CI/CD, and Ansible) also write files during CI/CD processes. In this case, configure specific write process rules, exclude externally uploadable directories, and restrict specific file extensions to ensure security. |
|
Files containing sensitive information |
Leakage of sensitive authentication information is one of the major cybersecurity risks. After gaining access to a host, attackers typically search for sensitive authentication information to perform lateral movement and expand the scope of intrusion. Configuring read operation monitoring for files containing sensitive information can effectively and promptly detect such risks or malicious behaviors. |
Cloud service CLI authentication information |
read |
|
Files containing sensitive information are typically read by their associated applications. For example, Alibaba Cloud CLI reads |
|
Version control authentication information |
read |
|
|||
|
Database configuration |
read |
/ |
|||
|
Private keys for operations and orchestration systems |
read |
|
Configure DingTalk chatbot notifications
After you configure DingTalk chatbot notifications, you can receive real-time threat alert information identified by Security Center through a DingTalk group.
Only Security Center Enterprise Edition and Ultimate Edition support DingTalk chatbot notifications.
Prerequisites
You have created a custom chatbot in the DingTalk group where you want to receive notifications and obtained the chatbot webhook URL. When creating the custom chatbot, configure the corresponding custom keyword in the Security Settings area based on the notification language:
-
Chinese: 云安全中心
-
English: Security
For specific instructions on creating a custom chatbot and obtaining the webhook URL, see Create a custom chatbot and Obtain the webhook URL of a custom chatbot.
Procedure
-
Log on to Security Center console.
-
In the left-side navigation pane, choose . In the upper-left corner of the console, select the region where the asset to be protected is located: Chinese Mainland or Outside Chinese Mainland.
-
On the Notification Settings page, click the DingTalk Chatbot tab, and then click Add Chatbot.
-
In the Add DingTalk Chatbot panel, complete the configuration, and click Add.
Parameter
Description
Example
Chatbot Name
Customize a name for the DingTalk chatbot. Enter a name that is easy to identify.
Core file alert notification
Webhook URL
The webhook URL of the chatbot. You can find the webhook URL of the chatbot in the DingTalk group where you want to use this chatbot.
ImportantKeep the webhook URL confidential. Do not publish it on external websites. A leaked webhook URL may pose security risks.
https://oapi.dingtalk.com/robot/send?access_token=XXXX
Asset Groups
Select an asset group created in Security Center Asset Center. After selection, the DingTalk chatbot sends alert notifications related to assets in the selected group.
Alibaba Cloud
Notify On
Select the alert types (Vulnerability, Baseline Check, Alert, AccessKey Leak Detection, Cloud Honeypot, RASP, Anti-Ransomware, Core File Monitoring, and Malicious File Detection) and risk levels for which you want the DingTalk chatbot to send notifications.
Core File Monitoring/Alert Level/Urgent
Notification Interval
The notification interval of the DingTalk chatbot. Options: 1 minute, 5 minutes, 10 minutes, 30 minutes, or No limit (send a notification in real time for each detected alert).
After you select No limit, a maximum of 20 notifications can be sent per minute per webhook.
30
Language
The language of notifications sent by the DingTalk chatbot. Options: Chinese or English.
Chinese
The newly created DingTalk chatbot notification is in the Enable state by default. After configuration is complete, Security Center sends notifications according to your configured notification policy.
-
(Optional) In the DingTalk chatbot list, find the newly created DingTalk chatbot, and in the Actions column, click Test to verify whether the DingTalk chatbot notification is connected to the DingTalk group.
Related topics
-
For more information about the core file monitoring feature, see Use the core file monitoring feature.
-
If you need to ensure that your website files or directories are not tampered with, you can use the File tamper-proofing feature.