It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
Former Member
3 years agoUpdating Group Permissions on Multiple Vaults
I am looking for sort of command or process that I can use to change the permissions on multiple vaults (70+) for a group of users without having to go through each vault one by one.
I have had a...
Nhat_Nguyen
1Password Team
3 years agoHello @NateC, If you already have a list of vaults you want to set permissions to a group, we can use 1Password CLI and some help from jq to edit permissions for multiple vaults
If interested, you can go here to get the latest version of jq.
After that, we can try this commands to edit vault permissions for your group.
op vault list --format json | jq '.[].id' | Sed 's/"//g' > file.txt
This command will list all vaults and get their IDs, then it will strip double quotes wrap around IDs and send it to file.txt
We can then use while
loop to read each line in our file.txt and set permission for vaults on the list.
cat file.txt | while read i; do op vault group grant --group <name or id of the group> --vault $i --permissions <permissions>; done.
After setting permissions, we can remove the fle.txt that has the IDs of our vaults.
However, if you want, we can run all commands in one line without creating a file.txt like this.
op vault list --format json | \
jq '.[].id' | Sed 's/"//g' | \
while read i; do op vault group grant --group <name or id of the group> --vault $i --permissions <permissions>; done
Thank you.