File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed 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,15 @@ 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 ("FIPS 140-3 check completed" )
136+ } else {
137+ // normally this should never happen, still it is good to print out an error and exit
138+ setupLog .Error (nil , "Running in non-compliant FIPS mode. Exiting now" )
139+ os .Exit (1 )
140+ }
141+
132142 setupContext := context .Background ()
133143
134144 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 GODEBUG=fips140=only 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