File tree Expand file tree Collapse file tree 4 files changed +20
-1
lines changed
charts/control-plane-operator Expand file tree Collapse file tree 4 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 80
80
fieldRef :
81
81
fieldPath : metadata.namespace
82
82
{{- end }}
83
+ {{- if .Values.fips.disable }}
84
+ - name : GODEBUG
85
+ value : " fips140=off"
86
+ {{- end }}
83
87
{{- with .Values.init.env }}
84
88
{{- toYaml . | nindent 12 }}
85
89
{{- end }}
@@ -177,6 +181,10 @@ spec:
177
181
valueFrom :
178
182
fieldRef :
179
183
fieldPath : spec.serviceAccountName
184
+ {{- if .Values.fips.disable }}
185
+ - name : GODEBUG
186
+ value : " fips140=off"
187
+ {{- end }}
180
188
{{- with .Values.manager.env }}
181
189
{{- toYaml . | nindent 12 }}
182
190
{{- end }}
Original file line number Diff line number Diff line change @@ -148,6 +148,9 @@ rbac:
148
148
role :
149
149
rules : []
150
150
151
+ fips :
152
+ disable : false # set to true if you want to start the controller with GODEBUG=fips140=off option
153
+
151
154
nodeSelector : {}
152
155
153
156
tolerations : []
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ limitations under the License.
17
17
package main
18
18
19
19
import (
20
+ "crypto/fips140"
20
21
"embed"
21
22
"flag"
22
23
"os"
@@ -129,6 +130,13 @@ func main() {
129
130
130
131
ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
131
132
133
+ // needs to be run after ctrl.SetLogger 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-FIPS-compliant mode" )
138
+ }
139
+
132
140
setupContext := context .Background ()
133
141
134
142
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 ..."
12
12
echo " > Building binary for component '$comp ' ($pf ) ..." | indent 1
13
13
os=${pf%/* }
14
14
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
16
16
done
17
17
done
18
18
)
You can’t perform that action at this time.
0 commit comments