Skip to content

Instantly share code, notes, and snippets.

@rskuipers
Created March 4, 2020 21:57
Show Gist options
  • Save rskuipers/780a9c5c269163f73dac07ae9bd19d49 to your computer and use it in GitHub Desktop.
Save rskuipers/780a9c5c269163f73dac07ae9bd19d49 to your computer and use it in GitHub Desktop.
Detect logins with custom fields in your bitwarden vault
#!/bin/bash
# Download and install bitwarden CLI: https://help.bitwarden.com/article/cli/
# First login to access your vault:
# $ bw login
# Export the session variable as explained in the login output:
# export BW_SESSION="..."
for row in $(bw list items --organizationid null | jq -r '.[] | @base64'); do
row=$(echo "$row" | base64 -d -)
name=$(echo "$row" | jq -r '.name')
fields=$(echo "$row" | jq -r '.fields')
if [ "$fields" != "null" ]; then echo "$name has custom fields"; fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment