Skip to content

fix(secretstores.vault): Preserve sibling keys when setting a secret#19293

Open
skartikey wants to merge 1 commit into
influxdata:masterfrom
skartikey:fix/secretstores-vault-set-siblings
Open

fix(secretstores.vault): Preserve sibling keys when setting a secret#19293
skartikey wants to merge 1 commit into
influxdata:masterfrom
skartikey:fix/secretstores-vault-set-siblings

Conversation

@skartikey

Copy link
Copy Markdown
Contributor

Summary

Setting a secret with telegraf secrets set wrote only the new key to the secret path, and Vault's Put replaces the whole secret at the path rather than merging, so every other key stored at that path was silently removed.

This reads the existing secrets at the path first and sets the new key on top of them before writing back. A not-found path is treated as empty so setting into a brand-new path still works, while any other read error aborts the write so a transient failure cannot overwrite existing secrets.

Checklist

Related issues

resolves #19287

@telegraf-tiger

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pr to fix corresponding bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

secretstores.vault: Setting a secret removes all other secrets at the same path

1 participant