Skip to content

Mask XCom values in the audit log - #73791

Merged
potiuk merged 3 commits into
apache:mainfrom
potiuk:mask-xcom-values-in-audit-log
Oct 19, 2026
Merged

potiuk merged 3 commits into
apache:mainfrom
potiuk:mask-xcom-values-in-audit-log

Conversation

@potiuk

@potiuk potiuk commented Sep 27, 2026

Copy link
Copy Markdown
Member

The audit log masks the value of Variable and Connection writes unconditionally, because it records that something was written rather than what. XCom create and update requests fell through to per-key name redaction, so their values were stored in the audit log as sent. This masks the XCom value the same way; the key and map index are kept. Adds unit tests for the masker and route tests asserting the stored audit entry for create and update carries "value": "***".

🤖 Generated with Claude Code

@potiuk
potiuk force-pushed the mask-xcom-values-in-audit-log branch from cc33bdc to fba6f3e Compare October 4, 2026 22:12

@fat-catTW fat-catTW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@potiuk
potiuk requested a review from amoghrajesh October 13, 2026 14:27
The audit log masks the value of Variable and Connection writes
unconditionally, because it records that something was written rather
than what. XCom create and update requests fell through to per-key
name redaction, so their values were stored in the audit log as sent.
Mask the XCom value the same way; the key and map index are kept.

Generated-by: Claude Opus 5
Generated-by: Claude Opus 5
Replacing the path/query context with the request body dropped xcom_key, so an update_xcom_entry row no longer said which XCom was changed.

Generated-by: Claude Opus 5
@potiuk
potiuk force-pushed the mask-xcom-values-in-audit-log branch from fba6f3e to 375103c Compare October 16, 2026 02:56
@potiuk potiuk added the backport-to-v3-4-test Backport to v3-4-test label Oct 16, 2026
@potiuk potiuk added this to the Airflow 3.4.0 milestone Oct 16, 2026
@potiuk

potiuk commented Oct 16, 2026

Copy link
Copy Markdown
Member Author

@amoghrajesh @pierrejeambrun Rebased on main to resolve a conflict. Could one of you review it for 3.4.0 (cut 2026-10-19)?

@vatsrahul1001 vatsrahul1001 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks correct to me. The earlier concern about the XCom branch dropping the path/query context is fixed, since the masked body is now merged into extra_fields, and the PATCH test asserts xcom_key is kept. GET and DELETE have no body and no value key, so their audit entries are unchanged. Could use reviews from @amoghrajesh @pierrejeambrun before merging.

@potiuk
potiuk merged commit a26eb12 into apache:main Oct 19, 2026
80 checks passed
@potiuk
potiuk deleted the mask-xcom-values-in-audit-log branch October 19, 2026 14:56
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

potiuk added a commit that referenced this pull request Oct 19, 2026
* Mask XCom values in the audit log

The audit log masks the value of Variable and Connection writes
unconditionally, because it records that something was written rather
than what. XCom create and update requests fell through to per-key
name redaction, so their values were stored in the audit log as sent.
Mask the XCom value the same way; the key and map index are kept.

Generated-by: Claude Opus 5

* Add newsfragment

Generated-by: Claude Opus 5

* Keep the targeted XCom in the audit log when an update has a body

Replacing the path/query context with the request body dropped xcom_key, so an update_xcom_entry row no longer said which XCom was changed.
(cherry picked from commit a26eb12)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
* Mask XCom values in the audit log

The audit log masks the value of Variable and Connection writes
unconditionally, because it records that something was written rather
than what. XCom create and update requests fell through to per-key
name redaction, so their values were stored in the audit log as sent.
Mask the XCom value the same way; the key and map index are kept.

Generated-by: Claude Opus 5

* Add newsfragment

Generated-by: Claude Opus 5

* Keep the targeted XCom in the audit log when an update has a body

Replacing the path/query context with the request body dropped xcom_key, so an update_xcom_entry row no longer said which XCom was changed.
(cherry picked from commit a26eb12)


Generated-by: Claude Opus 5

Co-authored-by: Jarek Potiuk <jarek@potiuk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants