Help Center/ Host Security Service/ User Guide/ Server Protection/ WTP/ Enabling Web Tamper Protection
Updated on 2025-08-26 GMT+08:00

Enabling Web Tamper Protection

Scenarios

The HSS web tamper protection (WTP) edition can protect dynamic and static web pages from being tampered with, enhancing the security and integrity of website content. It also includes the server protection capabilities of the premium edition, such as asset management, vulnerability detection, baseline check, intrusion detection, and ransomware protection, to detect attacks on servers.

This section describes how to enable WTP.

Prerequisites

Constraints

Before you enable protection for a Windows server, enable the Windows firewall to block the source IP addresses of brute-force attacks. If the Windows firewall is not enabled, HSS only generates alarms for detected brute-force attacks, but does not block them.
  • After the Windows firewall is enabled, HSS automatically adds firewall rules hostguard_AllowAnyIn and hostguard_AllowAnyOut to allow all inbound and outbound traffic. This ensures that the firewall does not affect your services. If HSS detects a brute-force attack, it adds an inbound rule to the firewall to block the attack source IP address. This does not affect your servers.
  • Do not disable the Windows firewall when using HSS, or HSS cannot block the source IP addresses of brute-force attacks. Once it is disabled, HSS may fail to block the attack source IP addresses even after you manually enable it again.

Enabling Web Tamper Protection

WTP can be enabled for one or multiple servers at a time. When you enable WTP for multiple servers at a time, the same protected directory settings will be applied to all of them, and cannot be customized for each server. If these servers have different directories to be protected, you can customize the protected directories or other settings for them separately after WTP is enabled. For details, see Modifying WTP Configuration.

  1. Log in to the management console.
  2. Click in the upper left corner of the page, select a region, and choose Security & Compliance > Host Security Service to go to the HSS management console.
  3. In the navigation pane, choose Server Protection > Web Tamper Protection.

    Figure 1 Web tamper protection

  4. On the Servers tab, click Add Server. The Add Server page is displayed.
  5. On the Add Server page, select servers and click Next. For more information, see Table 1.

    Figure 2 Selecting servers
    Table 1 Parameters for selecting protected servers

    Parameter

    Description

    Example Value

    OS

    Select the OS type of the server to be protected by WTP.

    • Linux
    • Windows

    Linux

    Select Servers

    Select servers.

    You can filter the servers by software type or other attributes.

    -

    Select Quota

    The HSS WTP edition supports two billing modes, yearly/monthly and pay-per-use billing, to meet requirements in different scenarios.

    • Yearly/Monthly billing is a prepaid mode in which you pay for the service before using it. Your bill is generated based on the required duration you specify in the order. The longer you use the service, the more discounts you got.
    • Pay-per-use is a postpaid billing mode. You pay as you go and just pay for what you use. The HSS usage is calculated by the second but billed every hour. With the pay-per-use billing mode, you can easily adapt to resource requirement changes, reducing the risk of over-provisioning resources or lacking capacity. In this mode, there are no upfront commitments required.

    When selecting the yearly/monthly billing mode, you can select a quota or retain the default value Select a quota randomly.

    Yearly/Monthly

    Agreement

    Before enabling WTP, ensure that you have read the Host Security Service Disclaimer.

    Select I have read and agree to the Host Security Service Disclaimer.

    Selected

  6. On the Add Server page, configure policies. For more information, see Table 2.

    Figure 3 Configuring policies
    Table 2 Parameters for configuring rules

    Parameter

    Description

    Example Value

    Protected Directory

    WTP supports static and dynamic web page protection. Static WTP protects specified directories by locking files in the web file directory in the drive to prevent attackers from modifying the files. Therefore, when configuring a protection policy, you need to specify the directories to be protected.

    After a directory is protected, the files and folders in the directory will become read-only.

    The requirements for adding a protected directory are as follows:

    • For Linux,
      • It cannot start with a space, end with a slash (/), or contain semi-colons (;). Up to 256 characters are allowed.
      • A server can have up to 50 protected directories.
      • The folder levels of a protected directory cannot exceed 100.
      • The total folders in protected directories cannot exceed 900,000.
    • For Windows,
      • Up to 256 characters are allowed. The directory name cannot start with a space or end with a backslash (\). It cannot contain the following characters: ;/*?"<>|
      • A server can have up to 50 protected directories.

    Do not add network directories as protected directories. The reasons are as follows:

    • Inefficient detection

      A network directory usually contains a large number of files and may reach hundreds of terabytes, severely slowing down a scan.

    • Network bandwidth consumption

      Accessing a network directory consumes network bandwidth. A large-scale scan may fully occupy the network bandwidth and affect your workloads. For example, the access speed may slow down and the network latency may increase.

    • Linux: /etc/lesuo
    • Windows: d:\web

    Excluded Subdirectory (Optional)

    If a protected directory contains subdirectories that do not need to be protected, you can exclude the subdirectories.

    The requirements for adding a subdirectory are as follows:

    • Enter a subdirectory name or the relative subdirectory path under a protected directory. If you enter a subdirectory name, all subdirectories that match the name will be excluded, regardless of their levels.
    • A subdirectory name or path cannot start or end with a slash (/) and can contain up to 256 characters.
    • Up to 10 subdirectories can be added. Use semicolons (;) to separate multiple subdirectories.
    • Linux: data/cache or cache
    • Windows: web\test or test

    Excluded File Path (Optional)

    This item is available only for Linux servers.

    If a protected directory contains files that do not need to be protected, exclude the files.

    The requirements for adding excluded file paths are as follows:

    • Enter a file name or the relative file path under a protected directory. If you enter a file name, all files that match the name will be excluded, regardless of their levels.
    • A file name or path cannot start or end with a slash (/), and can contain up to 256 characters.
    • Up to 50 files can be added. Use semicolons (;) to separate multiple files.

    data/ma.txt or ma.txt

    Local Backup Path

    This item is available only for Linux servers.

    Set a local backup path for a protected directory. After WTP is enabled, files in the protected directory are automatically backed up to the local backup path. Once the system detects that a file in the protected directory is tampered with, it immediately uses the local backup to restore the tampered file.

    The requirements for adding local backup paths are as follows:

    • A local backup path cannot contain semicolons (;), start with a space, or end with a slash (/). Up to 256 characters are allowed.
    • Key system directories are a main attack target and cannot be used as backup paths, including but not limited to /etc/, /bin/, /usr/bin/, /var/spool/, /usr/sbin/, /sbin/, /usr/lib/, /lib/, /lib64/, /usr/lib64/, and their subdirectories.

    Local backup rule description:

    • The local backup path must be valid and cannot overlap with the protected directory path.
    • Excluded subdirectories and types of files are not backed up.
    • Generally, the backup completes within 10 minutes. The actual duration depends on the size of files in the protected directory.

    /backup

    Excluded File Type

    If a protected directory contains files of certain types that do not need to be protected, exclude these file types, for example, logs. You can exclude any type of files.

    To record the running status of servers in real time, exclude the log files in the protected directory. You can set high permission requirements for log read and write, so that attackers cannot view or tamper with log files.

    log

    Type

    Action taken when file tampering is detected.

    • Alarm: Only alarms are reported.
    • Block: An alarm is reported, and the file is restored to the status before being tampered with.

    Block

    Scheduled Protection (Optional)

    You can schedule when to disable static WTP. In the unprotected period, you can modify, update, or release web pages.

    Click to enable scheduled protection and configure the following parameters:

    • Unprotected Time Range

      A time range when WTP is disabled within a day, for example, 10:05 to 15:35.

      Requirements:

      • A time range must be at least 5 minutes.
      • Time ranges (except for those starting at 00:00 or ending at 23:59) cannot overlap and must have at least a 5-minute interval.
      • All time ranges are subject to the system time of the server.
    • Unprotected Days of a Week

      Static WTP is automatically disabled on specified days of a week, for example, Wednesday and Thursday.

    , 10:05-15:35, Wednesday

    Dynamic WTP (Optional)

    Dynamic WTP is mainly used to protect Tomcat applications on Linux. It can detect and prevent tampering with dynamic data, such as database data, in real time during application running.

    Currently, dynamic WTP can protect Tomcat applications using JDK 8, JDK 11, and JDK 17.

    To enable dynamic WTP, click and enter a complete Tomcat bin directory path, for example, /usr/workspace/apache-tomcat-8.5.15/bin. The system presets the setenv.sh script in the bin directory to configure the startup parameters of the anti-tamper program.

    , /usr/workspace/apache-tomcat-8.5.15/bin

    Configure Privileged Processes (Optional)

    A privileged process is a process authorized to modify a protected directory.

    After WTP is enabled, all files in the protected directory will be set to read-only and cannot be modified. If anyone attempts to modify a file or website, the system will automatically restore it to the status before the modification.

    You can add privileged processes and use them to modify the files in protected directories or update websites. Ensure the specified privileged processes, which are authorized to access protected directories, are secure and reliable.

    This feature is compatible with Linux and Windows. For Linux, only the distributions using kernel versions 5.10 or later are supported.

    Click to enable the privileged processes and configure the following parameters:

    • Process File Path

      Set one or multiple complete file paths of privileged processes. Put each privileged process file path on a separate line. Up to 10 privileged processes are allowed.

    • Trust Subprocess

      If Trust Subprocess is enabled, HSS will trust all the subprocesses up to five levels deep in the subdirectories of specified directories, and allow the subprocesses to modify protected directories, and allow the subprocesses to modify protected directories.

    • Linux: /Path/Software.type
    • Windows: C:\Path\Software.type

  7. After the policy is configured, click OK.
  8. On the Servers tab, check the static and dynamic WTP status of the server.

    The Protected status indicates protection has been enabled. After dynamic WTP is enabled, restart Tomcat to apply the settings.

Follow-up Operations

HSS provides server protection functions for you to enable as needed. For details, see Table 3.

Table 3 Manual configuration

Type

Function

Reference

Security configuration

  • Common login location/IP address
  • SSH login IP address whitelist
  • Isolating and killing malicious programs

Common Security Configuration

Server Protection

  • Application protection
  • Ransomware prevention
  • Application process control
  • File integrity management
  • Antivirus
  • Dynamic port honeypot

Server Protection

Policy management

Policy management includes asset management, baseline inspection, intrusion detection, and self-protection policies. The intrusion detection policy is disabled by default. You can enable it as needed. If the configuration of a policy does not meet your requirements, you can modify it as needed.

Policy Management