Bonjour à tous,
J'essaie de chiffrer des tables dans MariaDB mais ça plante.
J'ai la version "mariadb Ver 15.1 Distrib 10.11.4-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper" sous "Debian 12".
J'ai notamment essayé de suivre ces tuto :
- https://mariadb.com/kb/en/data-at-re...tion-overview/
- https://mariadb.com/kb/en/encryption-key-management/
- https://mariadb.com/kb/en/innodb-encryption-overview/
Ce que j'ai fait pour générer mes clés :
Note : je verai plus tard pour un algo plus performant.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 (echo -n "1;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile (echo -n "2;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile (echo -n "3;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile (echo -n "4;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile (echo -n "5;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile sudo openssl rand -hex 128 > /etc/mysql/encryption/keyfile.key sudo openssl enc -aes-256-cbc -md sha1 -pass file:/etc/mysql/encryption/keyfile.key -in /etc/mysql/encryption/keyfile -out /etc/mysql/encryption/keyfile.enc
Dans la section [mysqld] de /etc/mysql/mariadb.conf.d/50-server.cnf, j'ai mis :
Et bien entendu, j'ai relancé :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 plugin_load_add = file_key_management file_key_management file_key_management_filename = /etc/mysql/encryption/keyfile.enc file_key_management_filekey = FILE:/etc/mysql/encryption/keyfile.key file_key_management_encryption_algorithm = AES_CBC innodb_encrypt_tables = ON innodb_encrypt_temporary_tables = ON innodb_encrypt_log = ON innodb_encryption_threads = 4 innodb_encryption_rotate_key_age = 1
Et quand j'essaie de créer une table chiffrée :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 systemctl start mariadb
Ben ça plante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 mysql -uroot -p CREATE DATABASE foo; USE foo; CREATE TABLE a (i int) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
Si quelqu'un a une idée... Ca fait plusieurs jours que je bloque dessus...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 ERROR 1005 (HY000): Can't create table `foo`.`a` (errno: 140 "Wrong create options")
Th.
Partager