Skip to content

Commit 72d74b2

Browse files
authored
Merge pull request #995 from rabbitmq/fips
Log a line when FIPS is enabled
2 parents d5e8d86 + 385ab14 commit 72d74b2

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ ARG TARGETARCH
2222
ENV GOOS=$TARGETOS
2323
ENV GOARCH=$TARGETARCH
2424

25+
ARG FIPS_MODE=off
26+
ENV GOFIPS140=$FIPS_MODE
27+
2528
# Build
2629
RUN CGO_ENABLED=0 GO111MODULE=on go build -a -tags timetzdata -o manager main.go
2730

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,11 @@ generate-client-set:
192192

193193
GIT_COMMIT=$(shell git rev-parse --short HEAD)-dev
194194
OPERATOR_IMAGE ?= rabbitmqoperator/messaging-topology-operator
195+
GOFIPS140 ?= off
195196
.PHONY: docker-build-dev
196197
docker-build-dev:
197198
$(call check_defined, DOCKER_REGISTRY_SERVER, URL of docker registry containing the Operator image (e.g. registry.my-company.com))
198-
$(BUILD_KIT) buildx build --build-arg=GIT_COMMIT=$(GIT_COMMIT) -t $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT) .
199+
$(BUILD_KIT) buildx build --build-arg=FIPS_MODE=$(GOFIPS140) --build-arg=GIT_COMMIT=$(GIT_COMMIT) -t $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT) .
199200
$(BUILD_KIT) push $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)
200201

201202
# docker-build-local and deploy-local work in local Kubernetes installations where the Kubernetes API

main.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ This product may include a number of subcomponents with separate copyright notic
1010
package main
1111

1212
import (
13+
"crypto/fips140"
1314
"flag"
1415
"fmt"
1516
"os"
@@ -387,6 +388,7 @@ func main() {
387388
log.Error(err, "unable to create controller", "controller", controllers.SuperStreamControllerName)
388389
os.Exit(1)
389390
}
391+
// +kubebuilder:scaffold:builder
390392

391393
if os.Getenv(controllers.EnableWebhooksEnvVar) != "false" {
392394
if err = (&topology.Binding{}).SetupWebhookWithManager(mgr); err != nil {
@@ -443,7 +445,9 @@ func main() {
443445
}
444446
}
445447

446-
// +kubebuilder:scaffold:builder
448+
if fips140.Enabled() {
449+
log.Info("FIPS 140-3 mode enabled")
450+
}
447451

448452
log.Info("starting manager")
449453
if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil {

0 commit comments

Comments
 (0)