Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mask value if the key is token #16474

Merged
merged 2 commits into from Jul 2, 2021
Merged

Mask value if the key is token #16474

merged 2 commits into from Jul 2, 2021

Conversation

@robertsaxby
Copy link
Contributor

@robertsaxby robertsaxby commented Jun 16, 2021

Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None

"XXXXXXXX" if conn.extra_dejson else None,


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@boring-cyborg
Copy link

@boring-cyborg boring-cyborg bot commented Jun 16, 2021

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst)
Here are some useful points:

  • Pay attention to the quality of your code (flake8, pylint and type annotations). Our pre-commits will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example DAG that shows how users should use it.
  • Consider using Breeze environment for testing locally, it’s a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

airflow/utils/log/secrets_masker.py Outdated Show resolved Hide resolved
kaxil
kaxil approved these changes Jun 16, 2021
Copy link
Member

@kaxil kaxil left a comment

Good to see you contributing @robertsaxby 🚀

@github-actions
Copy link

@github-actions github-actions bot commented Jun 16, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@kaxil kaxil changed the title Update secrets_masker.py Mask value if the key is token Jun 16, 2021
robertsaxby added 2 commits Jun 17, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78
updated to alphabetical
@jedcunningham jedcunningham added this to the Airflow 2.1.2 milestone Jul 2, 2021
@jedcunningham jedcunningham merged commit d1d04fe into apache:main Jul 2, 2021
50 checks passed
@boring-cyborg
Copy link

@boring-cyborg boring-cyborg bot commented Jul 2, 2021

Awesome work, congrats on your first merged pull request!

@ashb ashb removed this from the Airflow 2.1.2 milestone Jul 7, 2021
@ashb ashb added this to the Airflow 2.1.3 milestone Jul 7, 2021
@ashb ashb removed this from the Airflow 2.1.3 milestone Jul 7, 2021
@ashb ashb added this to the Airflow 2.1.2 milestone Jul 7, 2021
ashb added a commit that referenced this issue Jul 7, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

(cherry picked from commit d1d04fe)
jhtimmins added a commit to astronomer/airflow that referenced this issue Jul 7, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

(cherry picked from commit d1d04fe)
(cherry picked from commit a36eca1)
jhtimmins added a commit to astronomer/airflow that referenced this issue Jul 9, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

(cherry picked from commit d1d04fe)
jhtimmins added a commit that referenced this issue Jul 9, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

(cherry picked from commit d1d04fe)
kaxil added a commit to astronomer/airflow that referenced this issue Jul 13, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

(cherry picked from commit d1d04fe)
(cherry picked from commit 24f3f63)
kaxil added a commit to astronomer/airflow that referenced this issue Jul 13, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78

(cherry picked from commit d1d04fe)
(cherry picked from commit 24f3f63)
ferruzzi added a commit to ferruzzi/airflow that referenced this issue Jul 19, 2021
Some connections (including the databricks connection) use the key 'token' in the 'extra' field (this has always been the case). Including it here so that these sensitive tokens are also masked by default.

The prior implementation just masked all of the 'extra' json: "XXXXXXXX" if conn.extra_dejson else None https://github.com/apache/airflow/blob/88199eefccb4c805f8d6527bab5bf600b397c35e/airflow/hooks/base.py#L78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants