pm2
pm2 copied to clipboard
Disabling or restricting `pm2 env` command
We're being very careful about not leaking credentials on our infrastructure, so we use encryped env files (decrypt, set variables, run long-living app, then unset variables). So a different login won't have access to env variables (not set in .profile).
Problem is pm2 env
exposes the env variables to any login session.
Is there any way to disable or restrict pm2 env
?
Thanks
Good question. I would like to know how to restrict or prevent pm2 env to expose the env variables.
Hey @trekze. How are you loading your variables?
I created a new instance for tests:
- The first time I loaded the variables using the .env file. And I couldn't retrieve the variables using pm2 env.
- The second time I loaded the variables via command line ex.: PORT=3000 pm2 start HTTP_API
I'm thinking that using the .env file and the dotenv vault to encrypt it is the way to go. Are you already try to use dotenv vault?