Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix airflow info --anonymize leaking the machine hostname - #73074

Open
roykoand wants to merge 3 commits into
apache:mainfrom
roykoand:fix-anonymize-uname-hostname
Open

Fix airflow info --anonymize leaking the machine hostname#73074
roykoand wants to merge 3 commits into
apache:mainfrom
roykoand:fix-anonymize-uname-hostname

Conversation

@roykoand

@roykoand roykoand commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

airflow info --anonymize is meant to strip personally identifying information. It already redacts the home directory, OS username, and database credentials but it never touched the uname line, which leaks the machine hostname.

The problem

platform.uname() returns a named tuple whose node field is the machine hostname, and on managed
devices that hostname routinely encodes a real name or an asset tag:

# --anonymize was already scrubbing these lines:
sql_alchemy_conn    | postgresql+psycopg2://p...s:PASSWORD@postgres/airflow
python_location     | ${HOME}/.venv/bin/python

# ...but left this one completely untouched:
uname               | uname_result(system='Darwin', node='Andriis-MacBook.local', release='10.6.1', ...)

Before / after, same machine:

# without --anonymize (unchanged)
uname               | uname_result(system='Darwin', node='Andriis-MacBook.local', release='10.6.1', ...)

# with --anonymize (new)
uname               | uname_result(system='Darwin', node='${HOSTNAME}', release='10.6.1', ...)

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Sonnet 5)

Generated-by: Claude Code (Sonnet 5) following the guidelines

🤖 Generated with Claude Code

The uname line in `airflow info` reports platform.uname(), whose node
field is the machine hostname. On managed devices this hostname often
encodes an asset tag or device name, but --anonymize never masked it
even though it already redacts the home directory, OS username, and
database credentials elsewhere in the report.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
roykoand and others added 2 commits September 13, 2026 13:55
Building a synthetic uname_result inline is clearer than caching a
real one at import time to work around mock.patch timing.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant