33# Include bingo-managed tool variables
44include .bingo/Variables.mk
55
6- # CGO_ENABLED=0 is not FIPS compliant. large commercial vendors and FedRAMP require FIPS compliant crypto
7- # Use ?= to allow Dockerfile to override (CGO_ENABLED=0 for Alpine-based dev images)
8- CGO_ENABLED ?= 1
6+ # Go 1.25+ uses native FIPS 140-3 support (GOFIPS140) instead of BoringCrypto/GOEXPERIMENT.
7+ # CGO is no longer required for FIPS compliance. Set GOFIPS140=latest at build time and
8+ # GODEBUG=fips140=on at runtime to enable FIPS 140-3 mode.
9+ # Use ?= to allow Dockerfile to override
10+ CGO_ENABLED ?= 0
11+ GOFIPS140 ?= latest
912
1013# Enable users to override the golang used to accomodate custom installations
1114GO ?= go
6972.PHONY : help
7073
7174# Encourage consistent tool versions
72- GO_VERSION: =go1.24 .
75+ GO_VERSION: =go1.25 .
7376
7477# ## Constants:
7578version: =$(shell date +% s)
@@ -135,12 +138,12 @@ lint: $(GOLANGCI_LINT)
135138build : check-gopath generate-mocks
136139 @mkdir -p bin
137140 echo " Building version: ${build_version} "
138- CGO_ENABLED=$(CGO_ENABLED ) GOEXPERIMENT=boringcrypto ${GO} build -ldflags=" $( ldflags) " -o bin/hyperfleet-api ./cmd/hyperfleet-api
141+ CGO_ENABLED=$(CGO_ENABLED ) GOFIPS140= $( GOFIPS140 ) ${GO} build -ldflags=" $( ldflags) " -o bin/hyperfleet-api ./cmd/hyperfleet-api
139142.PHONY : build
140143
141144# Install
142145install : check-gopath generate-mocks
143- CGO_ENABLED=$(CGO_ENABLED ) GOEXPERIMENT=boringcrypto ${GO} install -ldflags=" $( ldflags) " ./cmd/hyperfleet-api
146+ CGO_ENABLED=$(CGO_ENABLED ) GOFIPS140= $( GOFIPS140 ) ${GO} install -ldflags=" $( ldflags) " ./cmd/hyperfleet-api
144147 @ ${GO} version | grep -q " $( GO_VERSION) " || \
145148 ( \
146149 printf ' \033[41m\033[97m\n' ; \
@@ -173,7 +176,7 @@ secrets:
173176# Examples:
174177# make test TESTFLAGS="-run TestSomething"
175178test : install secrets $(GOTESTSUM )
176- OCM_ENV=unit_testing $(GOTESTSUM ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -v $(TESTFLAGS ) \
179+ GODEBUG=fips140=on OCM_ENV=unit_testing $(GOTESTSUM ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -v $(TESTFLAGS ) \
177180 ./pkg/... \
178181 ./cmd/...
179182.PHONY : test
@@ -186,7 +189,7 @@ test: install secrets $(GOTESTSUM)
186189# Examples:
187190# make test-unit-json TESTFLAGS="-run TestSomething"
188191ci-test-unit : install secrets $(GOTESTSUM )
189- OCM_ENV=unit_testing $(GOTESTSUM ) --jsonfile-timing-events=$(unit_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -v $(TESTFLAGS ) \
192+ GODEBUG=fips140=on OCM_ENV=unit_testing $(GOTESTSUM ) --jsonfile-timing-events=$(unit_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -v $(TESTFLAGS ) \
190193 ./pkg/... \
191194 ./cmd/...
192195.PHONY : ci-test-unit
@@ -202,7 +205,7 @@ ci-test-unit: install secrets $(GOTESTSUM)
202205# make test-integration TESTFLAGS="-run TestAccountsGet" runs TestAccountsGet
203206# make test-integration TESTFLAGS="-short" skips long-run tests
204207ci-test-integration : install secrets $(GOTESTSUM )
205- TESTCONTAINERS_RYUK_DISABLED=true OCM_ENV=integration_testing $(GOTESTSUM ) --jsonfile-timing-events=$(integration_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
208+ GODEBUG=fips140=on TESTCONTAINERS_RYUK_DISABLED=true OCM_ENV=integration_testing $(GOTESTSUM ) --jsonfile-timing-events=$(integration_test_json_output ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
206209 ./test/integration
207210.PHONY : ci-test-integration
208211
@@ -217,7 +220,7 @@ ci-test-integration: install secrets $(GOTESTSUM)
217220# make test-integration TESTFLAGS="-run TestAccountsGet" runs TestAccountsGet
218221# make test-integration TESTFLAGS="-short" skips long-run tests
219222test-integration : install secrets $(GOTESTSUM )
220- TESTCONTAINERS_RYUK_DISABLED=true OCM_ENV=integration_testing $(GOTESTSUM ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
223+ GODEBUG=fips140=on TESTCONTAINERS_RYUK_DISABLED=true OCM_ENV=integration_testing $(GOTESTSUM ) --format $(TEST_SUMMARY_FORMAT ) -- -p 1 -ldflags -s -v -timeout 1h $(TESTFLAGS ) \
221224 ./test/integration
222225.PHONY : test-integration
223226
@@ -233,13 +236,13 @@ generate-all: generate-mocks
233236.PHONY : generate-all
234237
235238run : build
236- ./bin/hyperfleet-api migrate
237- CRD_PATH=$(PWD ) /charts/crds ./bin/hyperfleet-api serve
239+ GODEBUG=fips140=on ./bin/hyperfleet-api migrate
240+ GODEBUG=fips140=on CRD_PATH=$(PWD ) /charts/crds ./bin/hyperfleet-api serve
238241.PHONY : run
239242
240243run-no-auth : build
241- ./bin/hyperfleet-api migrate
242- CRD_PATH=$(PWD ) /charts/crds ./bin/hyperfleet-api serve --enable-authz=false --enable-jwt=false
244+ GODEBUG=fips140=on ./bin/hyperfleet-api migrate
245+ GODEBUG=fips140=on CRD_PATH=$(PWD ) /charts/crds ./bin/hyperfleet-api serve --enable-authz=false --enable-jwt=false
243246.PHONY : run-no-auth
244247
245248# Run Swagger and host the api docs
@@ -261,7 +264,7 @@ clean:
261264cmds :
262265 @mkdir -p bin
263266 for cmd in $$ (ls cmd); do \
264- CGO_ENABLED=$(CGO_ENABLED ) ${GO} build \
267+ CGO_ENABLED=$(CGO_ENABLED ) GOFIPS140= $( GOFIPS140 ) ${GO} build \
265268 -ldflags=" $( ldflags) " \
266269 -o " bin/$$ {cmd}" \
267270 " ./cmd/$$ {cmd}" \
0 commit comments