Skip to content

FIPS mode changes and docs #761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ jobs:
make uninstall-crds
make e2e-helm-test

- name: FIPS Tests
shell: bash
run: |
make undeploy
make uninstall-crds
make fips-test

- name: Upload Manifests
uses: actions/upload-artifact@v4
if: success()
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
- name: Image Scan
shell: bash
run: |
make build-operator
sh ./hack/golang/govulncheck.sh
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
export TRIVY_CACHE=$GITHUB_WORKSPACE/.cache/trivy
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.24.3
1.24.4
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,16 @@ else
$(KUSTOMIZE) build $(BUILD_DEPLOY)/overlays/ci | $(KUBECTL_CMD) apply -f -
endif

.PHONY: just-deploy-fips
just-deploy-fips: ensure-pull-secret ## Deploy the Coherence Operator in FIPS mode without rebuilding anything
$(call prepare_deploy,$(OPERATOR_IMAGE),$(OPERATOR_NAMESPACE))
$(KUSTOMIZE) build $(BUILD_DEPLOY)/overlays/fips | $(KUBECTL_CMD) apply -f -

.PHONY: fips-test
fips-test: just-deploy-fips wait-for-deploy
chmod +x $(SCRIPTS_DIR)/fips/fips-test.sh
$(SCRIPTS_DIR)/fips/fips-test.sh


.PHONY: ensure-pull-secret
ensure-pull-secret:
Expand Down
8 changes: 8 additions & 0 deletions config/components/fips/fips-env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# This patch will configure the Operator to run in FIPS mode.
#
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: GODEBUG
value: "fips140=on"
8 changes: 8 additions & 0 deletions config/components/fips/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

patches:
- path: fips-env.yaml
target:
kind: Deployment
name: controller-manager
8 changes: 8 additions & 0 deletions config/overlays/fips/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../default

components:
- ../../components/fips
24 changes: 21 additions & 3 deletions docs/installation/100_fips.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ How the `GODEBUG` environment variable is set depends on how the operator is ins
[NOTE]
====
Although the Coherence Operator image can easily be installed in a FIPS compliant mode, none of the default
Oracle Coherence images used by the operator are FIPS complaint.
Oracle Coherence images used by the operator are FIPS compliant.

The Oracle Coherence team does not currently publish FIPS compliant Coherence images.
Coherence is FIPS compatible and correctly configured applications running in an image that has a FIPS
compliant JDK and FIPS compliant base O/S will be FIPS complaint.
Customers must build their own FIPS complaint Java and Coherence images, which the operator will then manage.

Coherence is FIPS _compatible_ so a correctly configured application running in an image that has a FIPS
compliant JDK and FIPS compliant base O/S will be FIPS complaint. To be fully FIPS compliant these images must then
be run in a container runtime on a FIPS compliant host.
====

=== Install Using Yaml Manifests
Expand Down Expand Up @@ -61,6 +64,21 @@ then add the required `GODEBUG` value, for example
value: fips140=on
----


=== Install Using Kustomize

If <<docs/installation/013_install_kustomize.adoc,installing the operator using Kustomize>> (or using `kubectl -k`)
the Coherence manifest yaml files contain a FIPS overlay that adds the `GODEBUG` environment variable
to the Operator container.

The following command will generate a yaml manifest that installs the operator with FIPS enabled:

[source,bash]
----
kustomize build manifests/overlays/fips
----


=== Install Using Helm

If <<docs/installation/012_install_helm.adoc,installing the operator using Helm>>
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module github.com/oracle/coherence-operator
// See ./.go-version for the go compiler version used when building binaries
//
// https://go.dev/doc/modules/gomod-ref#go
go 1.24.3
go 1.24.4

require (
github.com/distribution/reference v0.6.0
Expand Down
21 changes: 21 additions & 0 deletions hack/fips/fips-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Copyright (c) 2020, 2025, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
#
set -o errexit

PODS=$(kubectl -n operator-test get pod -l control-plane=coherence -o name)

for POD in ${PODS}
do
echo "Checking Operator Pod ${POD} is running in FIPS mode"
kubectl -n operator-test logs ${POD} | grep "Operator is running with FIPS 140 Enabled"
if [[ $? == 1 ]]
then
echo "Failed - did not find FIPS log message for Pod ${POD}"
exit 1
fi
done

2 changes: 2 additions & 0 deletions hack/golang/govulncheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ TOOLS_BIN=${ROOT_DIR}/build/tools/bin
test -s ${TOOLS_BIN}/govulncheck || GOBIN=${TOOLS_BIN} go install golang.org/x/vuln/cmd/govulncheck@latest
chmod +x ${TOOLS_BIN}/govulncheck

go version

make build-operator-images

echo "INFO: govulncheck - Checking x84_64 runner"
Expand Down
4 changes: 4 additions & 0 deletions runner/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
package main

import (
"crypto/fips140"
"fmt"
"github.com/oracle/coherence-operator/pkg/operator"
"github.com/oracle/coherence-operator/pkg/runner"
Expand Down Expand Up @@ -51,4 +52,7 @@ func printVersion() {
log.Info(fmt.Sprintf("Operator Git Commit: %s (%s)", Commit, Branch))
log.Info(fmt.Sprintf("Go Version: %s", runtime.Version()))
log.Info(fmt.Sprintf("Go OS/Arch: %s/%s", runtime.GOOS, runtime.GOARCH))
if fips140.Enabled() {
log.Info("Operator is running with FIPS 140 Enabled")
}
}