Mask password-format Param values in conf, logs, and rendered templates - #72499
Mask password-format Param values in conf, logs, and rendered templates#72499RehanAhmad25 wants to merge 2 commits into
Conversation
|
Thanks for contribution! One thing I noticed in the task-log masking path: when if conf.getboolean("core", "dag_run_conf_overrides_params") and dagrun_conf:
logger.debug("Updating task params (%s) with DagRun.conf (%s)", params, dagrun_conf)
params.update(dagrun_conf)
resolved_params = params.validate()
_mask_password_params(params, resolved_params)
return resolved_paramsThis means a password-format value from Could we either register password-format values before this log line, or avoid logging raw |
8b59be9 to
13ee14c
Compare
|
Thanks for the review @fat-catTW . Fixed by masking against the raw Added a regression test ( |
Adds
format="password"as a supported JSON Schema keyword forParam, and closes the loop on where that value ends up plaintext today.The trigger-form input side of this already worked (
FieldPassword.tsxalready masks the input wheneverschema.format == "password"), but nothing downstream of that respected the declaration. This PR:mask_secret()inprocess_params()(task-sdk), so they're redacted in Task Logs and Rendered Templates. Verified this in source:_serialize_rendered_fields()intask-sdk/src/airflow/sdk/execution_time/task_runner.pycallsredact()against the same masker singleton, in the worker, before rendered fields are sent to the API server.confin the DAG Run Details page and REST API: a helper checks each top-levelconfkey against its DAG's declaredParamschema and replaces the value with***whenformat == "password". Applied toget_dag_run, both pagination branches ofget_dag_runs(including thedag_id="~"all-DAGs case, resolved per-run against that run's own DAG), andget_list_dag_runs_batch.Deliberately out of scope for this PR (discussed on the issue):
redact(). This is the same known limitation that already applies toConnection.passwordtoday (confirmed:_mask_connection_secrets()masks it "from logs" per its own docstring, nothing else).confat rest in the metadata DB is flagged as a separate, larger discussion rather than folded into this fix.formaton a sub-propertyformat="password"is only honored on string-typed params for now.Docs for
format="password"incore-concepts/params.rstwill follow in a follow-up commit on this PR (or a fast-follow), explicitly stating what's covered and what isn't so nobody assumes broader coverage than what's implemented.Closes: #72377
Was generative AI tooling used to co-author this PR?
Generated-by: Claude (Anthropic) following the guidelines