In-depth Percona Server/MySQL encryption
Robert Golebiowski Percona
In-depth Percona Server/MySQL encryption Robert Golebiowski - - PowerPoint PPT Presentation
In-depth Percona Server/MySQL encryption Robert Golebiowski Percona Keyrings Keyrings General Concept Plugin installation - always successful - keyrings variables may need correction - keyring_vault_config - keyring_file_data 3
Robert Golebiowski Percona
3
4
5
6
7
Per server separation of keyrings
8
keyring_vault’s configuration file vault_url vault_ca secret_mount_point token OPTIONAL
9
curl -L -H "X-Vault-Token: TOKEN" –cacert VAULT_CA
1
1 1
Keys do not contains server’s UUID
1 3
1 4
1 5
the table ?
it?
1 6
Encrypted tables validation
If any failed : Mark tablespace as missing
1 7
plaintext 128 bits of ciphertext 256 bit long encryption key ⨁ IV What crypto are used ?
(do not confuse with block_encryption_mode variable)
1 8
Master Key rotation
1 9
Master Key rotation Why needed ?:
2
Core dumps Could contain sensitive information like tablespace encryption keys and Master Key
No mitigation for leaked tablespace keys !
2 2
System encryption keys can be rotated (new version of a key is generated) PS 5.7 and < 8.0.14
5.7 and >= 8.0.14
2 3
Keys versioning Appends version to the key id in keyring: percona_binlog:1 (starts with version 1) SELECT rotate_system_key(“percona_binlog”); percona_binlog:2 (version 2)
Keyring encryption
2 5
2 6
2 7
Encryption threads
2 9
Background threads. Number of threads is set by variable innodb_encryption_threads Can :
3
SET GLOBAL innodb_encrypt_tables = ONLINE_TO_KEYRING; SET GLOBAL innodb_encryption_threads = 4; SET GLOBAL innodb_default_encryption_key_id = 0; CREATE TABLE t1 (a VARCHAR(255));
3 1
INNODB_TABLESPACE_ENCRYPTION (selected columns): SPACE NAME ENCRYPTION_ SCHEME MIN_KEY_ VERSION CURRENT_ KEY_VERSI ON CURRENT_ KEY_ID 42949672 94 mysql 1 1 1 innodb _syste m 1 1 1 4 test/t1 1 1 1
3 2
Re-encryption of a table with key rotation. innodb_encryption_rotate_key_age = 1 - re-encrypt all the tables every time key is rotated = 2 - re-encrypt all the tables every second time key is rotated etc = 0 -disable re-encryption SET GLOBAL rotate_system_key(“percona_innodb-0”);
3 3
INNODB_TABLESPACE_ENCRYPTION (selected columns): SPACE NAME ENCRYPTION_ SCHEME MIN_KEY_ VERSION CURRENT_ KEY_VERSI ON CURRENT_ KEY_ID 42949672 94 mysql 1 2 2 innodb _syste m 1 2 2 4 test/t1 1 2 2
3 4
Being more specific.
3 5
3 6
3 8
3 9
4
4 1
4 2
4 4
ON/OFF
encrypted/decrypted
4 6
Parallel double write buffer encryption: