ceph: destroy all vault keys on kv version 2
By default, keys stored in Vault KV Secret Engine are versioned and keys are soft-deleted, see Vault documentation: When deleting data the standard vault kv delete command will perform a soft delete. It will mark the version as deleted and populate a deletion_time timestamp. Soft deletes do not remove the underlying version data from storage, which allows the version to be undeleted. The vault kv undelete command handles undeleting versions. A version's data is permanently deleted only when the key has more versions than are allowed by the max-versions setting, or when using vault kv destroy. When the destroy command is used the underlying version data will be removed and the key metadata will be marked as destroyed. If a version is cleaned up by going over max-versions the version metadata will also be removed from the key. Signed-off-by: Sébastien Han <seb@redhat.com>
This commit is contained in:
1 parent
40a262c0f8
commit
7e0b58cc27
1 file changed
+4
@@ -126,6 +126,10 @@ func (c *Config) DeleteSecret(secretName string) error {
|
||||
}
|
||||
|
||||
k := buildKeyContext(c.clusterSpec.Security.KeyManagementService.ConnectionDetails)
|
||||
|
||||
// Force removal of all the versions of the secret on K/V version 2
|
||||
k[secrets.DestroySecret] = "true"
|
||||
|
||||
err = delete(v, GenerateOSDEncryptionSecretName(secretName), k)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "failed to delete secret in vault")
|
||||
|
||||
Reference in new issue
Block a user