Closed denver-HJS closed 1 month ago
Hi, thanks for writing in! Just because I have 0 knowledge about FIPS, is doing require('crypto').createHash('sha256').update('.....')
okay? If so, we can just change it.
Hi, thanks for writing in! Just because I have 0 knowledge about FIPS, is doing
require('crypto').createHash('sha256').update('.....')
okay? If so, we can just change it.
Thanks for the quick turn around @lforst! I believe that using sha256
is all that is needed here. Do you have any estimate of when your change will be published as a new version in npm, so that I can test this fix out? 🙏
in this particular package I can cut a release today. Until it propagates to the Next.js SDK it might take until next week. If I publish the new version you could add a npm resolution though.
in this particular package I can cut a release today. Until it propagates to the Next.js SDK it might take until next week. If I publish the new version you could add a npm resolution though.
Thanks @lforst, I will keep an eye out for new versions/watch the releases 👍
Environment
Framework: NextJs
CLI version:
Bundler Plugin Core version:
@sentry/bundler-plugin-core@2.22.3
<-- being used by the webpack-pluginContainer base image: Chainguard's node-fips image built with Node v22 (see here) which ships with the OpenSSL FIPS provider.
Steps to Reproduce
@sentry/nextjs
version@sentry/bundler-plugin-core
versionbuild
commanddocker build .
commandExpected Result
The NextJs app can be built successfully (whether building in the Docker context or if building on the local host machine running with FIPS mode enabled)
Actual Result
The
bundler-plugin-core
package causes a Webpack error due to its use of MD5 cryptography, which is not available when running in FIPS mode.Build Error
Note: The warning about the server-side config files is because I updated to the latest Sentry NextJs version as a part of this troubleshooting process, and I have not migrated those to the NextJs middleware file yet. I do plan to once I have this working. ```bash 0.600 ▲ Next.js 14.2.15 0.600 - Environments: .env.local 0.600 - Experiments (use with caution): 0.601 · instrumentationHook 0.601 0.636 Creating an optimized production build ... 0.833 [@sentry/nextjs] It appears you've configured a `sentry.server.config.ts` file. Please ensure to put this file's content into the `register()` function of a Next.js instrumentation hook instead. To ensure correct functionality of the SDK, `Sentry.init` must be called inside `instrumentation.ts`. Learn more about setting up an instrumentation hook in Next.js: https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation. You can safely delete the `sentry.server.config.ts` file afterward. 0.896 [@sentry/nextjs] It appears you've configured a `sentry.edge.config.ts` file. Please ensure to put this file's content into the `register()` function of a Next.js instrumentation hook instead. To ensure correct functionality of the SDK, `Sentry.init` must be called inside `instrumentation.ts`. Learn more about setting up an instrumentation hook in Next.js: https://nextjs.org/docs/app/building-your-application/optimizing/instrumentation. You can safely delete the `sentry.edge.config.ts` file afterward. 2.450 (node:17) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. 2.450 (Use `node --trace-deprecation ...` to show where the warning was created) 20.21 Failed to compile. 20.21 20.21 HookWebpackError: error:0308010C:digital envelope routines::unsupported 20.21 at makeWebpackError (/app/node_modules/next/dist/compiled/webpack/bundle5.js:28:312635) 20.21 at /app/node_modules/next/dist/compiled/webpack/bundle5.js:28:106060 20.21 at eval (eval at create (/app/node_modules/next/dist/compiled/webpack/bundle5.js:13:28858),Is it possible to eliminate the use of MD5 in favor of some alternative that is FIPS compliant? Perhaps SHA-256 will work just as well in this case?