File tree Expand file tree Collapse file tree 4 files changed +16
-1
lines changed
charts/control-plane-operator Expand file tree Collapse file tree 4 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 8080 fieldRef :
8181 fieldPath : metadata.namespace
8282 {{- end }}
83+ {{- if .Values.fips.enabled }}
84+ - name : GODEBUG
85+ value : " fips140=only"
86+ {{- end }}
8387 {{- with .Values.init.env }}
8488 {{- toYaml . | nindent 12 }}
8589 {{- end }}
Original file line number Diff line number Diff line change @@ -148,6 +148,9 @@ rbac:
148148 role :
149149 rules : []
150150
151+ fips :
152+ enabled : true # controls whether controller is started with GODEBUG=fips140=only option
153+
151154nodeSelector : {}
152155
153156tolerations : []
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
1717package main
1818
1919import (
20+ "crypto/fips140"
2021 "embed"
2122 "flag"
2223 "os"
@@ -129,6 +130,13 @@ func main() {
129130
130131 ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
131132
133+ // needs to be run after ctrl.Logger has been called, so we can log
134+ if fips140 .Enabled () {
135+ setupLog .Info ("Running in FIPS 140-3 compliant mode" )
136+ } else {
137+ setupLog .Info ("Running in non-compliant FIPS mode" )
138+ }
139+
132140 setupContext := context .Background ()
133141
134142 setupClient , err := client .New (ctrl .GetConfigOrDie (), client.Options {Scheme : schemes .Local })
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ echo "> Building binaries ..."
1212 echo " > Building binary for component '$comp ' ($pf ) ..." | indent 1
1313 os=${pf%/* }
1414 arch=${pf#*/ }
15- CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -a -o bin/${comp} -${os} .${arch} cmd/main.go | indent 2
15+ CGO_ENABLED=0 GOFIPS140=latest GOOS=$os GOARCH=$arch go build -a -o bin/${comp} -${os} .${arch} cmd/main.go | indent 2
1616 done
1717 done
1818)
You can’t perform that action at this time.
0 commit comments