Вы находитесь на странице: 1из 3

AlienVault ® USM Appliance™

Configuring Database Plugins

Database plugins extract data from an external database and turn them into USM Appliance events. Supported databases are MySQL and Microsoft SQL Server. The database plugin configuration file provides information on how USM Appliance should connect to and query the database.

Note: You can receive event data from more than one database by configuring and enabling multiple database plugins (one database per plugin).

multiple database plugins (one database per plugin). Sample Database Plugin Configuration File Following sections

Following sections included here describe the operation of various sections of the sample plugin configuration file.

How to Connect to the Database

In the database plugin configuration file example, the section that starts with [config] tells USM Appliance how to connect to the database (in this case, MySQL). This consists of the following parameters.

[config] type=detector source=database source_type=< database_type > source_ip=< database_IP > source_port=< database_port > user=< username > password=< user_password > db=< database_name >

How to Create a Start Query for the Microsoft SQL Server Database

The following code example initiates a query for the Microsoft SQL Server database.

[start_query] query="SELECT TOP 1 AutoID FROM EPOEvents ORDER BY AutoID DESC"

How to Fetch Events From the Database

USM Appliance queries the database for events as soon as a database plugin is loaded and, thereafter, every few seconds.

The duration between queries depends on the setting of each plugin's configuration file, which reads the value of sleep in the file. Default settings may range from two to 60 seconds and are user-configurable. For information about customizing existing or developing new plugins, see Customizing and Developing New Plugins and its related topics.

This query starts with query and also references the "start query" code line, shown in boldface type in the following example.

[query] query="SELECT AutoID, CONVERT(nvarchar(40), AutoGUID), ServerID, DetectedUTC, SourceIPV4, TargetIPV4, TargetUserName, TargetFileName, ThreatCategory, ThreatEventID, ThreatSeverity, ThreatName FROM EPOEvents where AutoID > $1 ORDER BY AutoID" regexp=

Important: You must leave the regexp field empty (shown below the query), because database plugins use it in operation.

About the Fields with $

Fields containing $ correspond to fields in the database query. For example:


First element in the query (AutoID).


Second element in the query (AutoGUID)


Third element in the query (ServerID)



userdata1=GUID {$2} userdata2=ServerID {$2} userdata3=Severity {$10}




External Database Configuration

This task enables communication with the external database from which the plugin receives data. You will need command line access to USM Appliance to complete this task.

Important: You need to repeat this task for every external database you want to receive data from.

To configure communication with an external database

1. Create the file /etc/ossim/agent/plugins/<database-plugin>.cfg.local.

2. In the .local file, add the fields shown below .

Use the table provided for definitions:








Editable field descriptions for the database plugin configuration file




Fully qualified domain name, hostname, or IP address.


Port number of the external database.


Name of the user with access to the database.


Password for user with access to the database.


Machine name of the external database.


Duration, in seconds, between plugin queries to the database.

Referencia: https://www.alienvault.com/documentation/usm-appliance/plugin- management/configuring-database-plugins.htm