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

Set usedforsecurity=False for md5 call in utils.color_of #8979

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

relativistic
Copy link
Contributor

@relativistic relativistic commented Jan 9, 2025

Closes #8974
Adds usedforsecurity=False to md5 call in utils.color_of. This will allow this function to work on FIPS systems where the md5 function is blocked for usedforsecurity=True.

  • Tests added / passed
  • Passes pre-commit run --all-files

@relativistic relativistic requested a review from fjetter as a code owner January 9, 2025 15:56
Copy link
Contributor

github-actions bot commented Jan 9, 2025

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

    27 files  ±0      27 suites  ±0   11h 25m 31s ⏱️ - 11m 14s
 4 125 tests ±0   3 999 ✅ +3    125 💤 ±0  1 ❌  - 3 
51 690 runs  ±0  49 258 ✅ +4  2 429 💤 ±0  3 ❌  - 4 

For more details on these failures, see this check.

Results for commit 4d45cdf. ± Comparison against base commit 8d8c878.

Copy link
Member

@jacobtomlinson jacobtomlinson left a comment

Choose a reason for hiding this comment

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

LGTM. For the vast majority of users this will be a noop change. There's not really anything we can do in the way of testing as we don't have access to FIPS systems. The downside of this is there could be a regression in the future where FIPS support is broken again by some other change that we can't test for. So please consider FIPS support on a best efforts basis and not a guarantee.

The only test failures here appear unrelated to this change so I'mm happy to merge this in.

@jacobtomlinson jacobtomlinson merged commit 26e84a9 into dask:main Jan 9, 2025
28 of 32 checks passed
@relativistic
Copy link
Contributor Author

relativistic commented Jan 9, 2025

A few more related comments. I think that whether this helps you depends on how MD5 is controlled on your high security system. Looking at the hashlib docs, it appears sometimes there are python builds that simply omit md5. Luckily on my FIPS system, its "disabled" rather than omitted, and the change in this PR seems to fix the problem.

If this ever becomes more of an issue, an alternative would be to change to a different more secure hashing algorithm altogether, but that would possibly have some kind of noticeable impact on other users (colors would probably change). The solution in this PR should not have any noticeable impact for most users, as @jacobtomlinson indicates.

@jacobtomlinson
Copy link
Member

Yeah this method is only used in the dashboard to set colours of things like tasks in the task stream, or stack levels in the profile flame graph. Switching to a different hashing algorithm would change which colours get chosen for which item, but I don't think it would be a hugely noticeable change.

If things are working for you then that's great and we should probably just leave it be. If someone raises an issue in the future to say they are trying to use Dask on a system that has a Python build that doesn't have md5 at all then we can look at coming back and changing the algorythm. But it feels like premature optimization to try and solve a niche edge case that hasn't been reported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alter md5 call to make utils.py module FIPS compatible
2 participants