Skip to content

Keep object store credentials out of the task log in Teradata transfers - #72176

Merged
shahar1 merged 1 commit into
apache:mainfrom
potiuk:fix-teradata-credential-logging
Sep 20, 2026
Merged

shahar1 merged 1 commit into
apache:mainfrom
potiuk:fix-teradata-credential-logging

Conversation

@potiuk

@potiuk potiuk commented Aug 27, 2026

Copy link
Copy Markdown
Member

S3ToTeradataOperator and AzureBlobStorageToTeradataOperator embed the object store credentials directly in the CREATE MULTISET TABLE ... LOCATION statement when the store is private and no teradata_authorization_name is configured:

credentials_part = f"ACCESS_ID= '{access_key}' ACCESS_KEY= '{access_secret}'"

DbApiHook._run_command logs every statement it runs, so those values were written to the task log on each run — readable by anyone who can read that Dag's logs.

What changed. Both operators now build a redacted twin of the credentials fragment. When credentials are inline, the hook's own SQL logging is switched off for that statement (log_sql, already part of DbApiHook) and the redacted form is logged instead, so operators still see what ran without the values. The AUTHORIZATION path is untouched and keeps normal SQL logging.

What this does not fix. Teradata records the statement in its own query logs (DBQL) and monitoring views. Airflow cannot redact those. Both docstrings now say so and point at teradata_authorization_name, which keeps the credentials in the database rather than in each statement — that remains the right configuration for a private store.

Local: 278 passed across the Teradata provider; ruff and mypy clean.

🤖 Generated with Claude Code

When no AUTHORIZATION object is configured and the store is private, both Teradata
transfer operators embed the object store credentials directly in the CREATE TABLE
statement. DbApiHook logs every statement it runs, so those values were written to
the task log on each run.

Suppress the hook's own SQL logging for that statement and log a redacted form in
its place, so the statement is still visible without the credential values. The
AUTHORIZATION path is unaffected and keeps normal SQL logging.

Teradata also records the statement in its own query logs, which Airflow cannot
redact; both operator docstrings now say so and point at the AUTHORIZATION object.
@potiuk
potiuk force-pushed the fix-teradata-credential-logging branch from 1466dd7 to 31d08ca Compare August 28, 2026 14:38
@shahar1
shahar1 merged commit 056806e into apache:main Sep 20, 2026
83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants