Scenario
You can enable HSS for servers only after installing the agent. This section describes how to install the agent on Huawei Cloud servers.
If you use CBH, you can quickly install the agent on the server through CBH. For details, see Installing the HSS Agent Using CBH.
Prerequisites
- Perform the operations in Checking the Installation Environment to ensure agent installation is not affected by DNS server addresses, third-party security software, or the outbound port settings of security groups.
- Before installing the agent on the HSS console, grant the VPCOperatePolicy and VPCEPOperatePolicy permissions to HSS. For details, see Authorization.
Constraints
- The HSS agent will be automatically installed on Workspace 23.6.0 or later. If your Workspace version is earlier than 23.6.0, you can manually install the agent by referring to this section.
- When you install the agent for multiple servers in batches on the console, the system randomly selects a server in the same VPC as the executor.
Agent Installation Methods
HSS provides two installation methods. For details about their differences, see Table 1.
Installing the Agent on Huawei Cloud Servers on the HSS Console
You can install the agent on the HSS console. Various installation methods are as follows.
Using the Account and Password to Install the Agent on a Single Huawei Cloud Server
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: GUI
- Server Authentication Mode: Account and password
- Scale: Single
- Select a server and click Next.
- Enter the account information and password as prompted.
- Confirm the information and click OK.
You can view the Agent Status column to check the agent installation progress. If the Agent Status is Online, the agent has been installed.
Using the Account and Password to Install the Agent on Multiple Huawei Cloud Servers
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: GUI
- Server Authentication Mode: Account and password
- Scale: Batch
- Upload the installation template.
- Click Download Template to download the batch installation template to your local PC.
Figure 3 Downloading the batch installation template
- Open the downloaded importTemplate.xlsx file, fill in server information as required, and save the file.
- Click Select File and upload the importTemplate.xlsx file.
HSS will automatically parse the file and identify the servers you entered. If the parsing fails, you can click View Failed Servers and check the failure cause.
- Confirm the information and click OK.
You can view the Agent Status column to check the agent installation progress. If the Agent Status is Online, the agent has been installed.
Using DEW to Install the Agent on One or More Huawei Cloud Servers
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: GUI
- Server Authentication Mode: Key
- Key Source: DEW
- Select servers and click OK.
The list of available servers only shows the servers that have been bound to DEW.
Figure 4 Selecting servers
- Locate the row that contains the target server and check the agent installation progress in the Agent Status column.
If the Agent Status is Online, the agent has been installed.
Installing the Agent on One or More Huawei Cloud Servers Using a User-created Key (Linux Only)
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: GUI
- Server Authentication Mode: Key
- Key Source: User-created key (Linux only)
- Upload the installation template.
- Click Download Template to download the batch installation template to your local PC.
Figure 5 Downloading the batch installation template
- Open the downloaded importTemplate.xlsx file, fill in server information as required, and save the file.
- Click Select File and upload the importTemplate.xlsx file.
HSS will automatically parse the file and identify the servers you entered. If the parsing fails, you can click View Failed Servers and check the failure cause.
- Confirm the information and click OK.
- Locate the row that contains the target server and check the agent installation progress in the Agent Status column.
If the Agent Status is Online, the agent has been installed.
Using Commands to Install the Agent on Huawei Cloud Servers
The HSS agent can be installed using commands. You can install the agent on different OSs. Various installation methods are as follows.
Using Commands to Install the Agent on a Single Huawei Cloud Linux Server
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: Commands
- Server OS: Linux
- Scale: Single
- (Optional) Select the servers that need to be connected to the current HSS region and click Next.
- Perform this operation only in the CN East 2 and CN Southwest-Guiyang 1 regions. HSS will automatically create a VPC endpoint, which occupies an IP address of your VPC subnet. Only one VPC endpoint will be created for each of your VPCs to ensure the communication between your servers and HSS.
- In other regions, ensure the security groups of your servers allow outbound traffic through port 10180 of the 100.125.0.0/16 CIDR block. This port is used to communicate with HSS.
- Install the agent as prompted.
For CN East 2 and CN Southwest-Guiyang 1 regions, wait until the network communication succeeds (that is, the VPC endpoint is created) before performing the following operations.
- On the console page, click in the Install HSS Agent dialog box to copy the installation command.
Figure 6 Copying the installation command
- Log in to the server as the root user and paste the installation command.
If the command output shown in Figure 7 is displayed, the agent has been installed.
Figure 7 Agent installed
Using Commands to Install the Agent on Multiple Huawei Cloud Linux Servers
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: Commands
- Server OS: Linux
- Scale: Batch
- Server Authentication Mode: Select Account and password or Key as needed.
- (Optional) Select the servers that need to be connected to the current HSS region and click Next.
- Perform this operation only in the CN East 2 and CN Southwest-Guiyang 1 regions. HSS will automatically create a VPC endpoint, which occupies an IP address of your VPC subnet. Only one VPC endpoint will be created for each of your VPCs to ensure the communication between your servers and HSS.
- In other regions, ensure the security groups of your servers allow outbound traffic through port 10180 of the 100.125.0.0/16 CIDR block. This port is used to communicate with HSS.
- Install the agent as prompted.
Using the Script to Install the Agent on a Single Huawei Cloud Windows Server
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: Commands
- Server OS: Windows
- Scale: Single
- (Optional) Select the servers that need to be connected to the current HSS region and click Next.
- Perform this operation only in the CN East 2 and CN Southwest-Guiyang 1 regions. HSS will automatically create a VPC endpoint, which occupies an IP address of your VPC subnet. Only one VPC endpoint will be created for each of your VPCs to ensure the communication between your servers and HSS.
- In other regions, ensure the security groups of your servers allow outbound traffic through port 10180 of the 100.125.0.0/16 CIDR block. This port is used to communicate with HSS.
- Install the agent as prompted.
For CN East 2 and CN Southwest-Guiyang 1 regions, wait until the network communication succeeds (that is, the VPC endpoint is created) before performing the following operations.
- On the console, click installAgent.ps1 in the Install HSS Agent dialog box to download the installation script.
Figure 11 Downloading installAgent.ps1
- Copy the installAgent.ps1 file to C:\Users\Administrator.
- Right-click installAgent.ps1 and choose Run with PowerShell.
- (Optional) In the dialog box that is displayed, enter Y to run the script to install the agent.
If no dialog box is displayed, skip this step.
Figure 12 Changing the execution policy
- After the execution, open the Task Manager and check whether hostguard.exe and hostwatch.exe exist. If they do, the agent has been installed.
Figure 13 Agent installed
Using the Script to Install the Agent on Multiple Huawei Cloud Windows Servers
- Log in to the management console.
- In the upper left corner of the page, select a region, click , and choose Security & Compliance > HSS.
- In the navigation pane, choose .
If your servers are managed by enterprise projects, you can select the target enterprise project to view or operate the asset and detection information.
- Click the Agents tab.
- In the upper right corner of the page, click Install HSS Agent.
- Select ECS and click Configure Now.
- Select an installation method.
- Install Mode: Commands
- Server OS: Windows
- Scale: Batch
- (Optional) Select the servers that need to be connected to the current HSS region and click Next.
- Perform this operation only in the CN East 2 and CN Southwest-Guiyang 1 regions. HSS will automatically create a VPC endpoint, which occupies an IP address of your VPC subnet. Only one VPC endpoint will be created for each of your VPCs to ensure the communication between your servers and HSS.
- In other regions, ensure the security groups of your servers allow outbound traffic through port 10180 of the 100.125.0.0/16 CIDR block. This port is used to communicate with HSS.
- Install the agent as prompted.
- For CN East 2 and CN Southwest-Guiyang 1 regions, wait until the network communication succeeds (that is, the VPC endpoint is created) before performing the following operations.
- Perform the following operations on any server.
- To install the agent, the server where the script is executed needs to access the port 5985 on other servers. Modify the inbound rules of the security groups on those servers to allow such access, or HSS will temporarily modify their security group rules while installing the agent. After the agent is installed, the modified settings will be deleted.
- On the console, click windows-host-list.xlsx in the Install HSS Agent dialog box to download the template to the local PC.
Figure 14 Downloading windows-host-list.xlsx
- Enter server information based on the requirements in the windows-host-list.xlsx template and save it.
- Return to the HSS console and click BatchInstallAgent.ps1 to download the installation script.
Figure 15 Downloading BatchInstallAgent.ps1
- Copy the windows-host-list.xlsx and BatchInstallAgent.ps1 files to C:\Users\Administrator.
- Right-click BatchInstallAgent.ps1 and choose Run with PowerShell.
- (Optional) In the dialog box that is displayed, enter Y to run the script to install the agent.
If no dialog box is displayed, skip this step.
Figure 16 Changing the execution policy
- After the script is executed successfully, check whether the BatchInstallAgent.log file exists in C:\Users\Administrator.
If the BatchInstallAgent.log file exists, the agent has been installed.