Extend DEFAULT_SENSITIVE_FIELDS with webhook_url, bearer, dsn, auth_header, service_key#66673
Conversation
DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker
for masking Variables and Connection extras. Several common field
names used by official Airflow providers and standard HTTP/database
configurations are not in the allowlist.
This commit adds five field names commonly used in connection extras
and provider configurations:
- webhook_url — Slack provider webhook URL key
- bearer — HTTP bearer-token auth key
- dsn — database connection strings (which typically embed
credentials, e.g. postgres://user:pass@host/db)
- auth_header — custom HTTP auth header values
- service_key — service-account-like keys
Related: airflow-s/airflow-s#377
Generated-by: Claude Opus 4.7 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
amoghrajesh
left a comment
There was a problem hiding this comment.
Thanks for adding this.
One thing worth considering is that providers already declare which extra fields are sensitive via "format": "password" in provider.yaml conn-fieldsand ProvidersManager already tracks this as is_sensitive=True on each ConnectionFormWidgetInfo. If we can get the secrets masker to read that and add it in, this whole process could be automated.
That way any provider that correctly declares a password field gets it masked automatically, without needing manual additions to the core allowlist.
This can be in follow PR right @amoghrajesh ? |
amoghrajesh
left a comment
There was a problem hiding this comment.
Totally, rest for follow up
Backport successfully created: v3-2-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
…eld names (apache#66673) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: airflow-s/airflow-s#377 (cherry picked from commit 32ac8ad) Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
…eld names (apache#66673) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: airflow-s/airflow-s#377 (cherry picked from commit 32ac8ad) Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
…pache#66673) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: https://github.com/airflow-s/airflow-s/issues/377 Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions
…eld names (#66673) (#66991) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: https://github.com/airflow-s/airflow-s/issues/377 (cherry picked from commit 32ac8ad) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
…eld names (#66673) (#66991) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: airflow-s/airflow-s#377 (cherry picked from commit 32ac8ad) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
…eld names (#66673) (#66991) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: airflow-s/airflow-s#377 (cherry picked from commit 32ac8ad) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
…eld names (#66673) (#66991) DEFAULT_SENSITIVE_FIELDS is the allowlist used by the secrets masker for masking Variables and Connection extras. Several common field names used by official Airflow providers and standard HTTP/database configurations are not in the allowlist. This commit adds five field names commonly used in connection extras and provider configurations: - webhook_url — Slack provider webhook URL key - bearer — HTTP bearer-token auth key - dsn — database connection strings (which typically embed credentials, e.g. postgres://user:pass@host/db) - auth_header — custom HTTP auth header values - service_key — service-account-like keys Related: airflow-s/airflow-s#377 (cherry picked from commit 32ac8ad) Generated-by: Claude Opus 4.7 (1M context) following the guidelines at https: //github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
DEFAULT_SENSITIVE_FIELDSis the allowlist used by the secrets masker formasking Variables and Connection extras. Several common field names used by
official Airflow providers and standard HTTP/database configurations are
not in the allowlist.
This PR adds five field names commonly used in connection extras and
provider configurations:
webhook_url— Slack provider webhook URL keybearer— HTTP bearer-token auth keydsn— database connection strings (which typically embed credentials, e.g.postgres://user:pass@host/db)auth_header— custom HTTP auth header valuesservice_key— service-account-like keysThe matcher uses case-insensitive substring matching, so e.g.
bearercoversBearer,bearer_token,auth_bearer, etc.Related: https://github.com/airflow-s/airflow-s/issues/377
Test plan
uv run --project shared/secrets_masker pytest shared/secrets_masker/tests/ -xvs— secrets-masker tests passshould_hide_value_for_key(name)returnsTruefor each of the five new field names plus substring variants (WEBHOOK_URL,slack_webhook_url,auth_bearer,AUTH_HEADER,custom_auth_header,my_service_key)Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.7 (1M context) following the guidelines at
https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions