OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.15k stars 591 forks source link

FIPS compliance with Java 11 (and later) on Windows #25394

Closed colvinco closed 1 year ago

colvinco commented 1 year ago

Hello. We have a Java 11 application in Liberty, and would like to be able to configure Liberty in a FIPS 140-2 compliant manner on Windows Server 2016.

The documented support for FIPS compliance with Java 11 uses Semeru, and "support for FIPS with Semeru Runtimes is available only on Red Hat Enterprise Linux (RHEL) 8 on x86 platforms". I believe that IBM SDK 8 would have been an option on Windows if our application was still on Java 8, but Semeru is Linux/AIX only.

Has anyone had any success with it? Thanks


For reference, I've got my java.security configured with

security.provider.1=org.bouncycastle.jcajce.provider.BouncyCastleFipsProvider
security.provider.2=org.bouncycastle.jsse.provider.BouncyCastleJsseProvider BCFIPS
security.provider.3=SUN
security.provider.4=SunRsaSign
security.provider.5=SunEC
security.provider.6=SunJSSE
security.provider.7=SunJCE

My jvm.options has

-Xbootclasspath/a:C:/<path_to_jar>/bc-fips-1.0.2.3.jar

If I include -Dorg.bouncycastle.fips.approved_only=true in it then I get

Caused by: org.bouncycastle.crypto.fips.FipsUnapprovedOperationError: Attempt to use RSA key with non-approved size: 1024: RSA
...
    at com.ibm.ws.crypto.ltpakeyutil.LTPACrypto.signISO9796(LTPACrypto.java:256)

So I know that BC is definitely being invoked.

NottyCode commented 1 year ago

We haven't tested Liberty with Bouncy Castle as the JSSE provider. From your report it sounds like it doesn't work.

FIPS 140-2 is being replaced with FIPS 140-3 so you can't get new certifications for it and the existing ones are starting to expire out. I'm not aware of a FIPS 140-3 certified JSSE either.

When we document FIPS we chose to focus on a working FIPS certified JSSE implementations which are on IBM Java 8, or for Seamer on Red Hat. You could possibly configure JSSE in Semeru to just allow the FIPS compatible options, but I don't know what those options would be.