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

Creating a Rule Template

Scenarios

You can create rule templates based on different service scenarios.

Constraints

  • Up to 1,000 rule templates can be created.

Procedure

  1. Log in to the UGO console.
  2. In the navigation pane, choose SQL Audit > Rules. The Templates page is displayed by default.
  3. Click Create Template. In the displayed dialog box, configure parameters as needed.

    Figure 1 Creating a rule template
    Table 1 Parameter description

    Parameter

    Description

    Template Name

    Name displayed in the rule template list.

    The name must contain 5 to 50 characters, start with a letter, digit, and end with a digit or letter. Only letters (case-insensitive), digits, underscores (_), and hyphens (-) are allowed.

    Template Type

    Baseline template and import template.

    Import Template

    Local file template to be imported, which must meet the following requirements:

    1. The file size cannot exceed 1 MB.

    2. The file name can contain only digits, letters, underscores (_), and hyphens (-).

    3. Maximum file name length: 240 characters

    4. The columns must be sorted according to the sequence in the template. TEXT data is recommended for each column to prevent deviation during data conversion.

    5. No blank line is allowed between two rows of data, or the data after the blank line will be invalid. The number of rows cannot exceed 200, or the data after 200th row will be invalid.

    NOTICE:

    You are advised to modify rules in the exported Excel file template. For details, see Table 2. You are advised to modify the values in the Threshold, Risk Level, and Suggestion columns.

    Baseline Template

    You can select any existing template as the baseline template.

    Description

    Template description, which can contain up to 100 characters This parameter is optional.

    Table 2 Example of file template

    Rule Name

    Rule ID

    Description

    Applicable Database

    Audited Object Type

    Severity

    Threshold

    Suggestion

    Do not use too many combined index fields.

    10055

    The number of composite index fields cannot exceed the threshold. Audit object: CREATE INDEX

    GaussDB

    sqltext

    Major

    5

    -

  4. Click OK.

    The created template is displayed in the rule template list. Up to 1,000 custom templates can be created.
    Figure 2 Rule template