Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Verifying MariaDB 10.1 encryption

I have set up table-level InnoDB database encryption on MariaDB.

I'd like to know if there is any way to confirm that the data is truly encrypted. I've tried searching /var/lib/mysql/ibdata1 for sample data in the tables, but I don't know if that's a reliable test or not.

like image 665
MarkRoland Avatar asked Nov 20 '15 02:11

MarkRoland


People also ask

How do I know if my mysql database is encrypted?

If a general tablespace contains tables, check the table information to see if the table is encrypted. When the general tablespace contains no tables, you may verify if the tablespace is encrypted or not. For single tablespaces, verify the ENCRYPTION option using INFORMATION_SCHEMA.

How do I enable encryption in MariaDB?

In order to enable encryption in MariaDB, you'll first need to generate encrypted keys that'll be used in encryption. Generate random 4-5 HEX strings using openssl utility, starting with the line number and a semicolon “;”. Now, encrypt these keys with a long random password.

Is MariaDB encrypted by default?

MariaDB does not, by default, use encryption during data transmission over the network from server to client. However, using the default setup could provoke a potential hacker to eavesdrop on an unsecured / unencrypted channel.

Is MariaDB connection encrypted?

MariaDB Enterprise Server and MariaDB Community Server support data-in-transit encryption, which secures data transmitted over the network. The server and the clients encrypt data using the Transport Layer Security (TLS) protocol, which is a newer version of the Secure Socket Layer (SSL) protocol.


2 Answers

I posted this question on mariadb.com, and the suggestion there was to perfom a grep for some known data.

A DBA at Rackspace suggested using the strings command instead, to better handle the binary data, for example:

strings /var/lib/mysql/sample_table/user.ibd | grep "knownuser"

This approach returns no results on an encrypted table and does return results on an unencrypted table (assuming both have "knownuser" loaded into them).

like image 119
MarkRoland Avatar answered Sep 30 '22 17:09

MarkRoland


You can query information_schema.innodb_tablespaces_encryption. When innodb tablespace is encrypted it is present in the table.

SELECT * FROM information_schema.INNODB_TABLESPACES_ENCRYPTION 
WHERE NAME LIKE 'db_encrypt%';

source

like image 41
Luis Avatar answered Sep 30 '22 17:09

Luis