forked from hashicorp/vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix re-migration of existing CA bundles (hashicorp#21316)
* Fix re-migration of existing version 1 storage bundles Related: VAULT-17307 Signed-off-by: Alexander Scheel <[email protected]> * Add test for v1->v2 migration post-issuer deletion Signed-off-by: Alexander Scheel <[email protected]> * Add changelog entry Signed-off-by: Alexander Scheel <[email protected]> * Add known-issue about PKI double migration Signed-off-by: Alexander Scheel <[email protected]> * Update website/content/partials/pki-double-migration-bug.mdx Co-authored-by: Sarah Chavis <[email protected]> * Update website/content/partials/pki-double-migration-bug.mdx Co-authored-by: Sarah Chavis <[email protected]> * Update website/content/partials/pki-double-migration-bug.mdx * Additional clarity around known issue Signed-off-by: Alexander Scheel <[email protected]> --------- Signed-off-by: Alexander Scheel <[email protected]> Co-authored-by: Sarah Chavis <[email protected]>
- Loading branch information
Showing
7 changed files
with
164 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```release-note:bug | ||
secrets/pki: Prevent deleted issuers from reappearing when migrating from a version 1 bundle to a version 2 bundle (versions including 1.13.0, 1.12.2, and 1.11.6); when managed keys were removed but referenced in the Vault 1.10 legacy CA bundle, this the error: `no managed key found with uuid`. | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
### PKI storage migration revives deleted issuers | ||
|
||
Vault 1.11 introduced Storage v1, a new storage layout that supported | ||
multiple issuers within a single mount. Bug fixes in Vault 1.11.6, 1.12.2, | ||
and 1.13.0 corrected a write-ordering issue that lead to invalid CA chains. | ||
Specifically, incorrectly ordered writes could fail due to load, resulting | ||
in the mount being re-migrated next time it was loaded or silently | ||
truncating CA chains. This collection of bug fixes introduced Storage v2. | ||
|
||
#### Affected versions | ||
|
||
Vault may incorrectly re-migrated legacy issuers created before Vault 1.11 that | ||
were migrated to Storage v1 and deleted before upgrading to a Vault version with | ||
Storage v2. | ||
|
||
The migration fails when Vault finds managed keys associated with the legacy | ||
issuers that were removed from the managed key repository prior to the upgrade. | ||
|
||
The migration error appears in Vault logs as: | ||
|
||
> Error during migration of PKI mount: | ||
> failed to lookup public key from managed key: | ||
> no managed key found with uuid | ||
<Note> | ||
Issuers created in Vault 1.11+ and direct upgrades to a Storage v2 layout are | ||
not affected. | ||
</Note> | ||
|
||
The Storage v1 upgrade bug was fixed in Vault 1.14.1, 1.13.5, and 1.12.9. |