Skip to content

chore: switch FIPS image to native Go FIPS 140-3 module - #3139

Open
afdesk wants to merge 3 commits into
aquasecurity:mainfrom
afdesk:chore/support-fip-140-3
Open

afdesk wants to merge 3 commits into
aquasecurity:mainfrom
afdesk:chore/support-fip-140-3

Conversation

@afdesk

@afdesk afdesk commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Description

Switches the -ubi9-fips image from BoringCrypto (GOEXPERIMENT=boringcrypto) to the native BoringCrypto isn't officially supported by the Go team outside Google. Go 1.24+ ships its own FIPS 140-3 module, which we can use instead.

Changes

  • .goreleaser.yaml, goreleaser-e2e.yaml, magefile.go: build the FIPS binary with CGO_ENABLED=0 and GOFIPS140=certified (currently resolves to v1.0.0-c2097c7c). Removed boringcrypto, -tags=fipsonly and the arm64 CC/CXX overrides.
  • Removed cmd/trivy-operator/fipsonly.go. crypto/tls/fipsonly only builds with boringcrypto. With fips140=on, crypto/tls itself negotiates only FIPS-approved protocol versions, cipher suites, signature algorithms and key exchanges.
  • Release workflows: removed the gcc-aarch64-linux-gnu install step, since the build no longer needs CGO.
  • cmd/trivy-operator/main.go: log FIPS status (module version, enforcement) at startup.
  • Docs: added getting-started/installation/fips.md (image tags, fips140=on / fips140=only modes, Helm usage via image.tag and extraEnv, limitations).

Behavior

  • The binary embeds DefaultGODEBUG=fips140=on, so FIPS mode is on by default.
  • Users can enable the strict mode with GODEBUG=fips140=only (e.g. via Helm extraEnv). In this mode, non-approved algorithms return an error or panic.
  • Image tags and supported platforms (linux/amd64, linux/arm64) are unchanged.

Verification

  • goreleaser build --snapshot --id trivy-operator-fips: go version -m on both binaries shows CGO_ENABLED=0, GOEXPERIMENT=jsonv2, GOFIPS140=v1.0.0-c2097c7c, DefaultGODEBUG=fips140=on.
  • GOFIPS140=certified GODEBUG=fips140=only go test ./pkg/... ./cmd/...: all tests pass.

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@afdesk
afdesk marked this pull request as ready for review November 11, 2026 09:09
@afdesk
afdesk requested a review from eyalke as a code owner November 11, 2026 09:09

This branch has not been deployed

No deployments
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.

1 participant