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

Unable to migrate seal configuration away from AWS KMS #7952

Closed
trondiz opened this issue Nov 29, 2019 · 7 comments
Closed

Unable to migrate seal configuration away from AWS KMS #7952

trondiz opened this issue Nov 29, 2019 · 7 comments
Labels
bug Used to indicate a potential bug core/migration

Comments

@trondiz
Copy link

trondiz commented Nov 29, 2019

Describe the bug
I am unable to migrate away from awskms seal type if vault was initialized with the awskms seal configuration originally.

To Reproduce

  1. Initialize vault with awskms enabled
seal "awskms" {
  #disabled = "true"
  region = "eu-central-1"
  kms_key_id = "*redacted*"
}
  1. Modify config by adding disabled = "true" in the seal section.
  2. Restart vault
  3. vault operator unseal -migrate x3

Then I get the following error.

Error unsealing: Error making API request.

URL: PUT https://127.0.0.1:8200/v1/sys/unseal
Code: 500. Errors:

* error setting new barrier key information during migrate: stored keys are not supported

Expected behavior
I excpected the vault to be unsealed and converted to shamir Seal Type like described in the documentation: https://www.vaultproject.io/docs/concepts/seal.html#seal-migration

If the vault is first initialized without awskms the migration works as expected both ways. I believe this is a bug, or at least it is unclear in the documentation.

Is there a way to work around this for an existing cluster?

Environment:

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

Vault server configuration file(s):

seal "awskms" {
  region = "eu-central-1"
  kms_key_id = "*redacted*"
}
@michelvocks michelvocks added bug Used to indicate a potential bug core/migration labels Dec 2, 2019
@nlewo
Copy link

nlewo commented Jan 2, 2020

I'm hitting the same issue with the transit autounseal method.
My configuration is:

{
  "listener": {
    "tcp": {
      "address": "127.0.0.1:8200",
      "tls_disable": 1
    }
  },
  "storage": {
    "file": {
      "path": "/data"
    }
  },
  "disable_mlock": true,
  "seal": {
    "transit": {
      "disabled": "true",
      "address": "http://vaultInfra:8200",
      "disable_renewal": "false",
      "key_name": "autounseal",
      "mount_path": "transit/",
      "tls_skip_verify": "true"
    }
  }
}

And when I try to migrate, i get:

$ vault operator unseal -migrate
Unseal Key (will be hidden): 
Key                           Value
---                           -----
Seal Type                     shamir
Initialized                   true
Sealed                        true
Total Shares                  3
Threshold                     2
Unseal Progress               1/2
Unseal Nonce                  41531879-5565-bd37-5278-a6ca7dc242f3
Seal Migration in Progress    true
Version                       1.3.0
HA Enabled                    false

$ vault operator unseal -migrate
Unseal Key (will be hidden): 
Error unsealing: Error making API request.

URL: PUT http://localhost:8200/v1/sys/unseal
Code: 500. Errors:

* error setting new barrier key information during migrate: stored keys are not supported

@Garath620
Copy link

same issue for me too

@dclark
Copy link

dclark commented Feb 12, 2020

Same issue also for 1.3.1 using gcpckms keys when converting to shamir

@wink
Copy link

wink commented Feb 16, 2020

I also hit this issue when attempting to convert from awskms to shamir

@dclark
Copy link

dclark commented Feb 17, 2020

This issue has been resolved in Vault 1.3.2 #8172

Conversion from auto seal gcpckms to shamir is working as expected without the error.

@NagenderPulluri
Copy link

you need to add seal shamir block in configuration and add disable=true in seal awskms block

seal "shamir" {}

seal "awskms" {
region = "us-east-1"
kms_key_id = "your-kms-key-id"
disabled = "true"
}

refer below for more info

https://support.hashicorp.com/hc/en-us/articles/10375276754707-AWS-KMS-to-AWS-KMS-Seal-Migration

@hsejr
Copy link

hsejr commented Jul 19, 2024

@NagenderPulluri
I followed it, but if the KEY in KMS is deleted, the pod cannot start to perform the migration unseal.

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 core/migration
Projects
None yet
Development

No branches or pull requests

9 participants