Updated on 2024-11-07 GMT+08:00

Viewing Text Audit History

Scenarios

You can view details about the text to be audited.

Prerequisites

A text has been submitted for audit.

Procedure

  1. Log in to the UGO console.
  2. In the navigation pane on the left, choose SQL Audit > Statement Audit. The SQL Text page is displayed by default.
  3. In the History area, view the historical records, including the database type, data source, SQL statement, and audit time.

    Only the latest 10 records are displayed.
    Figure 1 Viewing text audit history

  4. Click Review Details. The basic information, violation rules, and table structure of the SQL statement are displayed.

    If the audit fails, the failure cause is displayed.
    • Violated Rules: Based on the selected rule template, the system provides the violated rule name, risk level, and suggestions.

      Click the content in the Problem Segment column to highlight the problem segment in the text. To cancel the highlight, click the content again. The PL/SQL code may have multiple problem fragments. Click on the left to display all problem fragments.

    • Unmatched Rules: The rules related to the source database are not matched because:

      • No data source is selected.
      • Data source connection fails.
      • The user permission is insufficient.
      • The schema is incorrectly selected.
      • The table is not found.

      The displayed information includes the rule name, risk level, and unmatched reason.

    • Table Structure: Based on the selected rule template, the system provides the table structure information that the SQL statement to be audited depends on, including the object name, object type, and owner.
    • Execution Plans: The execution plans of the SELECT, UPDATE, DELETE, and INSERT statements are displayed.
    • Click the value next to Rule Template to go to the specific template information.

      To obtain the table structure, you must have the permissions to read system catalogs and system views.

      GaussDB system catalogs: tables, pg_class, pg_namespace, relnamespace, pgxc_class, pg_settings, pg_get_viewdef, columns, pg_tables, pg_index, table_constraints, pg_partition, pg_get_tabledef, check_constraints, key_column_usage, pg_get_keywords, gs_package, db_constraints, and adm_ind_columns.

      MySQL system catalogs: information_schema.tables, information_schema.columns, information_schema.statistics, and information_schema.table_constraints.

    Figure 2 Viewing details