Security rules in Data Management (DMS) enforce fine-grained database governance through rule sets written in a domain-specific language (DSL). Use them to control queries, exports, data changes, approvals, and development workflows across your database instances.
Prerequisites
-
Your role is DMS administrator or DBA. To verify your role, see View system roles.
-
The target database instance uses Security Collaboration mode.
NoteInstances in Flexible Management or Stable Change mode support only default security rules.
Scenarios
|
Goal |
How rules help |
|
Replace email and IM-based change requests with online workflows |
Unify R&D processes, standards, and approvals for collaborative online database management |
|
Keep schemas consistent across dev, test, staging, and production environments |
|
|
Enforce schema design standards |
|
|
Block high-risk SQL statements |
|
|
Apply tiered approval for data changes |
|
|
Apply tiered approval for permission grants |
Navigate to the security rules page
-
Log on to the DMS console V5.0.
-
Open the Security Rules page:
-
Compact mode: Hover over the icon in the upper-left corner and choose All functions > Security and Specifications > Security Rules.
-
Normal mode: In the top navigation bar, choose Security and Specifications > Security Rules.
-
Step 1: Create a rule set
Create separate rule sets to apply different security policies by database engine and environment.
Log in to DMS 5.0.
-
Move the pointer over the
icon in the upper-left corner and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
-
On the Security Rules page, click Create Rule Set in the upper-left corner.
-
Configure the rule set:
Parameter
Description
Engine Type
The database engine for this rule set.
Rule Set Name
A descriptive name for the rule set.
Remarks
The intended scope, such as the target environment.
-
Click Submit.
Step 2: Configure rules in a rule set
Open a rule set's Details page to modify default rules or add custom rules for specific checkpoints.
For example, disable the Whether the result set supports export rule on the SQL Console tab to block result set exports.
When a task is submitted, DMS validates it against all rules for the corresponding checkpoints. The task runs only after passing all validations.
Edit predefined rules
Log in to DMS 5.0.
-
Move the pointer over the
icon in the upper-left corner and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
-
On the Security Rules page, find the target rule set and click Edit in the Actions column.
NoteTo create a rule set, see Create security rules.
-
In the left-side navigation pane of the Details page, select a checkpoint tab.
-
Modify predefined configurations and toggle rule states as needed.
Create a custom rule
Create a custom rule when predefined rules do not meet your requirements.
-
On the Details page of the rule set, click Create Rule next to Actions.
-
Set the following parameters:
Parameter
Description
Checkpoints
The checkpoint this rule applies to.
NoteYou cannot add rules to the Basic Configuration Item checkpoint.
Template Database
Optional. Click Load from Template Database to load a pre-built DSL template that you can modify.
Rule Name
A descriptive name for the rule.
Rule DSL
The DSL statement that defines the rule logic. Use the factors, actions, functions, and operators listed in the editor. For DSL syntax, see DSL syntax for security rules.
-
Click Submit.
Checkpoint reference
Each tab on the rule set Details page corresponds to a checkpoint.
| Checkpoint | Documentation |
|---|---|
| SQL Console for relational databases | SQL Console for relational databases |
| SQL Console for MongoDB | SQL Console for MongoDB |
| SQL Console for Redis | SQL Console for Redis |
| SQL Correct | SQL Correct |
| Permission application | Permission application |
| Data Export | Data Export |
| Schema Design | Schema Design |
| Synchronize databases and tables | Synchronize databases and tables |
| Data Tracking | Data Tracking |
| Sensitive Column Change | Sensitive Column Change |
| Test Data Generate | Test Data Generate |
| Database Clone | Database Clone |
Step 3: Apply a rule set to instances
After configuring a rule set, apply it to database instances using either of the following methods.
Batch apply (recommended)
Apply the same rule set to multiple instances at once.
Log in to DMS 5.0.
-
In the top navigation bar, click Data Assets. In the left-side navigation pane, click Instances.
-
Click the Instance List tab.
-
Select one or more instances and click Batch edit.
NoteAll selected instances must share the same database engine.
-
In the Edit instance information in batches dialog, set Control Mode to Security Collaboration.
-
Select a rule set from the Security Rules drop-down list and click OK.
Apply to a single instance
Log in to DMS 5.0.
-
In the left-side instance list, right-click the target instance.
-
Choose and select a security rule set.
-
In the Modify control mode dialog, click OK.