-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Introduce configuration to disable md5 used for security #31171
Introduce configuration to disable md5 used for security #31171
Conversation
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)
|
airflow/config_templates/config.yml
Outdated
security: | ||
description: ~ | ||
options: | ||
disable_md5_for_security: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for_security
in the config seems redundant
What are the downsides if we always enable |
The configuration is a more conservative approach to let the users opt-in instead of opt-out as this functionality is not commonly used. |
440b724
to
9d2d023
Compare
9d2d023
to
d3ffc8a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - in this form it is backwards compatible and great to have a separate configuration for it.
3c4024b
to
6128774
Compare
6128774
to
1073dc8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a config option for this? If it's possible to detect if the option will be accepted and just set it automatically? How is a user ID Airflow meant to know how we use md5 in the code to reasonably set this config option
If it only affects 3.9 let's just always set it there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-1 to config option.
How is a user of Airflow meant to know how we use md5 in the code in order to reasonably set this config option.
This is a property of the code, not of the installation/deployment.
I was going for the opt-in approach for these changes. Since the change is only required for the FIPS compliance, the configuration is to allow people to opt-in when running in FIPS environments instead of opt-out |
Does it only work in FIPS environments, or is just ignored outside of one? |
It works outside of FIPS environements. I will make this as default and remove the configuration. @ashb it is done now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @potiuk You happy with the config-less approach here?
…to minimum airflow 2.7.0
c91dae6
to
0bb0f35
Compare
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Co-authored-by: Long Nguyen <[email protected]> (cherry picked from commit 22e44ab)
@longslvr - one quick confirmation needed pls. Suppose that if I install Apache Airflow 2.6.1 (or <= 2.7.3) successfully on FIPS enabled Ubuntu OS, shall I ensure myself Airflow (and its supporting libraries) are FIPS enabled? |
For Airflow to function correctly in a FIPs-enabled environment, MD5 usage for security must be disabled. You can install Airflow but it might not be able to run. Prior to 2.7.3 you would have to fork Airflow and make your change to disable it yourself. |
Add a configuration flag to disable the use of md5 for security in Python >= 3.9. If Python < 3.9 is being used, this flag will not provide any effect on the existing behaviour. This is mainly for backward compatibility suggested in: #25625
With this configuration combined with the newly introduced flag to change the caching hash method (introduced in: #30675), airflow will be able to run in the environment restricted by FIPS 140-2 requirements.
Background: I have been running in FIPS enabled environment for my company, in order to do that we would have to fork out Airflow and introduce all the changes so that Airflow is fully functional. That added extra complexity when upgrading Airflow to the latest version. Also, a few people show interest in running Airflow in FIPS environment so I want to introduce the change in Airflow so we can all take advantage of that.
Testing done:
Breeze
for the following Python versions: python 3.9, python 3.7Breeze
and running the preloaded example dags in both Python 3.9 and Python 3.7Thanks @vchiapaikeo for the work on the hashlib wrapper and the configurable caching