Is it possible to identify the heroku username of the current user connected to an app through a running console?
So say I connect to a rails console on my heroku app using
heroku run rails c --app my-app
I'd like to be able to run a command and have it print out:
Where [email protected] is the email / username of the user who connected to the console.
I tried a couple basic linux commands like
`whoami`
but you get a generic username like u12345
The goal is to instrument certain fields in our app with audit trails so that we can track when and who accessed sensitive information, as well as how they accessed it (CLI, through the Web UI, etc.)
I just asked heroku this same question via a support ticket, and they do not currently support this functionality. That said, you can use heroku logs to see who and when a rails console was opened.
2019-04-12T15:48:05.727693+00:00 app[api]: Starting process with command `rails console` by user [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With