Skip to content

build: revert Go native certified FIPS 140-3 cryptography on main - #1953

Merged
bernot-dev merged 1 commit into
mainfrom
revert-go-crypto
Jun 5, 2026
Merged

build: revert Go native certified FIPS 140-3 cryptography on main#1953
bernot-dev merged 1 commit into
mainfrom
revert-go-crypto

Conversation

@bernot-dev

Copy link
Copy Markdown
Collaborator

This replicates the approach from PR #1952 onto the main branch, reverting the adoption of Go 1.26 native FIPS mode (crypto/fips140, GOFIPS140=certified) and restoring dynamic linking with BoringCrypto (gke-distroless/libc, GOEXPERIMENT=boringcrypto, CGO_ENABLED=1), without altering golangci-lint configuration.

@bernot-dev bernot-dev self-assigned this Jun 5, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request transitions the build pipeline from using noboringcrypto and GOFIPS140=certified (with CGO disabled) to boringcrypto with CGO_ENABLED=1 and GOFIPS140=off. It updates the Dockerfiles to support cross-compilation with CGO enabled, switches to a glibc-based distroless image, and introduces a boring.go file in each component to import crypto/tls/fipsonly. However, the reviewer identified a critical issue across all components: the build tag in the new boring.go files is incorrectly set to boring instead of boringcrypto, which would prevent the FIPS-only TLS enforcement from being compiled in.

Comment thread cmd/config-reloader/boring.go Outdated
Comment thread cmd/datasource-syncer/boring.go Outdated
Comment thread cmd/frontend/boring.go Outdated
Comment thread cmd/operator/boring.go Outdated
Comment thread cmd/rule-evaluator/boring.go Outdated
This replicates the approach from PR #1952 onto the main branch,
reverting the adoption of Go 1.26 native FIPS mode (`crypto/fips140`,
`GOFIPS140=certified`) and restoring dynamic linking with `BoringCrypto`
(`gke-distroless/libc`, `GOEXPERIMENT=boringcrypto`, `CGO_ENABLED=1`),
without altering `golangci-lint` configuration.
@bernot-dev

Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request transitions the build configuration from using noboringcrypto (with GOFIPS140=certified and CGO_ENABLED=0) to standard boringcrypto (with GOFIPS140=off and CGO_ENABLED=1). To support CGO, the Dockerfiles are updated to install cross-compilation toolchains (gcc and libc cross-compilers) when building for different target architectures, and the final base images are switched to a distroless variant that includes libc. Additionally, explicit FIPS initialization checks are removed from the main.go files, and a new boring.go file is introduced in each command package to import crypto/tls/fipsonly under the experiment.boringcrypto build tag. There are no review comments, so I have no feedback to provide.

@bernot-dev
bernot-dev marked this pull request as ready for review June 5, 2026 19:44
@bernot-dev
bernot-dev merged commit 522c072 into main Jun 5, 2026
42 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.

2 participants