Skip to content

Enable FIPS without openssl - #994

Merged
pavolloffay merged 1 commit into
mainfrom
openssl-fips
Aug 19, 2026
Merged

pavolloffay merged 1 commit into
mainfrom
openssl-fips

Conversation

@pavolloffay

@pavolloffay pavolloffay commented Aug 18, 2026

Copy link
Copy Markdown
Member

Test PR: openshift/release#83623

Switch from openssl-based FIPS (CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime) to Go's native FIPS 140 module (GOFIPS140=v1.0.0). This removes the openssl RPM dependency and produces static binaries (CGO_ENABLED=0).

Build-time: GOFIPS140=v1.0.0

A build-time variable that tells the Go compiler which FIPS 140 crypto module to embed into the binary. Two modules are available:

Module Status ML-KEM ML-DSA Notes
v1.0.0 Validation completed Yes No Validated, stable
v1.26.0 Module In Process (MIP) Yes Yes Adds ML-DSA + better entropy, longer-lived

We use v1.0.0 because its FIPS 140 validation is already completed. Both modules support ML-KEM (post-quantum key encapsulation), so PQC key exchange is available with v1.0.0.

Runtime: GODEBUG=fips140=auto

Tells the Go runtime to automatically enable its native FIPS 140 crypto module when the host OS is in FIPS mode (/proc/sys/crypto/fips_enabled is 1). If the host is not in FIPS mode, the binary runs with standard crypto.

Value Behavior
fips140=auto Follow the host's FIPS setting (what we use)
fips140=on Always enable FIPS, regardless of host
fips140=only FIPS-only mode, panics on any non-FIPS crypto call (for testing)

Other changes

  • -tags no_openssl disables the openssl Go module
  • Removed openssl RPM from all images (operator, targetallocator, collector)
  • Operator and targetallocator no longer need the install-additional-packages stage

RPM diff: shipped image vs this PR

Comparison of registry.redhat.io/rhosdt/opentelemetry-rhel9-operator:rhosdt-3.10.2 (shipped) vs docker.io/pavolloffay/otel-operator:1787078996 (this PR).

The PR image is a strict subset — no new RPMs added. 17 RPMs removed:

RPM Version
alternatives 1.24-2.el9
ca-certificates 2025.2.80_v9.0.305-91.el9
crypto-policies 20260224-1.gitea0f072.el9_8
findutils 4.8.0-7.el9
grep 3.6-5.el9
libffi 3.4.2-8.el9
libsigsegv 2.13-4.el9
libtasn1 4.16.0-10.el9_8
openssl 3.5.5-6.el9_8
openssl-fips-provider 3.0.7-11.el9_8
openssl-fips-provider-so 3.0.7-11.el9_8
openssl-libs 3.5.5-6.el9_8
p11-kit 0.26.4-1.el9_8
p11-kit-trust 0.26.4-1.el9_8
pcre 8.44-4.el9
sed 4.8-10.el9
zlib 1.2.11-40.el9

RPMs installed after this change

All RPMs from ubi-micro base image (20 RPMs):

  • basesystem-11-13.el9.noarch
  • bash-5.1.8-9.el9.x86_64
  • coreutils-single-8.32-41.el9_8.x86_64
  • filesystem-3.16-5.el9.x86_64
  • glibc-2.34-275.el9_8.x86_64
  • glibc-common-2.34-275.el9_8.x86_64
  • glibc-minimal-langpack-2.34-275.el9_8.x86_64
  • libacl-2.4.0-1.el9_8.x86_64
  • libattr-2.5.1-3.el9.x86_64
  • libcap-2.48-10.el9_8.1.x86_64
  • libgcc-11.5.0-14.el9.x86_64
  • libselinux-3.6-3.el9.x86_64
  • libsepol-3.6-3.el9.x86_64
  • ncurses-base-6.2-12.20210508.el9.noarch
  • ncurses-libs-6.2-12.20210508.el9.x86_64
  • pcre2-10.40-6.el9.x86_64
  • pcre2-syntax-10.40-6.el9.noarch
  • redhat-release-9.8-1.0.el9.x86_64
  • setup-2.13.7-10.el9.noarch
  • tzdata-2026c-1.el9_8.noarch

@pavolloffay
pavolloffay marked this pull request as draft August 18, 2026 11:55
@pavolloffay
pavolloffay force-pushed the openssl-fips branch 2 times, most recently from e0b8b58 to 5a54ae9 Compare August 18, 2026 18:42
@pavolloffay
pavolloffay marked this pull request as ready for review August 18, 2026 19:10
Comment thread Dockerfile.collector Outdated
WORKDIR /opt/app-root/src/redhat-opentelemetry-collector

RUN CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -C ./_build -mod=mod -tags strictfipsruntime -o opentelemetry-collector -trimpath -ldflags "-w"
# TODO: bump GOFIPS140 to v1.26.0 once its FIPS 140 validation is completed

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on GOFIPS140=certified? It would bump automatically, TBD if that happens on a Go z-stream update or only on a y-stream update. What do you think about either of those possibilities? Seems reasonable if the module shifts on a y-stream update but it's not clear to me or the team if they'll bump this on z-stream updates possibly too which would represent a new module coming in with little oversight, though we could certainly test it in advance.

From https://go.dev/doc/security/fips140#the-gofips140-environment-variable

inprocess and certified are equivalent to specifying the latest version that reached the CMVP Modules In Process List and the latest version that obtained a CMVP validation certificate, respectively.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

certified option seems good from my standpoint. I am not sure how/what (if anything) we should test if the value changes.

This is the test PR job https://github.com/openshift/release/pull/83623/changes#diff-b6a44cc6ee1122b3774ae13d32fbb79f35c12c6dc0cd35463404eaab02dcbc67R63 . It uses tls-scanner with PQC_CHECK: "true"

Comment thread Dockerfile.collector
WORKDIR /opt/app-root/src/redhat-opentelemetry-collector

RUN CGO_ENABLED=1 GOEXPERIMENT=strictfipsruntime go build -C ./_build -mod=mod -tags strictfipsruntime -o opentelemetry-collector -trimpath -ldflags "-w"
RUN CGO_ENABLED=0 GOFIPS140=certified go build -C ./_build -mod=mod -tags no_openssl -o opentelemetry-collector -trimpath -ldflags "-w"

@andreasgerstmayr andreasgerstmayr Aug 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using CGO_ENABLED=0 avoids using glibc, and iirc there might be subtle and exotic differences around DNS, IPv6 and /etc/hosts. Not sure if it's an issue in practice though (not a blocker from my side)

Comment thread rpms.in.yaml Outdated
Signed-off-by: Pavol Loffay <p.loffay@gmail.com>
@pavolloffay
pavolloffay merged commit 68fecf0 into main Aug 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants