generated from bdmorin/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathop-gen-ids.fish
25 lines (22 loc) · 914 Bytes
/
op-gen-ids.fish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env fish
echo "# gathering users"
set --global op_user_list (op user list | awk '{print $1}' | tail -n +2)
echo "# gathering groups"
set --global op_group_list (op group list | awk '{print $1}' | tail -n +2)
echo "# gathering vaults"
set --global op_vault_list (op vault list | awk '{print $1}' | tail -n +2)
for vault in $op_vault_list
echo "# processing $vault"
for user in $op_user_list
echo "# processing $user in $vault"
echo op vault user revoke --vault $vault --user $user --permissions export_items,print_items
end
for group in $op_group_list
echo "# processing $group in $vault"
echo op vault group revoke --vault $vault --group $group --permissions export_items,print_items
end
end
# This process is really slow, so run the output through parellel
# fish op-gen-ids.fish > revoke.cmd
# parallel -j 8 < revoke.cmd
# or whatever suits you.