Updated on 2023-09-22 GMT+08:00

Managing Regulation Sets

CBH allows you to create regulation sets for quickly adding a large number of database rules, relieving you from complicated and repetitive workloads.

CBH has 29 common database operation commands preset, including ALTER, TRUNCATE, EXECUTE, INSERT, DELETE, UPDATE, SELECT, GRANT, REVOKE, HANDLER, DEALLOCATE, SET, COMMIT, ROLLBACK, PREPARE, CREATEINDEX, DROPINDEX, CREATEFUNCTION, DROPFUNCTION, CREATEVIEW, DROPVIEW, CREATEDATABASE, DROPDATABASE, CREATEPROCEDURE, DROPPROCEDURE, DROPPROCEDURE, CREATETABLE, DROPTABLE, CALL, and ACCESS.

This topic walks you through how to create, view, modify, and delete a regulation set.

Prerequisites

You have the operation permissions for the DB Rules module.

Creating a Regulation Set

  1. Log in to the CBH system.
  2. Choose Policy > Database Rules > RegSet to go to the DB rule list.

    Figure 1 RegSet list

  3. Create a regulation set.

    1. In the upper right corner of the page, click New.
    2. Configure the RegSet name and specify a protocol.
      • The RegSet Name must be unique in the CBH system.
      • Currently, only MySQL and Oracle are supported. The protocol type cannot be changed after being selected.
    3. Click OK. You can then view new regulation set on the list page.
    Figure 2 Creating a Regulation Set

  4. Add database rules.

    1. In the row of the command set you want to add rules, click Add regulation in the Operation column.
    2. Add libraries, tables, and commands for the regulation set.
      Table 1 Parameters for adding regulation

      Parameter

      Description

      Lib

      This parameter is optional. It can be set to a regular expression to match the library name.

      By default, all SQL statements that use this command are intercepted.

      Table

      This parameter is optional. It can be set to a regular expression to match the table name.

      By default, all SQL statements that use this command are intercepted.

      Cmd

      This parameter is mandatory. Select at least one preset command.

      Currently, 29 commands are available. You can select multiple commands.

    3. Click OK.
      Figure 3 Add regulation

Querying and Editing a Regulation Set

  1. Log in to the CBH system.
  2. Choose Policy > Database Rules > RegSet to go to the DB rule list.

    Figure 4 RegSet list

  3. Query the regulation sets.

    Quick search: Enter a keyword in the search box and search for regulation sets by regulation set name.

  4. Click the name of a regulation set you want to edit or click Manage in the row of the regulation set in the Operation column.

    Figure 5 Regset details

  5. View and edit basic information.

    In the Basic Info area, click Edit. In the displayed dialog box, edit the basic information.

    You can edit RegSet name. The Protocol and Department cannot be changed.

  6. Query and edit a regulation set in the Regulation area.

    • To add a library, table, or command to a regulation set, click Add and then complete modifications in the displayed dialog box.
    • To delete a regulation set, locate the row and click Remove.
    Figure 6 Viewing regulation sets

Deleting a Regulation Set

  1. Log in to the CBH system.
  2. Choose Policy > Database Rules > RegSet to go to the DB rule list.
  3. To delete one regulation set, click Delete in the Operation column of the row where the regulation set locates to delete it.
  4. To delete multiple regulation sets together, select the ones you want to delete and click Delete at the bottom of the list to delete all selected regulation sets together.