Simplify secret sending procedure with a simple python script

We recently added some services that requires me, to generate and send accesses to users. I’m a lonely DevOps doing this, so I lose quite some time every week with these access requests. I cannot automate generating some of the secrets, because it requires human interaction or 2FA, but I can automate this:

  • Secret Gather (after the info has been created)
  • Secret creation on OTS
  • Secret sending via slack

So I started working on in and I came with this:

This script will basically:

  • Gather a secret from AWS, a file, or the command line
  • Generate the secret via onetimesecret API
  • Send it via slack, optionally, if you don’t specify an email, no slack message will be sent.

Now I just have to press enter, in what took me 5 minutes per user.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adrian Angel Sanz Melchor

Adrian Angel Sanz Melchor

Just a spanish DevOps who likes sharing useful knowledge, working proudly @ MrMilú