Closed pieter-lautus closed 2 years ago
This is now better documented; CREATE/UPDATE endpoints always overwrite the role completely with all specified arguments and the defaults of any missing arguments.
There's new PATCH functionality in 1.11 that'll allow you to update specific fields, but note that the vault
CLI doesn't support PATCH operations to non-KV endpoints. Hopefully a future CLI version will support that functionality :-)
Describe the bug When setting individual keys on a PKI role, for example to toggle allow_wildcard_certificates from true to false, then several unrelated keys are modified (reset to their defaults?) at the same time.
In other words, when editing a PKI role, one has to be careful to specify all keys and values lest you lose important settings
To Reproduce
vault write pki/roles/example allow_bare_domains=true allowed_domains=foo.example.com client_flag=false server_flag=true max_ttl=7d key_bits=4096 allow_wildcard_certificates=true
vault read pki_lxd_images_ro/roles/example > before
vault write pki/roles/example allow_wildcard_certificates=false
vault read pki_lxd_images_ro/roles/example > after
diff -u before after
Expected behavior I expect the write in step 3 to only modify a single key. Instead several values are modified. In the process one can accidentally lose security-sensitive settings one took great pains to set.
Environment: