View and set the tenant allowlist

2023-12-25 08:49:40  Updated

Through the tenant allowlist feature, you can set which clients are allowed to access the current tenant.

Background information

The tenant allowlist is a list of clients that are allowed to log in to the tenant, which is specified by the tenant's system variable ob_tcp_invited_nodes. You can customize the tenant allowlist according to your business requirements. The system supports the following IP address formats for the tenant allowlist:

  • Regular IP address format, for example 10.10.10.10,10.10.10.11

  • Subnet/mask format, for example 10.10.10.0/24

  • Fuzzy matching format, for example 10.10.10.% or 10.10.10._

  • Mixed format, for example 10.10.10.10, 10.10.10.11, 10.10.10.%, 10.10.10._, 10.10.10.0/24

View the tenant allowlist

  1. Log in to the database using the tenant administrator.

    obclient -h172.30.xx.xx -P2883 -uroot@mq_t1#cluster  -A
    
  2. View the tenant allowlist.

    obclient> SHOW VARIABLES LIKE 'ob_tcp_invited_nodes';
    +----------------------+-------+
    | Variable_name        | Value |
    +----------------------+-------+
    | ob_tcp_invited_nodes | %     |
    +----------------------+-------+
    

Set the tenant allowlist

The tenant allowlist can be set by the administrator of the sys tenant or the administrator of the current tenant.

Set the tenant allowlist using the administrator of the sys tenant

  1. Log in to the sys tenant of the cluster using the root user.

    obclient -h172.30.xx.xx -P2883 -uroot@sys#cluster -p**** -A
    
  2. Modify the allowlist configuration of the tenant.

    obclient> ALTER TENANT mq_t1 VARIABLES ob_tcp_invited_nodes = '10.10.10.%';
    

Set the tenant allowlist using the administrator of the current tenant

  1. Log in to the database using the tenant administrator.

    obclient -h172.30.xx.xx -P2883 -uroot@mq_t1#cluster  -A
    
  2. Modify the allowlist configuration of the tenant.

    obclient> SET GLOBAL ob_tcp_invited_nodes='10.10.10.%';
    
  3. Exit the current session and log in again for the changes to take effect.

  4. View the modification result.

    obclient> SHOW VARIABLES LIKE 'ob_tcp_invited_nodes';
    +----------------------+------------+
    | Variable_name        | Value      |
    +----------------------+------------+
    | ob_tcp_invited_nodes | 10.10.10.% |
    +----------------------+------------+
    

Contact Us