Skip to content

Instantly share code, notes, and snippets.

@joelittlejohn
Last active June 18, 2020 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelittlejohn/08e978aa850e0a1f4f957245669f6d67 to your computer and use it in GitHub Desktop.
Save joelittlejohn/08e978aa850e0a1f4f957245669f6d67 to your computer and use it in GitHub Desktop.
Once-per-week rotation of AWS keys stored by aws-vault (alternative to crontab, useful for keychain access)
[ "$(find ~/.rotate -mtime -7 2>/dev/null)" ] || (for p in $(aws-vault list --profiles | grep -v default | grep -v mfa); do aws-vault rotate -n $p; done && touch ~/.rotate)
@joelittlejohn
Copy link
Author

joelittlejohn commented Jun 18, 2020

Once per week, you'll find that this process happens when you start a terminal. This allows access to the keychain without providing a keychain password in a crontab entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment