WIPACrepo / wipac-dev-tools

Common, basic, and reusable development tools
MIT License
0 stars 0 forks source link

Obfuscate Sensitive Env Vars #70

Closed ric-evans closed 1 year ago

ric-evans commented 1 year ago

Logging env vars is really useful for debugging, but sometimes they include sensitive data. Env vars with these substrings will be obfuscated: ["token", "auth", "pass", "secret"] (case-insensitive).

Now, logging will look like this:

(env) AUTH_AUDIENCE: ***
(env) AUTH_OPENID_URL: ***
(env) MONGODB_AUTH_PASS: ***
(env) MONGODB_AUTH_USER: ***
(env) MONGODB_HOST: skydriver-mongo
(env) MONGODB_PORT: 27017
(env) REST_HOST: 0.0.0.0
(env) K8S_SECRET_NAME: ***
(env) K8S_BACKOFF_LIMIT: 0
(env) KEYCLOAK_CLIENT_SECRET_BROKER: ***
(env) KEYCLOAK_CLIENT_ID_SKYDRIVER_REST: skydriver-internal
(env) KEYCLOAK_CLIENT_SECRET_SKYDRIVER_REST: ***