Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rekey Vault cluster with auto-unseal enabled #29503

Open
glisav opened this issue Feb 4, 2025 · 0 comments
Open

Rekey Vault cluster with auto-unseal enabled #29503

glisav opened this issue Feb 4, 2025 · 0 comments
Labels
bug Used to indicate a potential bug

Comments

@glisav
Copy link

glisav commented Feb 4, 2025

Describe the bug
I am using v1.18.1 OSS with auto-unseal enabled (Azure). I did a rekey process and wanted to encrypt the output via GPG, with the following command:

$ vault operator rekey -init -key-shares=4 -key-threshold=4 -pgp-keys="key1.asc,key2.asc,key3.asc,key4.asc" -target=recovery

I am trying to rekey again, but get the error:

Error posting unseal key: Error making API request.

URL: PUT https://$VAULT_ADDR/v1/sys/rekey-recovery-key/update
Code: 400. Errors:

To Reproduce
Steps to reproduce the behavior:

  1. Run vault operator rekey -init -key-shares=4 -key-threshold=4 -pgp-keys="key1.asc,key2.asc,key3.asc,key4.asc" -target=recovery
  2. Decrypt encrypted recovery keys
  3. Run again vault operator rekey -init -key-shares=4 -key-threshold=4 -pgp-keys="key1.asc,key2.asc,key3.asc,key4.asc" -target=recovery
  4. It requires to provide each one of the recovery keys, but in the last step it gives this error:

Error posting unseal key: Error making API request.

URL: PUT https://$VAULT_ADDR/v1/sys/rekey-recovery-key/update
Code: 400. Errors:

Expected behavior
From my understanding, it should produce four new recovery keys encrypted with PGP keys provided in the command, maintaining the order.

Environment:

  • Vault Server Version (retrieve with vault status): 1.18.1
  • Vault CLI Version (retrieve with vault version): 1.18.1
  • Server Operating System/Architecture:

Vault server configuration file(s):

seal "azurekeyvault" {
          client_id      = "CLIENT_ID"
          client_secret  = "CLIENT_SECRET"
          tenant_id      = "TENANT_ID"
          vault_name     = "VAULT_NAME"
          key_name       = "KEY_NAME"
        }

Additional context
Add any other context about the problem here.

@aslamovamir aslamovamir added the bug Used to indicate a potential bug label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug
Projects
None yet
Development

No branches or pull requests

2 participants