Fortinet black logo

Handbook (HTML)

Tutorial: Monitoring a database table using the TCP/IP sniffer

Tutorial: Monitoring a database table using the TCP/IP sniffer

You can configure to use a TCP/IP packet sniffer to monitor specific tables in a database and generate alerts based on policies you specify. For example, you can configure FortiDB to generate alerts when it detects security violations or suspicious database users. You can then use the alert information to generate a report.

Database activity monitoring (DAM) using the TCP/IP sniffer is only available with FortiDB appliance. DAM does not work for the software version of FortiDB.

This example configures FortiDB to monitor an Oracle database. Before you start the tutorial, ensure that the database has the required configuration. For details, see Oracle target database pre-configuration.

The TCP/IP sniffer for DAM requires the following network environment and connections:

  • The database server and clients use the TCP/IP protocol and all database activity takes place on the LAN.
  • The network switch that FortiDB and the database server are connected to supports the port mirroring feature.
  • One of the FortiDB ethernet ports is connected to the switch’s mirror port (also known as SPAN port). This port allows FortiDB to receive copies of all network traffic that is associated with the database.
Create a target

A target specifies a database for FortiDB to monitor.

  1. Log in to FortiDB using the following credentials (the default values):
  2. User Name admin
    Password fortidb1!$

    All DAM tasks require the user to log in as admin.

  3. In the navigation menu, go to Target Database Server > Targets.
  4. On the Targets page, click Add.
  5. On the General tab, enter the following information. For this example, the target is an Oracle database:
  6. Name damtarget
    Type Oracle
    DB Host Name/IP The IP address or name of the machine where the database is located (for example, test_machine or 172.30.12.112)
    Port The number of the port the database uses; the default port is 1521
    DB Name The name of the database (for example, orcl)
    User Name The database user name
    Password The password for the database user
    DB Activity Monitoring Select Allow.
  7. To verify that the connection parameters are correct, click Test Connection.
  8. The message “Success” is displayed at the top of the page.

  9. Click Save.
  10. The damtarget item is displayed in the list of targets.

Configure an alert policy for a database table
  1. In the navigation menu, click DB Activity Monitoring > Monitoring Management.
  2. Your target database is listed on the Target Monitoring Management page.

  3. Click damtarget (the name of the target you created).
  4. On the General tab, use the following values to complete the Audit Configuration settings:
  5. Collection Method TCP/IP Sniffer
    Version The database version (9, 10g, 11g, 12c)
    Sniffer on Port The FortiDB appliance port that is connected to the switch's mirror port
    Enable Activity Auditing Selected
    Log All Selected
    Enable Activity Profiling Selected

    When you create a target monitoring configuration, selecting Enable Activity Auditing, Log All, or Enable Activity Profiling is optional.

  6. Click Save.
  7. Click the Alert Policies tab.
  8. At the bottom-left of the page, for Data Policies, select Table, and then click Add.
  9. On the Target Monitor:<target name> page, configure a table policy using the following values:
  10. Policy Name Enter a policy name or use the default name
    Description Enter an optional description
    Enable Selected
    Create new policy group for policy check box Selected
    Severity Informational (the default) or other value

    When you create a table policy, selecting Enable or Create new policy group for policy check box is optional.

  11. Beside Audit Settings, click the triangle icon to view the settings, and then select Browse Object by Target.
  12. For Schema, select a schema to use (for example, SCOTT).
  13. In the Tables list, select a table to monitor (for example, EMP).
  14. To select multiple tables, click a table, and then Shift-click another table in the list. All tables between the two tables are selected.

  15. Under Audit Actions, select Read, Write, or both.
  16. Click > (right arrow) to move the selected tables and their Audit Action settings to the Selected Objects table.
  17. Move any other tables you want to monitor to the Selected Objects table.
  18. Beside Alert Rule, click the triangle icon to view the settings.
  19. Select Issue alert if ANY of the enabled rules are triggered.
  20. Select Security Violation (selected by default).
  21. Select Suspicious Database Users, and then click the triangle icon beside it to view additional settings.
  22. Select one or more user names, and then click > (right arrow) to move them to the Selected users list.
  23. Select Alert any successful access if the database matches a selected entry.
  24. Select Save.
  25. On the Alert Policies tab, the new policy is listed. The green up-arrow in the Status column indicates that the policy is enabled.

