Tutorial
Import Apache CouchDB logs to IBM Security Guardium Insights using a universal connector
Strengthen your data security by analyzing native activity logsIBM Security Guardium Insights is a hybrid cloud data security hub that helps you improve visibility into user data activity and risk. Guardium Insights helps you protect data more efficiently, enhance information technology flexibility, and reduce operational costs as you embrace new business paradigms such as moving data to the cloud.
The Guardium universal connector enables Guardium Insights to import data from potentially any data source's native activity logs. The universal connector includes support for various plug-in packages and requires minimal configuration to push the audit data into Guardium Insights for analysis and protection.
Learning objectives
This tutorial will show you how to use the Guardium universal connector to import Apache CouchDB activity logs to IBM Security Guardium Insights.
Prerequisites
- IBM Security Guardium Insights 3.2.x version
- Couch DB 3.3+ Linux version
- Filebeat 7.51.1 (installed in the machine where the database is located)
Estimated time
Completing this tutorial should take about 20 minutes.
Steps
The high-level steps covered in this tutorial are:
- Create and configure a universal connector
- Configure Filebeat to push logs to Guardium Insights
- Generate traffic from CouchDB
- Monitor logs in Guardium Insights
- Generate database exception and access violation reports
Step 1. Create and configure a universal connector
- Download the plugin for CouchDB from the Guardium Insights GitHub page. The plugin is contained in a .zip file with a name such as
CouchdbOverFilebeatPackage.zip. Note: To locate the link, scroll the "Available plugins" section. The table in this section contains all the available plugins for Guardium Insights. - Locate the CouchDB row in the "Available plugins" table and click the
GIlink to download the .zip file. Download the file to any machine from which you can access and upload to Guardium Insights. - To upload the file into Guardium Insights, log in to Guardium Insights using your user name and password.
- In the Guardium Insights left menu, click the Settings icon and then click Connections. The Connections page opens.

- Click Manage > UC plugins > Add plugin. Select the
CouchdbOverFilebeatPackage.zipfile and then click Open. When the file is uploaded, you can configure the universal connector. Note: Be sure to upload the .zip file without unzipping it or extracting the files.

- In Guardium Insights, click Settings > Connections to return to the Connections page and then click Add connection.
- In the drop-down menu, select Universal Connector and click Configure. The “Connect data source via Universal Connector” window opens.

- Enter a name and description for the connection and click Next.
- In the Build Pipeline pane, click the Choose input plugin menu and select Filebeat.

- Click Choose filter plugin and select CouchDB. Click Next.
- In the Datasource Tag field, enter a unique name for this connector. In this example, the name is
couchdb27. When you have entered a name, click Configure.
- The universal connector is created. Copy the hostname and port and save in a file for future reference. Click Download certificate and save the certificate to a location where you can easily retrieve it. When you have saved your hostname, port, and certificate, click Done.

- Copy or use FTP to save the certificate to the Linux database machine in a directory that is accessible by you. Usually, you will save to your home directory.
Step 2. Configure Filebeat to push logs to Guardium Insights
You now need to edit the Filebeat configuration file to push the database logs into Guardium Insights.
- Log in to the Linux machine where the database and Filebeat are installed.
- Locate the
filebeat.ymlfile in the Filebeat installation directory. The file will normally be in the/etc/filebeatdirectory. Open the file using an editor (alternatively, you can use the vi editor from a terminal window.) - Under the
filebeat.Inputssection, verify the following information:- In the
type: logattribute, ensure theenabledflag is set to “true”. - Ensure that
pathsattribute points to the database log folder. - In the
tagsattribute, enter the value of the unique identifier that you added earlier in the Datasource Tag field (see Step 1, no. 11). In this example, the unique name iscouchdb27.
- In the
- Scroll to the
Outputssection. Ensure that theoutput.logstashis uncommented. (Note: All other output sections must be commented out; for example,#output.elasticsearch.) - In the
output.logstashsection, update the following attributes:- In the
hostsattribute, enter the hostname and port number that you copied when you were configuring the universal connector. (See Step 1, no. 12.) Note: The port number will be443. - Update the
ssl.certificate_authoritiesattribute to point to the fully qualified path name of the certificate file you saved from Guardium Insights. (See Step 1, nos. 12 and 13.)
- In the
- Save the
filebeat.ymlfile. - Restart the Filebeat service using the following command in a terminal window:
sudo service filbeat restart
Step 3: Generate traffic from CouchDB
You can now run queries in CouchDB to create database logs and ensure they are being pushed to Guardium Insights using Filebeat.
- Ensure you have your database IP, port, and login credentials. (You might need to request them from your database administrator.)
- Access the CouchDB Fauxton interface by entering the following URL in a browser:
http://<DB IP>:<port>/_utils/. - Log in to the database with your username and password. The page will look similar to the following image:

- Click on the database where you want to run the run the query.
- In the menu, click Run A Query with Mango. Edit the default query to use the query and conditions of your choice. In this example, the
selectorquery uses thenameattribute and$eq:maheshcondition, meaning the name must be "mahesh".
- Click Run Query to execute the query. This example will display the records that have the name field matching the value
mahesh. - The output is displayed in the table. You can run different DDL and DML queries to generate more database traffic. If necessary, check with your database administrator for assistance with running these queries.
Step 4: Monitor logs in Guardium Insights
When you generate traffic in the database, it's recorded in the database logs. The Filebeat service is configured to push these logs to a Logstash output destination, in this case your Guardium Insights instance. Now you'll monitor those database activity logs in Guardium Insights.
- In the Guardium Insights main menu, click Activity Log. The log report displays all the activities that you've performed in the Guardium Insights. You can review any log for audit purposes.

- In the Guardium Insights menu, click Reports.
- In the search field, enter
connection events. The "Connection events" window displays, including the Reports link. - Click Reports to view the connection events from CouchDB. The report provides a summary of the events logged into Guardium Insights over the last 24 hours. Note: You can adjust the time period using the filter option available at the top of the report.

- Review the report, confirming that it displays the activities you performed to generate the logs. Note that the “Event source” column lists "Universal Connector" as the source.
- In the Guardium Insights menu, click Reports and in the search field, enter
Full SQL. The "Full SQL" window is displayed. - Click Reports. The detailed report on SQL activities is displayed, listing the DDL and DML activities that you performed in an earlier step.
- Review the full report and to check all the database activities in the given time period.
The database logs are now available and Guardium Insights can start monitoring the events for the anomalies and risks.
Step 5: Generate database exception and access violation reports
Exception and access violation reports can help you identify potential attacks. For example, if you see multiple failed login attempts, it's possible that someone is breaking into your database to steal the data.
You can create security policies to log access violations and monitor database exceptions to gain insight into anomalies and risks.
- In the Guardium Insight menu, click Policies and then click Create a policy.

- Enter a name for the policy and then add access rules to log details and issue an alert in case of violation. In this example, all CouchDB activities are monitored using an
Ifcondition when the database type matchesCouchDB. All database activities in the CouchDB database will be analysed for risks.
- Exception reports will give you insight into database exceptions, which can help identify attacks. In the Guardium Insights menu, click Reports.
- In the search field, type
Exception. The "Exception details" window opens. - Click Reports. All exceptions that occurred for the given time period are displayed.
Summary
In this tutorial, you've learned how to create a universal connector and configure it for a CouchDB database. You've learned how to send your logs to Guardium Insights and use its reports to analyze anomalies and risks. Next steps
Find out how IBM Security Guardium Insights can help you set up more security policies and risk configurations to bring provide insight into database risks. Check out the following resources: