Resolve team scoped spelling of per-key secrets-backend-kwarg options as sensitive - #71160
Open
abhishekmauryaKsolves wants to merge 2 commits into
Open
Conversation
abhishekmauryaKsolves
requested review from
bugraoz93,
choo121600,
ephraimbuddy,
henry3260,
jason810496,
pierrejeambrun,
rawwar and
shubhamraj-git
as code owners
August 5, 2026 08:04
abhishekmauryaKsolves
force-pushed
the
fix-71037-team-scoped-secrets-sensitivity
branch
from
August 5, 2026 08:06
89cc771 to
94f820e
Compare
… as sensitive
_is_per_key_sensitive_option and _mask_per_key_sensitive_options matched
literal section names ('secrets', 'workers') only, so a team scoped
spelling of the same option -- the [<team>=secrets] config-file section,
or the AIRFLOW__<TEAM>___SECRETS__BACKEND_KWARG__* env var, both of which
are reported under a section named after the team -- was never recognised
as sensitive.
Resolve the section to its base section via base_section_name (the same
helper AirflowConfigParser.is_sensitive_option uses for registered options,
introduced in apache#70755) before deciding sensitivity, in both
_is_per_key_sensitive_option and _mask_per_key_sensitive_options.
closes apache#71037
abhishekmauryaKsolves
force-pushed
the
fix-71037-team-scoped-secrets-sensitivity
branch
from
August 5, 2026 08:59
94f820e to
00fc794
Compare
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.
closes #71037
What
_is_per_key_sensitive_optionand_mask_per_key_sensitive_optionsinairflow-core/src/airflow/api_fastapi/core_api/services/public/config.pymatched literal section names (
secrets,workers) only. A team scopedspelling of the same option -- the
[<team>=secrets]config-file section,or the
AIRFLOW__<TEAM>___SECRETS__BACKEND_KWARG__*environment variable,both of which are reported under a section named after the team -- was
never recognised as sensitive.
Not exploitable today, since
_get_custom_secret_backendis not team-awareyet. But the gap becomes live the moment secrets backends gain team scoping,
and at that point it fails open: a team's backend credentials would be
returned in full by
GET /config.How
Both functions now resolve the section to its base section via
base_section_name-- the same helperAirflowConfigParser.is_sensitive_optionalready uses for registered sensitive options (introduced in #70755) --
before deciding whether the option is sensitive.
_is_per_key_sensitive_option: looks up the prefix underbase_section_name(section)instead ofsection._mask_per_key_sensitive_options: now iterates every section actuallypresent in
conf_dict(rather than only the literalsecrets/workerskeys) and resolves each one to its base section before matching. This
also covers the team scoped env var case, since
conf.as_dictalreadyreports it under the team-derived section.
Testing
Added
TestTeamScopedPerKeyBackendKwargMaskinginairflow-core/tests/unit/api_fastapi/core_api/routes/public/test_config.py,covering:
GET /configredacts a team scoped per-key option under both thesecretsandworkersteam scoped sections, while a non-sensitiveoption in the same response stays untouched.
GET /config/section/{section}/option/{option}redacts a team scopedper-key option the same way it redacts the non-team-scoped one.
Full
test_config.pysuite run clean: 3377 passed, 0 failed.