-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
FIPS Compatibility #3512
Comments
No idea on FIPS. You can probably modify that one line of code in scp_handler and have it be: file_hash = hashlib.md5(usedforsecurity=False) This is just used to hash the contents of the file. |
A found a solution (well, hack) that works. Enabling FIPS does cause a problem with paramiko. This should be fixed proper, but until that occurs I found a solution from another article, "monkeypatch for FIPS". This just simply needs to be added to the top of your code. I have it after my import statements.
This will allow the SSH transport to make use of SHA-256 vs. MD5. For those working on secure systems (I suspect a big part of the community!), use of MD5 isn't an option for transport. I'll post this back in paramiko comments too. Your solution to update scp_handler for the file hash seems to work:
Thanks for that! I also came across this idea as a 'monkeypatch for md5'. This takes care of the file hash and doesn't cause any problems with FIPS. Another alternative (this would require updates to the scp_handler code, but it works as a hack) would be to replace the md5 hashes with a hash that is sha2 compliant. SHA-512 is overkill in my example below. However, we have Cisco IOS_XE switches and the verify functions at the switch is either verify /md5 or verfiy /sha512. I guess Cisco figures they set the hash very high to keep from updating. SHA-256 is sufficient for most today, imo. I tested these updates to scp_handler and they work. Again, functional, but to fix proper would require updates to sections in scp_handler to report SHA-512 vs. MD5.
and
With the above changes, everything seems to be working. Hopefully, this is useful for someone else as well! |
Description of Issue/Question
Is FIPS supported?
Netmiko and relevant libraries version
Netmiko device_type (if relevant to the issue)
My code returns:
ValueError: [digital envelope routines] unsupported
when I attempt an SSH connect. Presume the error is with the paramiko and MD5 for ssh. Any thoughts?
Also tried adding:
This seems like it's close, but still throws an error:
The text was updated successfully, but these errors were encountered: