Expand description
Secret masking. The value of every environment variable named DRE_SECRET_*, and of every
environment variable profiles.yml reads through env_var() into a secret field (one the
plugin declares secret, or named like password, token, api_key), is replaced by
***** in everything DRE writes for people to read: the console, logs/dre.log, JSON events,
run_results.json and the compiled SQL in target/compiled/. The SQL actually sent to the
database is unchanged. mask_secrets: false in dre_project.yml turns masking off.
JSON is redacted structurally, before it is serialized: serializing escapes ", \ and
control characters, so masking the finished text would miss a secret that contains them. Use
to_json_pretty / to_json_line for every JSON surface, never mask on JSON text.
Every value is masked, however short. One shorter than 4 characters is masked where it stands
alone (not inside a longer word or number), so a PIN of 12 masks PIN 12 but leaves 2012
readable.
Constants§
Functions§
- contains_
secret - Whether masking is enabled and
scontains a complete registered secret. - env_
references - The environment variables a template reads through
env_var('NAME')(either quote). - mask
swith every secret value replaced by*****.- mask_
source_ error - Mask a source error before it reaches logs or output. Source plugins can transform or truncate a request in their diagnostics, so exact replacement is not sufficient for a secret-bearing request. In that case the opaque detail is omitted instead.
- redact_
json vwith every secret value replaced by*****in all strings and object keys. Colliding masked keys receive#2,#3, and so on rather than silently replacing another entry.- register_
secret_ field - Mask the values of the environment variables a secret profile field reads through
env_var(), at any depth ofvalue. - register_
secret_ fields - Mask the
env_var()values that the secret fields offields(a profile target) read, nested blocks (ssh:) included.secretadds names a plugin declares secret. - register_
values - Mask these values from now on: a query’s
secret_columns. - secret_
field_ name - Whether a profile field’s name says it holds a secret. Paths, hosts and fingerprints don’t
count (
private_key_path,host_key_fingerprint): masking them would hide what a message is about, and they aren’t secrets. - set_
enabled - to_
json_ line - One-line JSON of
vwith secrets redacted first. - to_
json_ pretty - Pretty JSON of
vwith secrets redacted first.