Question
Change password using "op item edit" without having it on the command line?
I need to programmatically update the password for multiple entries in my vault.
This here works nicely:
op item edit some-item "password=noneofyourbusiness"
but it has 2 problems:
- obviously, the password shows up on the command line, so it is visible to other processes
- less obvious: this can break when passwords contain sensitive "shell characters", like "&"
The only way I see:
- do
op item get --format=json - within the script, manipulate that data and update the password field as needed
- turn the whole string into base64 (within the script)
- do something like
echo {} | base64 --decode | op item edit some-itemwhere {} would contain that base64 encoded json
I have done similar things in the past, but I hope: there is an easier way to achieve the same?
