Purpose
This view displays the definitions and attributes of all sensitive rules in all tenants.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | int(20) | NO | The tenant ID. |
| RULE_NAME | varchar(256) | NO | The name of the sensitive rule. |
| PROTECTION_POLICY | varchar(16) | NO | The protection strategy. Valid values: ENCRYPTION, MASKING, and INVALID. ENCRYPTION indicates encryption protection. MASKING indicates masking protection. INVALID indicates an invalid strategy. |
| METHOD | varchar(4096) | NO | The encryption method. Valid values are described in the following table. |
| ENABLED | varchar(3) | NO | Indicates whether to enable the rule. Valid values: YES and NO. YES indicates to enable the rule. NO indicates to disable the rule. |
The value of METHOD is described in the following table.
| Value (used in SQL syntax) | Encryption algorithm | Key length | Mode | Description |
|---|---|---|---|---|
| aes-256 | AES-256-ECB | 256 bits | ECB | The default algorithm. |
| aes-128 | AES-128-ECB | 128 bits | ECB | |
| aes-192 | AES-192-ECB | 192 bits | ECB | |
| aes-128-gcm | AES-128-GCM | 128 bits | GCM | High security level. Provides authenticated encryption (AEAD). |
| aes-192-gcm | AES-192-GCM | 192 bits | GCM | High security level. Provides authenticated encryption (AEAD). |
| aes-256-gcm | AES-256-GCM | 256 bits | GCM | High security level. Provides authenticated encryption (AEAD). |
| sm4-cbc | SM4-CBC | CBC | High security level. | |
| sm4-gcm | SM4-GCM | GCM | High security level. Provides authenticated encryption (AEAD). |
Sample query
Query the definitions and attributes of all sensitive rules in all tenants.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_SENSITIVE_RULES;
The query result is as follows:
+-----------+-----------+-------------------+---------+---------+
| TENANT_ID | RULE_NAME | PROTECTION_POLICY | METHOD | ENABLED |
+-----------+-----------+-------------------+---------+---------+
| 1 | r1 | ENCRYPTION | aes-256 | YES |
+-----------+-----------+-------------------+---------+---------+
1 row in set