Last changed
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
Request trialChainguard Containers are regularly-updated, secure-by-default container images.
For those with access, this container image is available on cgr.dev
:
Be sure to replace the ORGANIZATION
placeholder with the name used for your organization's private repository within the Chainguard Registry.
This is a base image containing both OpenJDK and the Bouncy Castle crypto libraries for FIPS.
The FIPS validated version of Bouncy Castle is compliant to the FIPS 140-3 standard when used in accordance with the Bouncy Castle Security Policy.
When using the OpenJDK Chainguard Image for FIPS compliance, please make sure to read the security policy and adapt your code as needed. Follow these documents:
OpenSSL FIPS provider is also included for convenience to add any other non-Java applications that use OpenSSL for their cryptographic needs.
This image is currently available in the following versions and variants:
Java version | Image name |
---|---|
Java 21 |
|
Java 17 |
|
Java 11 |
|
java.policy
and java.security
files configured?An updated version of the java.security
configuration file is shipped under
the default location ($JAVA_HOME/conf/security/java.security
) in this image and
is configured as described below:
It sets up BouncyCastle FIPS providers at highest priority
Security providers that implement non-validated cryptography are omitted
SUN provider is loaded at lowest priority, as it is required to validate the BouncyCastle signed jars
Detailed services which stock security providers implement are described in JDK Providers Documentation
Hardening is applied to block security-sensitive usage of algorithms that may leak from the SUN provider
It loads the java.policy
file shipped under /usr/lib/jvm/jdk-fips-config/java.policy
as an additional policy file, at position 2, leaving the policy configuration
as:
The additional policy file is configured as described in the BCFIPS user manual:
Supported truststore.type
are jks
, pkcs12
and bcfks
for public CA certificates in approved mode.
Supported keystore.type
is only bcfks
, in order for keystores used for private key storage to be FIPS-compliant.
It sets the algorithms for the KeyManagerFactory
and TrustManagerFactory
as PKIX:
It sets BCFIPS to approved_only
mode:
Whenever possible ensure to use --module-path /usr/share/java/bouncycastle-fips
, as that allows one to execute
classes, jars, modules correctly with bouncycastle-fips JCA & JSSE
providers available to the JVM.
There are many additional environment variables preset in the image
that enable using CLASSPATH
instead if desired.
This image ships with the following environment variables exported by default:
JAVA_FIPS_CLASSPATH=/usr/share/java/bouncycastle-fips/*
JDK_JAVA_FIPS_OPTIONS="--add-exports=java.base/sun.security.internal.spec=ALL-UNNAMED --add-exports=java.base/sun.security.provider=ALL-UNNAMED"
JDK_JAVAC_FIPS_OPTIONS="--add-exports=java.base/sun.security.internal.spec=ALL-UNNAMED --add-exports=java.base/sun.security.provider=ALL-UNNAMED"
JAVA_TRUSTSTORE_OPTIONS="-Djavax.net.ssl.trustStoreType=FIPS"
In addition, the following environment variables are also exported by default and can be updated as needed:
CLASSPATH=$JAVA_FIPS_CLASSPATH:.:./*
JDK_JAVA_OPTIONS=$JDK_JAVA_FIPS_OPTIONS $JAVA_TRUSTSTORE_OPTIONS
JDK_JAVAC_OPTIONS=$JDK_JAVAC_FIPS_OPTIONS
When updating your classpath variable, make sure to keep the path to the
bouncycastle-fips
folder in your classpath, so the Bouncy Castle libraries
are discoverable:
When updating the JDK_JAVA_OPTIONS
/JDK_JAVAC_OPTIONS
environment variables,
make sure to specify the exports options required for Bouncy Castle to work
properly:
If you need the use of the converted keystore, make sure to also add the
JAVA_TRUSTSTORE_OPTIONS
variable to your JDK_JAVA_OPTIONS
:
Alternatively, these can be also set as an argument to the JVM tools via the
--class-path
/-cp
and -D
options. Please note these arguments take
precedence over the environment variables:
Execute the org.bouncycastle.util.DumpInfo
:
It should provide output similar to the below:
This class is also available to execute from within the codebase of your own applications.
As part of the effort to build this image, a set of tests was created that validates that the BCFIPS and BCJSSE providers are in use.
Some of these tests are shipped in the image in
/usr/lib/bcfips-policy-140-3
. They validate that allowed algorithms
are available, and dissallowed ones are blocked.
To consume this image as a base image, add it in the FROM
statement of your Dockerfile. One can execute jars like this java --module-path /usr/share/java/bouncycastle-fips -jar
. Without the ``-module-pathsetting one will eventually see cryptic runtime errors from JCA or JSSE APIs. Alternatively one can add jars to the
CLASSPATH` and invoke the main class directly:
This can also be worked into a multistage build using the JRE FIPS variant for running your application:
Chainguard Containers are minimal container images that are secure by default.
In many cases, the Chainguard Containers tagged as :latest
contain only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager. Chainguard Containers are built with Wolfi, our Linux undistro designed to produce container images that meet the requirements of a more secure software supply chain.
The main features of Chainguard Containers include:
For cases where you need container images with shells and package managers to build or debug, most Chainguard Containers come paired with a -dev
variant.
Although the -dev
container image variants have similar security features as their more minimal versions, they feature additional software that is typically not necessary in production environments. We recommend using multi-stage builds to leverage the -dev
variants, copying application artifacts into a final minimal container that offers a reduced attack surface that won’t allow package installations or logins.
To better understand how to work with Chainguard Containers, please visit Chainguard Academy and Chainguard Courses.
In addition to Containers, Chainguard offers VMs and Libraries. Contact Chainguard to access additional products.
This software listing is packaged by Chainguard. The trademarks set forth in this offering are owned by their respective companies, and use of them does not imply any affiliation, sponsorship, or endorsement by such companies.
Chainguard container images contain software packages that are direct or transitive dependencies. The following licenses were found in the "latest" tag of this image:
Apache-2.0
BSD-3-Clause
Bitstream-Vera
FTL
GPL-2.0-or-later
GPL-2.0-with-classpath-exception
GPL-3.0-only
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementThis is a FIPS validated image for FedRAMP compliance.
This image is STIG hardened and scanned against the DISA General Purpose Operating System SRG with reports available.
Learn more about STIGsGet started with STIGs