Auditing an RDS DB instance (with Agents)
Overview
This section describes how to audit the security of an RDS DB instance. (Applications connected to this DB instance are deployed on ECS.) DBSS can audit certain types of relational databases without installing agents.
- If the database you want to audit is included in Table 1, see Auditing an RDS DB Instance (Without Agents).
- If the database that you want to audit is not included in Table 1, install agents and audit your database by referring to this section.
Solution Architecture
Take the following relational database instance of the PostgreSQL 7.4 version as an example. Assume you need to locate and track internal violations and improper operations in the database to meet compliance requirements. This section describes how to enable the database audit function and check audit results.
Limitations and Constraints
- Disable SSL for a database before auditing it.
- The database audit instance and the database to be audited must be in the same region.
- For connection purposes, ensure the VPC of the database audit instance is the same as that of the agent node.
For details about how to choose the node, see How Do I Determine Where to Install an Agent?
Step 1: Purchase Database Audit
Configure and purchase the database audit service. For details, see Purchasing Database Audit.
For connection purposes, ensure the VPC of the database audit instance is the same as that of the agent node.
For details about how to choose the node, see How Do I Determine Where to Install an Agent?
Step 2: Add a Database and Enable Audit
After purchasing database audit, add a database to the database audit instance and enable audit for the database.
- Log in to the management console.
- Select a region and click . Choose Security & Compliance > Database Security Service. The Dashboard page is displayed.
- In the navigation pane, choose .
- Select an instance from the Instance drop-down list. Click Add Database.
- In the displayed dialog box, set database parameters described in Figure 2.
- Click OK. The database will be displayed in the database list and its Audit Status will be Disabled.
- In the Operation column of the database, click Enable.
Step 3: Add an Agent
- Locate the target database, and click Add in the Agent column, as shown in Figure 3.
- In the displayed dialog box, select an addition mode.
- Method 1: Create an agent.
If no agent has been added for the database audit instance, you need to create an agent.
- Method 2: Select an existing agent, as shown in Figure 5.
For details about when you should select this option, see When Should I Select an Existing Agent?
If an agent has been installed on the application, you can select it to audit the desired database.
- Method 1: Create an agent.
- Click OK.
Step 4: Add a Security Group Rule
- If the inbound rules of the security group have been configured for the installing node, go to Step 5: Install an Agent.
- If no inbound rule has been configured, perform the following operations.
You can configure security group rules before or after installing an agent.
- Obtain the IP address of the agent node.
- On the Databases page, click Add Security Group Rule.
- In the dialog box that is displayed, check and make a note of the security group of the database audit instance, for example, default.
Figure 6 Adding a security group rule
- Click Go to VPC. The Security Groups page will be displayed.
- Enter the security group name default in the search box in the upper right corner of the list, and click or press Enter. The group information is displayed in the list.
- Click default. The Summary tab will be displayed.
- On the Inbound Rules tab, click Add Rule.
- In the Add Inbound Rule dialog box, add TCP (port number 8000) and UDP protocols (port number from 7000 to 7100) for the installing node IP address in Table 2.
- Click OK.
Step 5: Install an Agent
Each agent has a unique ID, which is used as the key for connecting to a database audit instance. If you delete an agent and add it back, you need to download and install the agent again.
- Log in to the DBSS management console.
- In the navigation pane, choose .
- In the Instance drop-down list, select an instance.
- Click on the left of the database to view agent details. In the Operation column, click Download Agent. See Figure 7.
- Use a cross-platform transmission tool (for example, WinSCP) to upload the downloaded agent installation package xxx.tar to the node specified by Installing Node IP Address in Figure 7.
- Log in to the node as user root by using a cross-platform remote access tool (for example, PuTTY) via SSH.
- Run the following command to access the directory where the agent installation package xxx.tar is stored:
cd Directory_containing_agent_installation_package
- Run the following command to decompress the installation package xxx.tar:
tar -xvf xxx.tar
- Run the following command to go to the directory in which the install.sh script is stored:
cd install.sh_script_directory
- Run the following command to install the agent:
sh install.sh
If the following information is displayed, the agent has been installed successfully:1 2 3 4 5
start agent starting audit agent audit agent started start success install dbss audit agent done!
Step 6: Verify the Communication Between the Agent and the Database Audit Instance
Check to ensure the communication between the agent and the database audit instance is normal.
- Run an SQL statement or perform an operation on the database (for example, Select 1;) on the node where the agent is installed.
- In the navigation pane, choose Dashboard.
- In the Instance drop-down list, select the instance whose slow SQL statement information you want to view.
- Click the Statements tab.
- The SQL statement list displays the record of database login.
If no SQL statement is displayed, check your network connection. For details, see What Should I Do If the Communication Between the Agent and Database Audit Instance Is Abnormal?
Step 7: View Audit Results
You can check audit results on the Dashboard page, or generate, preview, or download reports.
- Check overview information.
In the navigation pane, choose Dashboard.
The Dashboard page displays the audit duration, total number of SQL statements and risks, statements and risks today, and today's sessions of an instance.
You can click the Statements or Sessions tab to view session distribution.
- Generate, download, or preview reports.
- In the navigation pane, choose Reports.
- Select an instance from the Instance drop-down list. Click the Report Management tab.
- In the Operation column of a report template, click Generate Report.
- In the displayed dialog box, click to set the start time and end time of the report, and select the database for which you want to generate a report.
- Click OK.
See Figure 8.
To preview a report online, use Google Chrome or Mozilla FireFox.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.