Skip to content

Conversation

pierrejeambrun
Copy link
Member

@pierrejeambrun pierrejeambrun commented Jul 30, 2025

closes: #52301
closes: #53753

How it works:
For connection, 'password' and 'extras' are merged with their original value when doing an update. The function works similarly to the redact function, it will recursively handle all sort of data types and detect sensitive values that were not modified in the 'new_value' and then restore the value from the unredacted previous value.

See the warning note:
Screenshot 2025-07-30 at 19 34 42
Screenshot 2025-07-30 at 19 34 48

After adding a key 'new_key' to the extra and saving this is what we get in the UI:
Screenshot 2025-07-30 at 19 35 44

And from the CLI we can see that both password, and extra redacted field were preserved:
Screenshot 2025-07-30 at 19 36 10

The only downside is that we cannot 'insert' a real '***' for redacted value because this is how we detect that the value didn't change. I think it's a fair limitation, '***' shouldn't never be a valid value for a sensitive field anyway. @ashb is working on a follow up PR to instead use unicode characters that looks like '***' but are not, to make it even less likely that it will be blocking for users. (They would have to chose a very weird value for their secret).

Another example, it also handle well arrays:

Screenshot 2025-07-30 at 19 38 58 Screenshot 2025-07-30 at 19 39 14 password1 and password3 value in the array are retained. Screenshot 2025-07-30 at 19 39 31

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:dev-tools area:task-sdk area:translations area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-0-test Mark PR with this label to backport to v3-0-test branch translation:default labels Jul 30, 2025
@pierrejeambrun pierrejeambrun added this to the Airflow 3.0.4 milestone Jul 30, 2025
@pierrejeambrun pierrejeambrun self-assigned this Jul 30, 2025
@pierrejeambrun pierrejeambrun removed area:dev-tools area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. area:task-sdk backport-to-v3-0-test Mark PR with this label to backport to v3-0-test branch area:translations translation:default labels Jul 30, 2025
@pierrejeambrun
Copy link
Member Author

pierrejeambrun commented Jul 31, 2025

Really nice test coverage @pierrejeambrun.

The changes are looking fine to me, one thing however I want to show is the experience when we try to update with an invalid json.

You just found a bug. I was able to reproduce on main, seems to happen when 'extra_json' is a str.

I created the issue: #53963, more info there.

@pierrejeambrun
Copy link
Member Author

pierrejeambrun commented Jul 31, 2025

Initial value: {"tokens":["1234","abcd","as12"]}
If I update the "abcd" to "xyz"
so updated value becomes {"tokens":",xyz,"}. It becomes a single value.

@shubhamraj-git I was able to reproduce on main, I just opened an issue there:
#53961

Copy link
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my concerns and for the follow up issues, lgtm

@pierrejeambrun pierrejeambrun added the backport-to-v3-0-test Mark PR with this label to backport to v3-0-test branch label Jul 31, 2025
@pierrejeambrun pierrejeambrun merged commit 0abcfdf into apache:main Jul 31, 2025
104 checks passed
@pierrejeambrun pierrejeambrun deleted the fix-52301 branch July 31, 2025 12:13
Copy link

Backport failed to create: v3-0-test. View the failure log Run details

Status Branch Result
v3-0-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 0abcfdf v3-0-test

This should apply the commit to the v3-0-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

pierrejeambrun added a commit to astronomer/airflow that referenced this pull request Jul 31, 2025
…#53943)

* Fix redacted values editing

* Small improvements

* Small adjustments

* Update UI and fix some errors

* Address PR comments

(cherry picked from commit 0abcfdf)
@pierrejeambrun
Copy link
Member Author

Manual backport #53973

pierrejeambrun added a commit that referenced this pull request Jul 31, 2025
#53973)

* Fix redacted values editing

* Small improvements

* Small adjustments

* Update UI and fix some errors

* Address PR comments

(cherry picked from commit 0abcfdf)
ashb added a commit to astronomer/airflow that referenced this pull request Jul 31, 2025
For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer
ashb added a commit to astronomer/airflow that referenced this pull request Jul 31, 2025
For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer
ashb added a commit to astronomer/airflow that referenced this pull request Jul 31, 2025
For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer
ashb added a commit to astronomer/airflow that referenced this pull request Jul 31, 2025
For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer
RoyLee1224 pushed a commit to RoyLee1224/airflow that referenced this pull request Jul 31, 2025
…#53943)

* Fix redacted values editing

* Small improvements

* Small adjustments

* Update UI and fix some errors

* Address PR comments
ashb added a commit to astronomer/airflow that referenced this pull request Aug 1, 2025
For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer
ashb added a commit that referenced this pull request Aug 4, 2025
…53977)

* Allow secrets redact function to have different redaction than `***`

For logs, using `***` is fine, but as part of the changes introduced in #53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer

* Deal with OpenLineage subclassing SecretsMasker class
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
…#53943)

* Fix redacted values editing

* Small improvements

* Small adjustments

* Update UI and fix some errors

* Address PR comments
ferruzzi pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Aug 7, 2025
…pache#53977)

* Allow secrets redact function to have different redaction than `***`

For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer

* Deal with OpenLineage subclassing SecretsMasker class
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
…#53943)

* Fix redacted values editing

* Small improvements

* Small adjustments

* Update UI and fix some errors

* Address PR comments
fweilun pushed a commit to fweilun/airflow that referenced this pull request Aug 11, 2025
…pache#53977)

* Allow secrets redact function to have different redaction than `***`

For logs, using `***` is fine, but as part of the changes introduced in apache#53943
we decided it might be nice to use an even-less-frequently-appearing thing
than `***` so we can detect modified secrets.

This gives us the ability to do that at the redaction layer

* Deal with OpenLineage subclassing SecretsMasker class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-v3-0-test Mark PR with this label to backport to v3-0-test branch type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connection passwords visible in UI Editing connection with sensitive extra field saves literal asterisks
6 participants