Mask sensitive values in airflow config update dry-run output - #73265
Open
keith991001 wants to merge 2 commits into
Open
keith991001 wants to merge 2 commits into
keith991001 wants to merge 2 commits into
Conversation
The dry-run mode of `airflow config update` (the default mode) printed the full regenerated airflow.cfg to stdout with real values, including sql_alchemy_conn, fernet_key and other credentials. The command is documented as a preview tool for the Airflow 3 config migration, so its output easily ends up in CI logs, bug reports and support channels, leaking those credentials. Sensitive options (per is_sensitive_option, the same registry used by `airflow config list --hide-sensitive`) are now written as '< hidden >' in the dry-run preview, with a new --show-sensitive flag to opt back into real values. The --fix path is unchanged: it always writes real values to airflow.cfg, since a masked value would corrupt the file. closes apache#73255
keith991001
requested review from
bugraoz93,
dheerajturaga,
henry3260 and
potiuk
as code owners
September 17, 2026 03:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dry-run mode of
airflow config update(the default mode) printed the full regeneratedairflow.cfgto stdout with real values —sql_alchemy_conn,fernet_key, SMTP credentials and every other sensitive option. Since the command is documented as a preview tool for the Airflow 3 config migration, its output easily lands in CI logs, bug reports and support channels, leaking those credentials.closes: #73255
What changed
AirflowConfigParser.write_custom_configgains ahide_sensitiveparameter: options registered as sensitive (viais_sensitive_option, the same registryairflow config list --hide-sensitiveuses) are written as< hidden >. Sensitivity is checked against both the original and the post-rename option name, so a renamed sensitive option stays masked.airflow config updatedry-run now masks sensitive values by default and prints a hint; a new--show-sensitiveflag opts back into real values.--fixpath is unchanged: it always writes real values toairflow.cfg, since a masked value would corrupt the config file. This is asserted by a test.Behavior
Verified against a real
AIRFLOW_HOMEwith an embedded DB password, plus three new unit tests (masked by default /--show-sensitivereveals /--fixwrites real values).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Fable 5) following the guidelines
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.