After installing a MySQL database server, like the one I posted earlier, if it's going to be a production environment than you should consider securing the instance by eliminating some of the basic vulnerabilities that come with a generic install. Fortunately MySQL and MariaDB already come with a tool for that purpose, called mysql_secure_installation. This program enables to perform the
Maintaining a project like MySQL::Sandbox is sometimes tiring, but it has its
advantages. One of them is that everything related to the server
setup comes to my attention rather earlier than if I were an
average DBA or developer.
I try to keep MySQL Sandbox up to date with every release of
MySQL and (to a lesser extent) MariaDB [1].
For this reason, I am used to trying a new release with MySQL
Sandbox, and … seeing it fail.
Of the latest changes in MySQL, probably the most disruptive was
what happened in MySQL 5.7.6, where the mysql.user table
lost the password column.
Yep. No ‘password’ column anymore. And just to make the setup
procedure harder, the syntax of SET PASSWORD …
The other day I was discussing new features of MySQL 5.7 with a Percona Support customer. After that conversation, I thought it would be a good idea to compile list of important features of MySQL 5.7. The latest MySQL 5.7.6 release candidate (RC) is out and is packed with nice features. Here’s a list of some MySQL 5.7 key features.
Replication Enhancements:
- One of the top features in MySQL 5.7 is multi-source replication. With multi-source replication you can point multiple master server’s to slave so limitation of slave having only one master is lift off. There is nice blog post written by my colleague on multi-source replication you will find useful.
- …
Last week, a SSL connection security vulnerability was reported for MySQL and MariaDB. The vulnerability states that since MariaDB and MySQL do not enforce SSL when SSL support is enabled, it’s possible to launch Man In The Middle attacks (MITM). MITM attacks can capture the secure connection and turn it into an insecure one, revealing data going back and forth to the server.
Issue resolution in MariaDB is visible through the corresponding ticket in MariaDB’s tracking system (JIRA): https://mariadb.atlassian.net/browse/MDEV-7937
The vulnerability affects the client library of the database server in both MariaDB and MySQL. But, the vulnerability does not affect all the libraries, drivers or connectors for establishing SSL connections with the server.
The vulnerability exists when the connection to the server is done through the client …
[Read more]Today, oCERT published advisory 2015-003 describing a TLS vulnerability in MySQL and derivative products. The content isn’t exactly news – it is documented legacy behavior and the subject of an earlier blog post describing how MySQL Server 5.7 solves the problem. That said, the efforts of Duo Security are certainly appreciated and welcomed – it provides a meaningful context to discuss how to properly harden existing MySQL 5.5 and 5.6 deployments, as well as frame a discussion on potential changes in these versions to increase security.
Vulnerability
The vulnerability described in the advisory relies on the legacy behavior of the client …
[Read more]
I’ve written previously about use cases where having accounts which cannot be used to establish client
connections are useful. There are various hacks to accomplish
this with legacy versions (insert invalid password hash into
mysql.user
table, etc.), and we introduced the
mysql_no_login
authentication
plugin for this very purpose. Now as of MySQL 5.7.6, account locking gets native support through
the ACCOUNT LOCK
clause of CREATE USER
and ALTER USER
commands. This post revisits the use
cases which drove this feature and the implementation
details.
Use Cases
Security …
[Read more]What?
MySQL 5.7 server binaries compiled with the OpenSSL library now make it easy to set up SSL/TLS and RSA artifacts, and to enable them within MySQL. Two new read-only global options have been introduced through this work:
-
--auto-generate-certs
: Enables automatic generation and detection of SSL artifacts at server start-up. -
--sha256-password-auto-generate-rsa-keys
: Enables automatic generation of an RSA key pair.
These options govern automatic generation and detection of SSL/TLS artifacts and RSA key pairs respectively. Auto generated files are placed inside the data directory, and both options now default to ON.
For the …
[Read more]
As noted in an earlier post, MySQL Server 5.7 prefers and
enables SSL/TLS connections by default. That’s great and
useful progress towards secure connections, but we know that not
all SSL/TLS ciphers are created equal – some are older and more
vulnerable. Furthermore, some recent vulnerabilities rely
on the ability to negotiate less-secure ciphers during the
handshake. Monitoring which ciphers are used can help
identify connections using low-grade ciphers, but also to build
an appropriate restricted cipher list. Using
improvements to PERFORMANCE_SCHEMA
introduced in
5.7, you can now easily do this – and this post will show you
how.
The cipher used for each TLS connection is stored in a …
Complimenting the expanded CREATE USER
syntax introduced in
MySQL Server 5.7.6 is more useful ALTER USER
syntax. Before MySQL Server 5.7.6, ALTER USER
could only be used to expire a user’s password. That’s pretty
limited. With changes made in MySQL Server 5.7.6, a better
distinction is made between privilege-level attributes (those
which are managed via GRANT
and REVOKE
statements) and account-level attributes (those managed using
CREATE USER
and ALTER USER
statements). MySQL has a long history of confusing these –
for example, requiring a GRANT
…
As I wrote earlier, we want the default experience in MySQL 5.7 to be secure by default. Part of this includes securing connections by automatically creating key material and using TLS for connections where possible. This may have some significant implications for third-party software – especially products which depend upon capturing, evaluating and/or redirecting client/server traffic at the network level. This blog post is intended to highlight for developers and users of such products potential issues they may want to consider or address during the pre-GA period for MySQL Server 5.7.
What types of products are dependent upon access to unencrypted protocol data? Most immediately apparent are proxy-based and network capture-based products. Proxy-based products typically rely on the same characteristics which can …
[Read more]