-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Description
Our team is building an operator based on cdk8s and one of our deployment targets is a FIPS-enabled kubernetes cluster. When running cdk8s (and by proxy the constructs library), we encounter the following error when attempting to to run a synth:
Error: error:060800C8:digital envelope routines:EVP_DigestInit_ex:disabled for FIPS
Root Cause
The root-cause of this bug is this line where crypto.createHash('md5') is invoked. According to the internet the md5 crypto hash algorithm is considered insecure by FIPS standards and is thus disabled in the underlying openssl libraries when the operating system is running in FIPS mode.
Repro
(In a FIPS-enabled cluster. Not sure how to easily reproduce this)
const crypto = require('crypto');
crypto.createHash('md5').update(path.join('/')).digest("hex");Proposed Solution
I believe that the point of the offending line is simply to compute a unique value for the given string path, so I think we can simply replace 'md5' with a FIPS-approved algorithm like sha1 or sha256. I've tested both and they both produce valid hash values.
Volunteering!
I'd be happy to try to fix this one and submit a PR