opencrvs / opencrvs-core

A global solution to civil registration
https://www.opencrvs.org
Other
85 stars 67 forks source link

Check environment variables are set before services start #5932

Open euanmillar opened 1 year ago

euanmillar commented 1 year ago

Before starting any service in packages/service, ensure all environment variables are set. If vars such as CHECK_INVALID_TOKEN are missed or set incorrectly in production, it can expose the application.

The impact of this is reduced risk of misconfiguration and significant reduction of time spent debugging in OpenCRVS instances installed either by us or SIs.

This can for instance be done using envalid library. Implement this also for country config.

Dev tasks

rikukissa commented 6 months ago

We do now have validation for deployment time environment variables. Having a process-level validation would still make a lot of sense however, as we have no control over deployment infrastructure of an implementing country