Skip to content

Instantly share code, notes, and snippets.

@NonLogicalDev
Last active January 6, 2021 08:42
Show Gist options
  • Select an option

  • Save NonLogicalDev/25440f51b8e2d14ffe29fbfc7f178a23 to your computer and use it in GitHub Desktop.

Select an option

Save NonLogicalDev/25440f51b8e2d14ffe29fbfc7f178a23 to your computer and use it in GitHub Desktop.
List all token accessors with creation dates and met information.
#!/bin/sh
vault list -format json /auth/token/accessors \
| jq -r '.[]' | xargs -I % vault token lookup -format=json -accessor % \
| jq -cr '.data|[(.creation_time | todate),.accessor,.display_name,(.meta|tojson)]|join("%%")' \
| column -t -xs %% | sort -h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment