Startup fails when on a FIPS enabled Operating System

2 minute readKnowledge base

Issue

When running Cloudbees CI on an operating system that has FIPS mode enabled (for example due to running sudo /sbin/grubby --update-kernel=ALL --args="fips=1"), the controller or operations center fails to start.

Errors related to FIPS being enabled at the OS level are:

2023-02-23 23:08:15.361+0000 [id=1] INFO c.c.jenkins.ha.KeyStoreGenerator#generateKey: Trying to create keystore file 'jgroups_sym_encrypt.keystore' using algorithm 'AES' size '256' 2023-02-23 23:08:15.375+0000 [id=1] SEVERE c.c.jenkins.ha.HASwitcher#reportFallback: Cloudbees CI Client Controller appears to have failed to boot. If this is a problem in the HA feature, you can disable HA by specifying JENKINS_HA=false as environment variable java.security.NoSuchAlgorithmException: JCEKS KeyStore not available at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:159) at java.base/java.security.Security.getImpl(Security.java:779) at java.base/java.security.KeyStore.getInstance(KeyStore.java:875) Caused: java.security.KeyStoreException: JCEKS not found at java.base/java.security.KeyStore.getInstance(KeyStore.java:878) at com.cloudbees.jenkins.ha.KeyStoreGenerator.generateKey(KeyStoreGenerator.java:75)
▼
sun.security.pkcs11.wrapper.PKCS11Exception: CKR_GENERAL_ERROR at jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11$FIPSPKCS11.C_CreateObject(PKCS11.java:1958) at jdk.crypto.cryptoki/sun.security.pkcs11.P11KeyStore.storePkey(P11KeyStore.java:1803)
▼

Resolution

When the operating system is in FIPS mode, the Java runtime restricts the cryptographic algorithms it can use, which does not allow various features to work.

On Java 25, a bug in some versions of Red Hat OpenJDK can also stop controllers from starting on a FIPS host. Refer to Controller fails to start with X25519MLKEM768 error on a FIPS enabled host.

Workaround

Run Cloudbees CI with the Java arguments in this section to start it on a FIPS-enabled host.

The current versions of Cloudbees CI are not FIPS-140 compliant, and changing these flags does not alter that fact. Cloudbees recommends not running the host in FIPS mode, because running Cloudbees CI on a FIPS-enabled host is known to cause issues.

For more details, contact your DevOps consultant or sales representative.

To disable FIPS at the JVM level (which does not make Cloudbees CI FIPS compliant), add the following Java arguments, depending on the Java version of your Cloudbees CI image or installation:

Java version Java arguments

25

-Dredhat.crypto-policies=false -Djava.security.properties=/etc/crypto-policies/back-ends/java.config

21 and earlier

-Dcom.redhat.fips=false

On Java 25, the second argument keeps the crypto policy of the operating system in place.

Use the arguments of the Java version your Cloudbees CI runs on. On Java 25, -Dcom.redhat.fips=false has no effect.

For help adding Java arguments, refer to How to add Java arguments to Jenkins? or, on modern cloud platforms, How to add Java arguments to Jenkins on CloudBees CI Modern?

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by Cloudbees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.