packaged by Chainguard
Contact our team to test out this image for free. Please also indicate any other images you would like to evaluate.
Container image for building Go applications with FIPS
Chainguard 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.
The flexible Go image that allows runtime configuration of FIPS-validated cryptography. By default, this image uses the host's OpenSSL FIPS provider (i.e., the Chainguard FIPS Provider for OpenSSL on Chainguard hosts), and the Go Cryptographic Module as a fallback. The choice between them is configurable at deploy time. This image is for teams running multiple workflows across mixed environments, or teams that want to continue using Chainguard’s FIPS-validated OpenSSL provider to avoid changing CMVP numbers.
The runtime behaviour can be controlled with GODEBUG:
GODEBUG=cgr_fips=openssl+geomys - the default behaviour of attempting to use the host native OpenSSL in fips mode, and fallback to Go Cryptographic module when OpenSSL is not availableGODEBUG=cgr_fips=openssl - only use OpenSSL and do not perform fallback to the Go Cryptographic moduleGODEBUG=cgr_fips=geomys - only use the Go Cryptographic Module and do not use OpenSSL.GODEBUG=cgr_fips=openssl,fips140=off - use OpenSSL for cryptography, even if it is not in FIPS capableGODEBUG=cgr_verbose=1 - can be used to print at binary startup if OpenSSL or Go Cryptographic module is used at runtimeCGO_ENABLED=0 and cross-compliation is also supported, it creates portable binaries that are still dynamically linked and still perform dlopen() to discover OpenSSL at runtime.
This toolchain is based on the microsoft/go and further documentation is available from upstream:
Whilst Chainguard FIPS provider for OpenSSL is recommended, the resulting binaries are vendor-agnostic and can be used at runtime with many other OpenSSL FIPS providers on foreign OpenSSL FIPS hosts.
The following table is derived from Chainguard's cryptographic compliance test
suite, run against the upstream Go toolchain in FIPS mode and the
RENO_NAME build. It shows, for a subset of algorithms and
operations, whether each is permitted at runtime — highlighting the
key differences in what is blocked.
A ⚠️ Allowed marker indicates an operation that upstream Go in FIPS
mode permits but which is legacy, deprecated, non-approved, or
disallowed — it is a hazard that these remain available by
default. The go-openssl-fips build blocks all of them.
| Algorithm / Operation | Upstream Go in FIPS mode | Chainguard go-openssl-fips |
|---|---|---|
CNSA 2.0 compliant TLS | 🚫 Not available | ✅ Enabled by default |
CNSA 1.0 compliant TLS | 🚫 Not available | ✅ Enabled by default |
MD5 digest | ✅ Allowed | ✅ Allowed |
HMAC-MD5 | ⚠️ Allowed | 🚫 Blocked |
RSA-PSS signature with MD5 | ⚠️ Allowed | 🚫 Blocked |
RSA PKCS#1 v1.5 signature with MD5 | ⚠️ Allowed | 🚫 Blocked |
SHA-1 digest | ✅ Allowed | ✅ Allowed |
HMAC-SHA1 | ⚠️ Allowed | 🚫 Blocked |
RSA-PSS signature with SHA-1 | ⚠️ Allowed | 🚫 Blocked |
RSA PKCS#1 v1.5 signature with SHA-1 | ⚠️ Allowed | 🚫 Blocked |
SHA-256 / SHA-512 digest | ✅ Allowed | ✅ Allowed |
HMAC-SHA2 | ✅ Allowed | ✅ Allowed |
RSA-PSS signature with SHA-256 | ✅ Allowed | ✅ Allowed |
RSA PKCS#1 v1.5 signature with SHA-256 | ✅ Allowed | ✅ Allowed |
DES | ⚠️ Allowed | 🚫 Blocked |
Triple DES (3DES) | ⚠️ Allowed | 🚫 Blocked |
RC4 | ⚠️ Allowed | 🚫 Blocked |
DSA | ⚠️ Allowed | 🚫 Blocked |
ECDSA P-256 | ✅ Allowed | ✅ Allowed |
ECDSA secp256k1 (non-prime curve) | ⚠️ Allowed | 🚫 Blocked |
Ed25519 | ✅ Allowed | ✅ Allowed |
Ed25519ctx signing | ⚠️ Allowed | 🚫 Blocked |
Ed25519ctx verification | 🚫 Blocked | 🚫 Blocked |
TLS stack in upstream Go does not adhere to the requirements of RFC 9151 Commercial National Security Algorithm (CNSA) Suite Profile for TLS and DTLS 1.2 and 1.3 as well as the Draft 5 Commercial National Security Algorithm (CNSA) Suite 2.0 Profile for TLS 1.3. Chainguard FIPS hardening updates the default TLS server and client configuration to adhere those standards. This ensures that binaries compiled using this toolchain can be deployed in National Security Systems without modification.
Note that raw MD5 and SHA-1 digests remain available in both builds for
legacy, non-security-sensitive use (e.g. checksums); this is permitted under
FIPS 140-3 I.G. 2.4.A. It is only their use in HMAC and digital signatures that
is blocked in go-openssl-fips. For more detail, see the Chainguard Academy
article on non-approved algorithms.
They can be blocked in GODEBUG=fips140=only mode.
SHA-1 has been deprecated for security purposes such as digital signatures for well over a decade — by the IETF in RFC 6194 and by NIST, which retired SHA-1 in 2022.
MD5 is a non-FIPS algorithm, and NIST has never permitted HMAC or digital signatures with MD5. Its only sanctioned use was the MD5-SHA1 combination in TLS 1.0 — itself long obsolete. DES, Triple DES (3DES), and RC4 are all broken algorithms that no longer provide any cryptographic security. DSA was obsoleted by NIST with the publication of FIPS 186-5 in 2023; the transition period for generating DSA signatures ended in 2024, one year after publication.
Golang chooses to allow insecure and broken cryptography by default — even when
disallowed by NIST FIPS requirements — owing to its strong
backwards compatibility guarantees. This
unfortunately pushes the burden of building secure software onto the end
developers, requiring them to inspect and audit all of their own code and all of
their dependencies. The go-openssl-fips build removes that burden by blocking
these algorithms outright. The
WithoutEnforcement API
remains wired up, so developers who genuinely require a blocked algorithm can
still access it explicitly — for legacy or non-security purposes that are
compliant with the relevant NIST SP references and implementation guidance.
Runtime availability of the PQC algorithms such as ML-KEM and ML-DSA is dependent on the runtime OpenSSL FIPS provider capabilities or the Go Cryptographic module capabilities. Full support is expected with future upgrades to Chainguard FIPS Provider for OpenSSL 3.6 and Go Cryptographic module 1.26.
This section contains two examples of how you can use the Go FIPS Chainguard Image to build an example Go application. For more information on working with this Image, check out our Getting Started with the Go Chainguard Image guide.
Start interactive shell in the go-openssl-fips image:
User root is used here, to perform tampering with the FIPS module selfcheck after compiling and running the application.
Install a golang demo application helloserver:
Observe build settings used to build the binary:
Observe the following settings are in place:
build chainguard_go_package=go-msft-1.27-1.27.0.1-r0 indicates the Chainguard Go toolchain package name and version that was used to create this binarybuild chainguard_cryptographic_module=openssl+geomys indicates the cryptographic modules possible to usebuild chainguard_entropy_source=openssl+geomys indicates the entropy sources used by this binarybuild microsoft_systemcrypto=1 indicates microsoft/go based toolchain is in usebuild microsoft_toolset_version=go1.27.0-microsoft indicates microsoft/go upstream patchsetbuild DefaultGODEBUG=cgr_fips=openssl+geomys,cgr_verbose=0 indicates the default GODEBUG mode for the binary, try openssl and fallback to Go Cryptographic Modulebuild GOFIPS140=v1.0.0-c2097c7c indicates the Go Cryptographic module version in use when fallback is activatedVerify that OpenSSL symbols are used by the binary:
Note that microsoft/go-crypto-openssl are the underlying bindings for all the available APIs, even if individual binary may not use all of them.
When cross-compiling to Windows and MacOS - bindings to native cryptography for those Operating Systems will be in use instead.
Verify binary execution with suitable OpenSSL FIPS provider (use Ctrl+C to terminate):
Now tamper with the fips provider to observe failure to start the application in OpenSSL-only and FIPS mode:
Observe that binary still works with Go Cryptographic Module fallback even without working OpenSSL:
As well as directly requesting to use Go Cryptographic Module only:
Now restore fipsmodule.cnf to get OpenSSL FIPS back into operational state:
The following example Dockerfile builds a helloserver program in Go and copies it on top of the cgr.dev/ORGANIZATION/glibc-openssl-fips:latest base image to ensure OpenSSL is used at runtime for FIPS:
Run the following command to build the demo image and tag it as go-helloserver-fips:
Now you can run the image with:
Chainguard's free tier of Starter container images are built with Wolfi, our minimal Linux undistro.
All other Chainguard Containers are built with Chainguard OS, Chainguard's minimal Linux operating system 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 development, or -dev, variant.
In all other cases, including Chainguard Containers tagged as :latest or with a specific version number, the container images include only an open-source application and its runtime dependencies. These minimal container images typically do not contain a shell or package manager.
Although the -dev container image variants have similar security features as their more minimal versions, they include additional software that is typically not necessary in production environments. We recommend using multi-stage builds to copy artifacts from the -dev variant into a more minimal production image.
To improve security, Chainguard Containers include only essential dependencies. Need more packages? Chainguard customers can use Custom Assembly to add packages, either through the Console, chainctl, or API.
To use Custom Assembly in the Chainguard Console: navigate to the image you'd like to customize in your Organization's list of images, and click on the Customize image button at the top of the page.
Refer to our Chainguard Containers documentation on Chainguard Academy. Chainguard also offers VMs and Libraries — contact us for access.
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's 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-2-Clause
BSD-3-Clause
CC-BY-4.0
GCC-exception-3.1
GPL-2.0
GPL-2.0-only
For a complete list of licenses, please refer to this Image's SBOM.
Software license agreementChainguard Containers are SLSA Level 3 compliant with detailed metadata and documentation about how it was built. We generate build provenance and a Software Bill of Materials (SBOM) for each release, with complete visibility into the software supply chain.
SLSA compliance at ChainguardThis image helps reduce time and effort in establishing PCI DSS 4.0 compliance with low-to-no CVEs.
PCI DSS at ChainguardThis 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