BG-9584: Require node production config when running express against prod#181
Conversation
…prod Signed-off-by: Tyler Levine <tyler@bitgo.com>
Signed-off-by: Tyler Levine <tyler@bitgo.com>
cooncesean
left a comment
There was a problem hiding this comment.
All seems reasonable. Clean code, tests, and documentation.
I have not pulled this down to see if I can bypass the NodeEnvironmentError without passing disableenvcheck=true, but it all looks 👍
|
I have a suspicion that many of our customers running bitgo-express are not running with This PR changes express to require NODE_ENV to be production when running bitgo-express against the prod environment. However, this will break customers who are not setting NODE_ENV correctly today. I see a couple options:
After some consideration, I believe option 1 is the best choice. However, we should reach out to customers proactively to let them know that there is a security update for bitgo-express which will require a change to the customer's runtime configuration. |
|
Anything needed from me here? |
Not at this time. I haven't heard back from Olivia re: customer messaging, so I think I will adopt solution 2 above as an interim solution, while we figure out how to message our customers. Will update this diff to do that by EOD |
Codecov Report
@@ Coverage Diff @@
## master #181 +/- ##
==========================================
+ Coverage 62.77% 62.78% +0.01%
==========================================
Files 58 58
Lines 7360 7366 +6
==========================================
+ Hits 4620 4625 +5
- Misses 2740 2741 +1
Continue to review full report at Codecov.
|
Signed-off-by: Tyler Levine <tyler@bitgo.com>
When node is running in development mode, it can output some debugging information which reveals sensitive data about the system running bitgo-express. It is currently possible to run express against the BitGo production environment, while the node environment is development (which is the default), thus potentially exposing customer system information.
By requiring that NODE_ENV is production when running against prod, express will not output this debugging information.
Note that this behavior is overridable by passing the
--disableenvcheckflag when starting bitgo express, in case some customer wants to keep using the current behavior.Signed-off-by: Tyler Levine tyler@bitgo.com