OceanBase AI Database allows you to implement network security access control based on allowlist policies. You can use the tenant allowlist feature to allow only specific clients to access a tenant.
The tenant allowlist is controlled through the system variable ob_tcp_invited_nodes, which is a global allowlist parameter for the tenant. The default value is 127.0.0.1,::1, which means that only the local IP address is allowed to connect to the tenant. This variable supports a list of values separated by commas, for example: A,B,C,D. When a user logs on to an OBServer node, the OBServer node will verify the user's IP address against the values A, B, C, and D. If the user's IP address matches none of them, the access is denied. If it matches any of them, the user is granted access through the allowlist.
You can specify the values in the following formats:
- IP address, for example:
192.168.1.1. An exact match is required, that is, the client IP address must be equal to the specified value. - IP address containing a percent sign (%) or an underscore (_), for example:
192.168.1.%or192.168.1._. A fuzzy match is used, which is similar to the LIKE operator. - IP/NETMASK address, for example:
192.168.1.0/24or192.168.1.0/255.255.255.0. A mask match is used, that is, a match is successful only when Client_IP & NetMask == IP. This is similar to the mask match in MySQL.
Note
Modifying the tenant allowlist does not affect existing session.
View and set the tenant allowlist
Log in to the
systenant as the root user.obclient -uroot@sys -P2881 -h10.xxx.xxx.1 -p*******Execute the following statement to view the tenant allowlist:
obclient> SHOW VARIABLES LIKE 'ob_tcp_invited_nodes'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | ob_tcp_invited_nodes | % | +----------------------+-------+Here,
%indicates that any client IP is allowed to connect to the tenant.To modify the allowlist, execute the following statements.
Here is an example:
obclient> SET GLOBAL ob_tcp_invited_nodes='%'; obclient> SET GLOBAL ob_tcp_invited_nodes='10.10.10.%';