crypto: add FIPS indicator diagnostics and strict mode - #65645
Open
panva wants to merge 5 commits into
Open
Conversation
OpenSSL 3.4 added an indicator callback for operations that its FIPS provider allows after an approved-mode check has been relaxed. Publish these indicators on the crypto.fips.indicator diagnostics channel when Node.js is started with --enable-fips-indicator-events. Leave the OpenSSL callback unset otherwise so ordinary cryptographic operations have no indicator callback overhead. Keep the channel observation-only so enforcement remains the responsibility of the provider configuration, and independent diagnostic subscribers can coexist. Install the native callback during process initialization so it is not changed while Workers or thread-pool jobs can be using OpenSSL. Preserve callbacks installed by embedders, and queue bounded, coalesced messages for asynchronous delivery on the main environment. Document the channel as best-effort telemetry that cannot identify the originating call or establish FIPS validation. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Collaborator
|
Review requested:
|
Allow --force-fips to take an optional provider or strict mode. Keep provider as the current default and explicit compatibility mode. In strict mode, return failure from the OpenSSL 3.4+ FIPS indicator callback when it reports a non-approved operation. Install the callback for enforcement without implicitly enabling diagnostics; --enable-fips-indicator-events remains the independent observation opt-in. Keep the bare form mapped to provider for compatibility, allowing the default to change to strict in a future major release. Preserve the mode when forwarding flags to child test processes, and keep the parser's internal mode storage out of process.allowedNodeEnvironmentFlags. Document the callback scope limitations and cover provider compatibility, validation, synchronous crypto, WebCrypto, Workers, and opt-in event publication. Signed-off-by: Filip Skokan <panva.ip@gmail.com>
panva
force-pushed
the
crypto-fips-indicator-callback
branch
from
August 29, 2026 12:21
e261a5c to
3826393
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #65645 +/- ##
==========================================
- Coverage 90.04% 90.00% -0.05%
==========================================
Files 754 754
Lines 255722 255913 +191
Branches 48312 48357 +45
==========================================
+ Hits 230274 230335 +61
- Misses 16553 16693 +140
+ Partials 8895 8885 -10
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenSSL FIPS providers can be configured to permit operations that are not FIPS approved, but Node.js currently gives users neither visibility into when this occurs nor a way to reject those operations when they cannot control the provider configuration.
FIPS indicator callback makes both possible, giving us opt-in diagnostics for observability and a strict
--force-fipsmode for runtime enforcement without changing existing defaults or adding callback overhead unless requested.This adds
--enable-fips-indicator-events, which installs the callback during startup and publishes best-effort events on thecrypto.fips.indicatordiagnostics channel.This also extends
--force-fipswith optionalproviderandstrictmodes (suggest better names if you want?).providerpreserves the FIPS provider's configured handling of non-approved operations and remains the default, including for the bare--force-fipsform.strictrejects non-approved operations reported through the indicator callback, independently of whether diagnostics are enabled.