2.9 Ensure MariaDB is Bound to One or More Specific IP Addresses

Information

By default, the MariaDB server accepts TCP/IP connections from MariaDB user accounts on all server host IPv6 and IPv4 interfaces. You can make this configuration more restrictive by setting the bind_address configuration option to one or more specific IPv4 or IPv6 addresses so that the server only accepts TCP/IP connections on those addresses.

Limiting the IP addresses provides additional controls and restrictions on how client applications can connect to MariaDB. If this setting is not configured to one or more specific IPs, or if this setting is configured to listen on all server addresses, then all IPs for this server can be used to connect to MariaDB.

Solution

For example, to have the MariaDB server only accept connections on a specific IPv4 address, add an entry similar to this under the [mysqld] option group in MariaDB configuration files:

bind_address=192.0.2.24

This setting typically appears in /etc/mysql/mariadb.conf.d/50-server.cnf.In the case above, clients can connect to the server using --host=192.0.2.24 . Connections on other server host addresses are not permitted.

To listen on multiple IP addresses, use a comma separated list for this option. For example:

bind_address=192.0.2.24,10.1.3.100

configures MariaDB to listen on both 192.0.2.24 and 10.1.3.100.

See Also

https://workbench.cisecurity.org/benchmarks/16118

Item Details

Category: PLANNING, SYSTEM AND SERVICES ACQUISITION

References: 800-53|PL-8, 800-53|SA-8

Plugin: MySQLDB

Control ID: de6b75dbe02a0bf9f8384f62d3dc5d71484c3ad31ded8e5d2e5db9331dea837d