Skip to content

PBS-39 feature: Add binlog encryption config and keyring support (part 1) - #162

Merged
percona-ysorokin merged 1 commit into
Percona-Lab:0.4from
percona-ysorokin:encryption_main_config
Jul 30, 2026
Merged

PBS-39 feature: Add binlog encryption config and keyring support (part 1)#162
percona-ysorokin merged 1 commit into
Percona-Lab:0.4from
percona-ysorokin:encryption_main_config

Conversation

@percona-ysorokin

Copy link
Copy Markdown
Collaborator

https://perconadev.atlassian.net/browse/PBS-39

'binsrv::storage_config' extended with new optional field 'encryption' of class 'binsrv::encryption_config' that if present indicates that binlog data files in the storage should be encrypted and holds encryption configuration parameters (currently only 'format' and 'keyring_uri').

Added config validation functions for 'binsrv::encryption_config' and 'binsrv::storage_config'.

Added new abstract class 'binsrv::basic_keyring' that provides basic interface for working with encryption keys (currently only 'get_key()' method).

Added new model classes (based on 'util::nv_tuple') for representing individual encryption keys and their collections: 'binsrv::keyring_record' and 'binsrv::keyring_record_collection'.

Added concrete implementation of the 'binsrv::basic_keyring' interface called 'binsrv::file_keyring' that uses 'binsrv::keyring_record_collection' underneath.

Added new factory class 'binsrv::keyring_factory' that helps with constructing concrete implementation of the 'binsrv::basic_keyring' interface based on the provided URI (the value taken from the '<storage.encryption.keyring_uri>' configuration parameter).

Main application extended with analyzing optional encryption configuration section, printing its primary parameters to the log file, creating an instance of concrete 'binsrv::basic_keyring' interface using 'binsrv::keyring_factory' class, and printing loaded keyring statistics (number of keys and key/algorithm pairs).

Introduced 'utils::hex_value' class that holds a byte blob that can be serialized to / from a hex string. This class is supposed to be used in configuration files to store binary data.

Similarly to 'native_file_operations_helpers.hpp' introduced new 'file_operations_helpers.hpp' header file in the 'util' namespace which provides simple functions for reading / writing file content (using 'std::ifstream' / 'std::ofstream') into 'std::string'. 'binsrv::filesystem_storage_backend', 'binsrv::main_config', and binsrv::keyring_record_collection refactored to use these helper functions.

Sample configuration file ('main_config.json') extended with the '<storage.encryption>' section.
Added a sample file representing file keyring data in JSON format ('file_keyring_data.json').

Updated 'README.md' file with new configuration section description.

…t 1)

https://perconadev.atlassian.net/browse/PBS-39

'binsrv::storage_config' extended with new optional field 'encryption' of class
'binsrv::encryption_config' that if present indicates that binlog data files in the storage
should be encrypted and holds encryption configuration parameters (currently only
'format' and 'keyring_uri').

Added config validation functions for 'binsrv::encryption_config' and 'binsrv::storage_config'.

Added new abstract class 'binsrv::basic_keyring' that provides basic interface for
working with encryption keys (currently only 'get_key()' method).

Added new model classes (based on 'util::nv_tuple') for representing individual
encryption keys and their collections: 'binsrv::keyring_record' and
'binsrv::keyring_record_collection'.

Added concrete implementation of the 'binsrv::basic_keyring' interface called
'binsrv::file_keyring' that uses 'binsrv::keyring_record_collection' underneath.

Added new factory class 'binsrv::keyring_factory' that helps with constructing concrete
implementation of the 'binsrv::basic_keyring' interface based on the provided URI
(the value taken from the '<storage.encryption.keyring_uri>' configuration parameter).

Main application extended with analyzing optional encryption configuration section,
printing its primary parameters to the log file, creating an instance of concrete
'binsrv::basic_keyring' interface using 'binsrv::keyring_factory' class,  and printing
loaded keyring statistics (number of keys and key/algorithm pairs).

Introduced 'utils::hex_value' class that holds a byte blob that can be serialized to / from a hex string. This class is supposed to be used in configuration files to store binary
data.

Similarly to 'native_file_operations_helpers.hpp' introduced new
'file_operations_helpers.hpp' header file in the 'util' namespace which provides simple
functions for reading / writing file content (using 'std::ifstream' / 'std::ofstream') into
'std::string'. 'binsrv::filesystem_storage_backend', 'binsrv::main_config', and
`binsrv::keyring_record_collection` refactored to use these helper functions.

Sample configuration file ('main_config.json') extended with the '<storage.encryption>'
section.
Added a sample file representing file keyring data in JSON format
('file_keyring_data.json').

Updated 'README.md' file with new configuration section description.
@percona-ysorokin
percona-ysorokin force-pushed the encryption_main_config branch from af8ff4b to 4c8a2c1 Compare July 30, 2026 01:31
@percona-ysorokin
percona-ysorokin merged commit 3fa03b3 into Percona-Lab:0.4 Jul 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant