Rechercher dans le manuel MySQL
15.19.5 Security Considerations for the InnoDB memcached Plugin
Consult this section before deploying the
daemon_memcached
plugin on a production
server, or even on a test server if the MySQL instance contains
sensitive data.
Because memcached does not use an
authentication mechanism by default, and the optional SASL
authentication is not as strong as traditional DBMS security
measures, only keep non-sensitive data in the MySQL instance that
uses the daemon_memcached
plugin, and wall off
any servers that use this configuration from potential intruders.
Do not allow memcached access to these servers
from the Internet; only allow access from within a firewalled
intranet, ideally from a subnet whose membership you can restrict.
Password-Protecting memcached Using SASL
SASL support provides the capability to protect your MySQL
database from unauthenticated access through
memcached clients. This section explains how
to enable SASL with the daemon_memcached
plugin. The steps are almost identical to those performed to
enabled SASL for a traditional memcached
server.
SASL stands for “Simple Authentication and Security Layer”, a standard for adding authentication support to connection-based protocols. memcached added SASL support in version 1.4.3.
SASL authentication is only supported with the binary protocol.
memcached clients are only able to access
InnoDB
tables that are registered in the
innodb_memcache.containers
table. Even
though a DBA can place access restrictions on such tables,
access through memcached applications cannot
be controlled. For this reason, SASL support is provided to
control access to InnoDB
tables associated
with the daemon_memcached
plugin.
The following section shows how to build, enable, and test an
SASL-enabled daemon_memcached
plugin.
By default, an SASL-enabled daemon_memcached
plugin is not included in MySQL release packages, since an
SASL-enabled daemon_memcached
plugin requires
building memcached with SASL libraries. To
enable SASL support, download the MySQL source and rebuild the
daemon_memcached
plugin after downloading the
SASL libraries:
Install the SASL development and utility libraries. For example, on Ubuntu, use apt-get to obtain the libraries:
sudo apt-get -f install libsasl2-2 sasl2-bin libsasl2-2 libsasl2-dev libsasl2-modules
Build the
daemon_memcached
plugin shared libraries with SASL capability by addingENABLE_MEMCACHED_SASL=1
to your cmake options. memcached also provides simple cleartext password support, which facilitates testing. To enable simple cleartext password support, specify theENABLE_MEMCACHED_SASL_PWDB=1
cmake option.In summary, add following three cmake options:
cmake ... -DWITH_INNODB_MEMCACHED=1 -DENABLE_MEMCACHED_SASL=1 -DENABLE_MEMCACHED_SASL_PWDB=1
Install the
daemon_memcached
plugin, as described in Section 15.19.3, “Setting Up the InnoDB memcached Plugin”.Configure a user name and password file. (This example uses memcached simple cleartext password support.)
In a file, create a user named
testname
and define the password astestpasswd
:echo "testname:testpasswd:::::::" >/home/jy/memcached-sasl-db
Configure the
MEMCACHED_SASL_PWDB
environment variable to informmemcached
of the user name and password file:export MEMCACHED_SASL_PWDB=/home/jy/memcached-sasl-db
Inform
memcached
that a cleartext password is used:echo "mech_list: plain" > /home/jy/work2/msasl/clients/memcached.conf export SASL_CONF_PATH=/home/jy/work2/msasl/clients
Enable SASL by restarting the MySQL server with the memcached
-S
option encoded in thedaemon_memcached_option
configuration parameter:mysqld ... --daemon_memcached_option="-S"
To test the setup, use an SASL-enabled client such as SASL-enabled libmemcached.
memcp --servers=localhost:11211 --binary --username=testname --password=password myfile.txt memcat --servers=localhost:11211 --binary --username=testname --password=password myfile.txt
If you specify an incorrect user name or password, the operation is rejected with a
memcache error AUTHENTICATION FAILURE
message. In this case, examine the cleartext password set in thememcached-sasl-db
file to verify that the credentials you supplied are correct.
There are other methods to test SASL authentication with memcached, but the method described above is the most straightforward.
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 26/06/2006 gemaakt, de laatste keer de 26/10/2018 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/mysql-rf-innodb-memcached-security.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur Deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.