Changelog - 2026-09-12
An open stats route now says so at boot
EnhancementIn one line. stats: { enable: true } with no secretKey publishes GET /health/stats on every host, and until now it did so silently.
WARN [HealthCheckComponent-binding] GET /health/stats is ENABLED with no secretKey on env
"production" - build stamp, runtime version and memory are readable by anything that reaches this
port. Set stats.secretKey, or drop stats.enable and let the environment decide.What changed
- One warning at boot. It fires when the route is mounted (
stats.enable === true, orenableunset on a developmentNODE_ENV), nostats.secretKeyis configured, andNODE_ENVis outside the development environments, including unset. - No behaviour change.
enable: truewithout a key still mounts an open route, because on a cluster-internal port that is often right. The framework reports rather than refuses. - A blank
secretKeynever warns. A blank key fails closed. - An explicit
enableskips the environment gate. The gate only decides whenenableis unset, so a value added to open the route locally travels with the code to staging and production.
Ways to silence it:
ts
// the port is public: demand a header
application.component(HealthCheckComponent, {
options: { stats: { enable: true, secretKey: process.env.APP_ENV_HEALTH_SECRET_KEY } },
});
// or let the environment decide
application.component(HealthCheckComponent, { options: { stats: {} } });Who is affected
stats.enable: trueand asecretKey. Nothing. No warning.stats.enable: true, no key, on a dev machine. Nothing.stats.enable: true, no key, anywhere else. One warning per application at boot. The route behaves as before.