Confirm the policy group was created and start monitoringClick the Alert Policy Groups tab.
  1. Click the Alert Policy Groups tab.
  2. In Selected Policy Groups, confirm that FortiDB created a policy group based on the alert policy that you created.
  3. In Selected Policy Groups, select the new policy group, and then confirm that the alert policy that you created is displayed in the Selected Policy Group contents list.
  4. To start monitoring the database, click the General tab, and then click Start Monitoring.
  5. Monitor Status displays Starting and then Running.

View alerts generated by the policy and export them as a report
  1. Using a database client-side application, execute one or more SQL statements that generate alerts.
  2. To view alerts, click DB Activity Monitoring > Security Alerts.
  3. In the Security Alerts list, click an item to display its details under Alert Details (below the list).
  4. To hide the alert details, beside Alert Details, click the triangle icon.

  5. To create a customized report, click Report > User-Defined DAM Reports, and then select Add.
  6. On the General tab, for Name, enter a name for the report. Optionally, for Description, enter a short description for the report.
  7. Click the Table View tab
  8. In the Available Columns list, select columns to include in the report, and then click >> (right arrows) to add the selected columns to the Columns in Report list.
  9. Click Save.
  10. On the User-Defined Alert Reports page, in the list of reports, select the report you just created, and then click Run.
  11. After FortiDB has run the report, beside the report name, click [+] (plus sign).
  12. A list of items with names created from the report name and run times is displayed.

  13. Click a run report item to view the report.
  14. To export the report, click one of the following file format icons:
  • PDF
  • TXT (tab-delimited)
  • XLS (Excel)
  • CSV (comma-separated values)

Your browser prompts you to download a file of the specified format.

View activity auditing and profiling
  1. To view activity auditing, go to DB Activity Monitoring > Activity Auditing.
  2. Database activity events for the specified dates are displayed.

  3. Click an event to display its details under Activity Event Details (below the list).
  4. To check activity profiling, click DB Activity Monitoring > Activity Profiling.
  5. The Target DB Activity Profiling page lists the profiling status and summary information for the targets that FortiDB is monitoring.

  6. To view details, click the name of the target.
See also

Tutorial: Monitoring a database table using the TCP/IP sniffer

You can configure to use a TCP/IP packet sniffer to monitor specific tables in a database and generate alerts based on policies you specify. For example, you can configure FortiDB to generate alerts when it detects security violations or suspicious database users. You can then use the alert information to generate a report.

Database activity monitoring (DAM) using the TCP/IP sniffer is only available with FortiDB appliance. DAM does not work for the software version of FortiDB.

This example configures FortiDB to monitor an Oracle database. Before you start the tutorial, ensure that the database has the required configuration. For details, see Oracle target database pre-configuration.

The TCP/IP sniffer for DAM requires the following network environment and connections:

  • The database server and clients use the TCP/IP protocol and all database activity takes place on the LAN.
  • The network switch that FortiDB and the database server are connected to supports the port mirroring feature.
  • One of the FortiDB ethernet ports is connected to the switch’s mirror port (also known as SPAN port). This port allows FortiDB to receive copies of all network traffic that is associated with the database.
Create a target

A target specifies a database for FortiDB to monitor.

  1. Log in to FortiDB using the following credentials (the default values):
  2. User Name admin
    Password fortidb1!$

    All DAM tasks require the user to log in as admin.

  3. In the navigation menu, go to Target Database Server > Targets.
  4. On the Targets page, click Add.
  5. On the General tab, enter the following information. For this example, the target is an Oracle database:
  6. Name damtarget
    Type Oracle
    DB Host Name/IP The IP address or name of the machine where the database is located (for example, test_machine or 172.30.12.112)
    Port The number of the port the database uses; the default port is 1521
    DB Name The name of the database (for example, orcl)
    User Name The database user name
    Password The password for the database user
    DB Activity Monitoring Select Allow.
  7. To verify that the connection parameters are correct, click Test Connection.
  8. The message “Success” is displayed at the top of the page.

  9. Click Save.
  10. The damtarget item is displayed in the list of targets.

