The Hashicorp Plugin seems to recognise new encryption keys in vault - but does not rotate them.
Reproduce by:
- Install mariadb-server & mariadb-plugin-hashicorp-key-management 10.9.1
- Install hashicorp vault, init and unseal vault
- create secret engine & set a secret key:
vault secrets enable -path /mariadb -version=2 kv
|
vault kv put /mariadb/1 data=$(openssl rand -hex 32)
|
- enable encryption by adding the following block to mariadb section in /etc/mysql/mariadb.conf.d/50-server.cnf:
[mariadb]
|
|
plugin_load_add = hashicorp_key_management
|
hashicorp-key-management-vault-url=http://127.0.0.1:8200/v1/mariadb
|
hashicorp-key-management-token=xxxxxxxxxxxxxxxxx
|
|
innodb_encrypt_tables = FORCE
|
innodb_encrypt_log = ON
|
innodb_encrypt_temporary_tables = ON
|
|
encrypt_tmp_disk_tables = ON
|
encrypt_tmp_files = ON
|
encrypt_binlog = ON
|
aria_encrypt_tables = ON
|
|
innodb_encryption_threads = 4
|
innodb_encryption_rotation_iops = 2000
|
log_error=server.log
|
CURRENT_KEY_VERSION -> 2
CURRENT_KEY_ID -> 1
there seems to be no possibility to re-encrypt the tables.
In the documentation the Hashicorp Plugin ist not listed as "with-" nor "without Key Rotation Support":
https://mariadb.com/kb/en/encryption-key-management/#support-for-key-rotation-in-encryption-plugins
{"report":{"fcp":790.6000003814697,"ttfb":193.60000038146973,"pageVisibility":"visible","entityId":113446,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"419e7b6c-e1f7-423d-8d09-8653596a5c04","navigationType":0,"readyForUser":907.8000001907349,"redirectCount":0,"resourceLoadedEnd":506.1000003814697,"resourceLoadedStart":201.60000038146973,"resourceTiming":[{"duration":8.899999618530273,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":201.60000038146973,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":201.60000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":210.5,"responseStart":0,"secureConnectionStart":0},{"duration":9.799999237060547,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":201.9000005722046,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":201.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":211.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":179.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":202,"connectEnd":202,"connectStart":202,"domainLookupEnd":202,"domainLookupStart":202,"fetchStart":202,"redirectEnd":0,"redirectStart":0,"requestStart":216.80000019073486,"responseEnd":381.30000019073486,"responseStart":240.30000019073486,"secureConnectionStart":202},{"duration":304,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":202.10000038146973,"connectEnd":202.10000038146973,"connectStart":202.10000038146973,"domainLookupEnd":202.10000038146973,"domainLookupStart":202.10000038146973,"fetchStart":202.10000038146973,"redirectEnd":0,"redirectStart":0,"requestStart":219.10000038146973,"responseEnd":506.1000003814697,"responseStart":241.69999980926514,"secureConnectionStart":202.10000038146973},{"duration":45.39999961853027,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":202.30000019073486,"connectEnd":202.30000019073486,"connectStart":202.30000019073486,"domainLookupEnd":202.30000019073486,"domainLookupStart":202.30000019073486,"fetchStart":202.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":219.5,"responseEnd":247.69999980926514,"responseStart":243.4000005722046,"secureConnectionStart":202.30000019073486},{"duration":45.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":202.30000019073486,"connectEnd":202.30000019073486,"connectStart":202.30000019073486,"domainLookupEnd":202.30000019073486,"domainLookupStart":202.30000019073486,"fetchStart":202.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":220.4000005722046,"responseEnd":248.10000038146973,"responseStart":244.19999980926514,"secureConnectionStart":202.30000019073486},{"duration":13.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":202.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":202.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":216.30000019073486,"responseStart":0,"secureConnectionStart":0},{"duration":45.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":202.5,"connectEnd":202.5,"connectStart":202.5,"domainLookupEnd":202.5,"domainLookupStart":202.5,"fetchStart":202.5,"redirectEnd":0,"redirectStart":0,"requestStart":221.19999980926514,"responseEnd":248.19999980926514,"responseStart":244.9000005722046,"secureConnectionStart":202.5},{"duration":15.800000190734863,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":202.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":202.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":218.5,"responseStart":0,"secureConnectionStart":0},{"duration":45.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":202.69999980926514,"connectEnd":202.69999980926514,"connectStart":202.69999980926514,"domainLookupEnd":202.69999980926514,"domainLookupStart":202.69999980926514,"fetchStart":202.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":221.30000019073486,"responseEnd":248.5,"responseStart":245.69999980926514,"secureConnectionStart":202.69999980926514},{"duration":49.69999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":202.9000005722046,"connectEnd":202.9000005722046,"connectStart":202.9000005722046,"domainLookupEnd":202.9000005722046,"domainLookupStart":202.9000005722046,"fetchStart":202.9000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":224.4000005722046,"responseEnd":252.60000038146973,"responseStart":249.10000038146973,"secureConnectionStart":202.9000005722046},{"duration":273.1000003814697,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":206.30000019073486,"connectEnd":206.30000019073486,"connectStart":206.30000019073486,"domainLookupEnd":206.30000019073486,"domainLookupStart":206.30000019073486,"fetchStart":206.30000019073486,"redirectEnd":0,"redirectStart":0,"requestStart":239.80000019073486,"responseEnd":479.4000005722046,"responseStart":475.80000019073486,"secureConnectionStart":206.30000019073486},{"duration":274,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":206.4000005722046,"connectEnd":206.4000005722046,"connectStart":206.4000005722046,"domainLookupEnd":206.4000005722046,"domainLookupStart":206.4000005722046,"fetchStart":206.4000005722046,"redirectEnd":0,"redirectStart":0,"requestStart":243,"responseEnd":480.4000005722046,"responseStart":478.1000003814697,"secureConnectionStart":206.4000005722046},{"duration":101.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":537,"connectEnd":537,"connectStart":537,"domainLookupEnd":537,"domainLookupStart":537,"fetchStart":537,"redirectEnd":0,"redirectStart":0,"requestStart":598.6000003814697,"responseEnd":638.5,"responseStart":637.4000005722046,"secureConnectionStart":537},{"duration":80.69999980926514,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":781.3000001907349,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":781.3000001907349,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":862,"responseStart":0,"secureConnectionStart":0},{"duration":109.10000038146973,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":788.1999998092651,"connectEnd":788.1999998092651,"connectStart":788.1999998092651,"domainLookupEnd":788.1999998092651,"domainLookupStart":788.1999998092651,"fetchStart":788.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":863,"responseEnd":897.3000001907349,"responseStart":896.9000005722046,"secureConnectionStart":788.1999998092651}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":44,"responseStart":194,"responseEnd":201,"domLoading":197,"domInteractive":978,"domContentLoadedEventStart":978,"domContentLoadedEventEnd":1027,"domComplete":1227,"loadEventStart":1227,"loadEventEnd":1227,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":952.3000001907349},{"name":"bigPipe.sidebar-id.end","time":953.1000003814697},{"name":"bigPipe.activity-panel-pipe-id.start","time":953.3000001907349},{"name":"bigPipe.activity-panel-pipe-id.end","time":955},{"name":"activityTabFullyLoaded","time":1048.9000005722046}],"measures":[],"correlationId":"aaf9666418b3a3","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":77,"dbReadsTimeInMs":12,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
sysprg, why is it not possible to re-encrypt the table? As far as I can see from the plugin code, it caches the latest key version, so it might immediately notice that the key was rotated, but the cache expires in cache_version_timeout milliseconds (which is 0 by default, btw). Why the server doesn't notice that the key was rotated in the vault?