Installing the Agent on Cloud Platform Servers
Scenario
You can enable HSS for servers only after installing the agent. This section describes how to install the agent on cloud platform servers.
Prerequisites
- Perform the operations in Checking the Installation Environment to ensure agent installation is not affected by 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.
Agent Installation Methods
HSS provides two installation methods. For details about their differences, see Table 1.
Agent Installation Method | Description |
---|---|
GUI | This method is convenient and more efficient than installing the agent using commands. You need to provide HSS with the server account password or key for installing the agent. HSS does not save the password file you upload. |
Command/Script | You need to log in to the server and run commands or a script to install the agent. This method is more complex and slower than installation on the GUI. |
Using the Account and Password to Install the Agent on a Single Cloud Platform Server
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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.
- Linux
Enter information based on whether the server can be logged in using the root account.
- If Allow direct connection with root permissions is selected:
The root account can be used to directly log in to the server. After you enter the root user password and login port, HSS will use your root account to install the agent for the server.
- If Allow direct connection with root permissions is deselected:
The root account cannot be used to directly log in to the server. You can enter another account for login. (The root user password is used for privilege escalation.) HSS will use the provided account information to install the agent for the server.
- If Allow direct connection with root permissions is selected:
- Windows
Enter the username and password.
- Linux
- Confirm the information and click .
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 Cloud Platform Servers
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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.
- 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 .
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 Cloud Platform Servers
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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 .
In the server list, only the servers that are bound to DEW are displayed.
- 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 Cloud Platform Servers Using a User-created Key (Linux Only)
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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.
- 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 .
- 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 a Single Cloud Platform Linux Server
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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
- Install the agent as prompted.
- On the console page, click
in the Install HSS Agent dialog box to copy the installation command.
- Log in to the server as the root user and paste the installation command.
If the command output shown in Figure 1 is displayed, the agent has been installed.
Figure 1 Agent installed
- On the console page, click
Using Commands to Install the Agent on Multiple Cloud Platform Linux Servers
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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.
- Install the agent as prompted.
- On the console, click linux-host-list.csv in the Install HSS Agent dialog box to download the template.
- Enter the server information based on the requirements in the linux-host-list.csv template and save the template.
Ensure that the entered server verification information is consistent with the verification mode selected in 7.
- Use the root account to remotely log in to any target server.
- Use the SSH client to upload the template file linux-host-list.csv to the /tmp directory on the server.
- Return to the HSS console. In the Install HSS Agent dialog box, click
to copy the installation command.
- Paste and run the installation command on the server to install the agent.
If the information shown in Figure 2 is displayed, the installation is complete.
Figure 2 Agent installed
Using the Script to Install the Agent on a Single Cloud Platform Windows Server
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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
- Install the agent as prompted.
- On the console, click installAgent.ps1 in the Install HSS Agent dialog box to download the installation script.
- Copy the installAgent.ps1 file to the C:\Users directory of the server where the agent is to be installed.
- 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 3 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 4 Agent installed
Using the Script to Install the Agent on Multiple Cloud Platform Windows Servers
- Log in to the management console.
- Click
in the upper left corner of the page, select a region, and choose Security > Host Security Service.
- In the navigation pane, choose Installation & Configuration > Server Install & Config.Note
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
- Install the agent as prompted.Notice
- 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.
- 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.
- Copy the windows-host-list.xlsx and BatchInstallAgent.ps1 files to the C:\Users directory of the server where the agent is to be installed.
- 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 5 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.
- Scenario
- Prerequisites
- Agent Installation Methods
- Using the Account and Password to Install the Agent on a Single Cloud Platform Server
- Using the Account and Password to Install the Agent on Multiple Cloud Platform Servers
- Using DEW to Install the Agent on One or More Cloud Platform Servers
- Installing the Agent on One or More Cloud Platform Servers Using a User-created Key (Linux Only)
- Using Commands to Install the Agent on a Single Cloud Platform Linux Server
- Using Commands to Install the Agent on Multiple Cloud Platform Linux Servers
- Using the Script to Install the Agent on a Single Cloud Platform Windows Server
- Using the Script to Install the Agent on Multiple Cloud Platform Windows Servers