Configure an alert policy for a database table
  1. In the navigation menu, click DB Activity Monitoring > Monitoring Management.
  2. Your target database is listed on the Target Monitoring Management page.

  3. Click damtarget (the name of the target you created).
  4. On the General tab, use the following values to complete the Audit Configuration settings:
  5. Collection Method TCP/IP Sniffer
    Version The database version (9, 10g, 11g, 12c)
    Sniffer on Port The FortiDB appliance port that is connected to the switch's mirror port
    Enable Activity Auditing Selected
    Log All Selected
    Enable Activity Profiling Selected

    When you create a target monitoring configuration, selecting Enable Activity Auditing, Log All, or Enable Activity Profiling is optional.

  6. Click Save.
  7. Click the Alert Policies tab.
  8. At the bottom-left of the page, for Data Policies, select Table, and then click Add.
  9. On the Target Monitor:<target name> page, configure a table policy using the following values:
  10. Policy Name Enter a policy name or use the default name
    Description Enter an optional description
    Enable Selected
    Create new policy group for policy check box Selected
    Severity Informational (the default) or other value

    When you create a table policy, selecting Enable or Create new policy group for policy check box is optional.

  11. Beside Audit Settings, click the triangle icon to view the settings, and then select Browse Object by Target.
  12. For Schema, select a schema to use (for example, SCOTT).
  13. In the Tables list, select a table to monitor (for example, EMP).
  14. To select multiple tables, click a table, and then Shift-click another table in the list. All tables between the two tables are selected.

  15. Under Audit Actions, select Read, Write, or both.
  16. Click > (right arrow) to move the selected tables and their Audit Action settings to the Selected Objects table.
  17. Move any other tables you want to monitor to the Selected Objects table.
  18. Beside Alert Rule, click the triangle icon to view the settings.
  19. Select Issue alert if ANY of the enabled rules are triggered.
  20. Select Security Violation (selected by default).
  21. Select Suspicious Database Users, and then click the triangle icon beside it to view additional settings.
  22. Select one or more user names, and then click > (right arrow) to move them to the Selected users list.
  23. Select Alert any successful access if the database matches a selected entry.
  24. Select Save.
  25. On the Alert Policies tab, the new policy is listed. The green up-arrow in the Status column indicates that the policy is enabled.

Confirm the policy group was created and start monitoringClick the Alert Policy Groups tab.
  1. Click the Alert Policy Groups tab.
  2. In Selected Policy Groups, confirm that FortiDB created a policy group based on the alert policy that you created.
  3. In Selected Policy Groups, select the new policy group, and then confirm that the alert policy that you created is displayed in the Selected Policy Group contents list.
  4. To start monitoring the database, click the General tab, and then click Start Monitoring.
  5. Monitor Status displays Starting and then Running.

View alerts generated by the policy and export them as a report
  1. Using a database client-side application, execute one or more SQL statements that generate alerts.
  2. To view alerts, click DB Activity Monitoring > Security Alerts.
  3. In the Security Alerts list, click an item to display its details under Alert Details (below the list).
  4. To hide the alert details, beside Alert Details, click the triangle icon.

  5. To create a customized report, click Report > User-Defined DAM Reports, and then select Add.
  6. On the General tab, for Name, enter a name for the report. Optionally, for Description, enter a short description for the report.
  7. Click the Table View tab
  8. In the Available Columns list, select columns to include in the report, and then click >> (right arrows) to add the selected columns to the Columns in Report list.
  9. Click Save.
  10. On the User-Defined Alert Reports page, in the list of reports, select the report you just created, and then click Run.
  11. After FortiDB has run the report, beside the report name, click [+] (plus sign).
  12. A list of items with names created from the report name and run times is displayed.

  13. Click a run report item to view the report.
  14. To export the report, click one of the following file format icons:
  • PDF
  • TXT (tab-delimited)
  • XLS (Excel)
  • CSV (comma-separated values)

Your browser prompts you to download a file of the specified format.

View activity auditing and profiling
  1. To view activity auditing, go to DB Activity Monitoring > Activity Auditing.
  2. Database activity events for the specified dates are displayed.

  3. Click an event to display its details under Activity Event Details (below the list).
  4. To check activity profiling, click DB Activity Monitoring > Activity Profiling.
  5. The Target DB Activity Profiling page lists the profiling status and summary information for the targets that FortiDB is monitoring.

  6. To view details, click the name of the target.
See also