FIPS cryptography must be enforced
To be FIPS-compliant, the image must use cryptographic modules that conform to the FIPS 140-3 requirements, ensuring that all encryption, decryption, hashing, and digital signing operations meet strict security standards. A FIPS image must be restricted to use only approved algorithms (such as AES, SHA-256, or RSA with approved key lengths), manage cryptographic keys securely, and rely on a CMVP-validated cryptographic boundary. Furthermore, the image must enforce proper configuration of the relevant modules to prevent weak or unauthorized cryptographic operations and ensure that all non-compliant cryptography is disabled. When you add packages to a FIPS-validated image, you run the risk of introducing conflicts that could potentially undermine, override, or undo FIPS configurations. For example, Go (golang) has a default cryptographic module BoringCrypto that must be disabled and replaced with the FIPS-validated Minimus Cryptographic Module. If you introduce a Go package into another FIPS-validated starter image, you will undermine the FIPS module.OpenSSL FIPS integrity tests
Testing a standard Minimus image for FIPS is fairly straightforward. You run the pre-configured command to test that the OpenSSL FIPS provider module is configured on the image. However, when you use FIPS validated images to compile and build an application, it can be trickier to validate FIPS compatibility. The simplest approach is proof by contrapositive - showing that if an image is not FIPS validated it will not run.Example for testing a custom FIPS image
In this example, we will invalidate theopenssl-fips module and attempt to run the app.
-
Delete a file to modify the module-mac portion of the FIPS provider to invalidate it:
-
Try to re-run the application server:
We expect the app to abort because it does not satisfy the OpenSSL FIPS provider requirements.
-
The app should not run with the following error:
-
Any software that uses OpenSSL should exit as
segfault(segmentation fault). A segmentation fault is a failure condition raised by hardware with memory protection, notifying an operating system that the software has attempted to access a restricted area of memory.
Examples includeapk update. - Restore the fipsmodule.cnf file to fix the problem. The image should run as expected.