Vault general fixes and security hardening#83697
Vault general fixes and security hardening#83697bcoca wants to merge 39 commits intoansible:develfrom
Conversation
2caac12 to
84a53e6
Compare
* enable type checking on more public vault API
can remove adding exc test as it would now be dupe ansible.parsing.vault.AnsibleVaultError: Unable to encrypt vault with unsupported method. Invalid value "rotten" for configuration option "setting: VAULT_METHOD ", valid values are: aes256, v2
Also fix docstring.
When config is used to specify the vault method, config reports the error. When the CLI is used, argparse handles the error because choices is set. When the API is used, load_vault_method reports the error. This ensures the error message is appropriate for the context in which the invalid method was specified.
also some fixes
Also fix x2 exception reporting Only caches on decrypt, encrypt won't hit cache due to salt generation note: w/o cache, decrypt takes same time as encrypt
d3773fe to
3f9dab2
Compare
|
@bcoca how does this affect existing secrets encrypted with an older version of vault (and the old cipher)? Do I now need to specify If so, I wonder if this would also require changes in Ansible Tower to handle existing secrets gracefully. |
|
Decryption takes the info from the vault itself, so as not to impose any additional requirements on the user. The existing vaults will keep working until we fully retire the old encryption method in the 'far off' future, there will be a full deprecation cycle then. The new method becomes the default for encrypting in this PR, so if you want to continue using the old method to encrypt, then you do need to pass that explicitly, either on the CLI or via configuration. There is a documentation update that will go out at the time this PR is merged to ensure all this is explained to users. |
Set new default Vault cipher to take the place of the, now deemed week, AES256 cipher, which is still kept for backwards compatibility.
also fixes #51862
ISSUE TYPE