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.
17
17
package main
18
18
19
19
import (
20
+ "crypto/fips140"
20
21
"embed"
21
22
"flag"
22
23
"os"
@@ -129,6 +130,15 @@ func main() {
129
130
130
131
ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
131
132
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
+
132
142
setupContext := context .Background ()
133
143
134
144
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 GODEBUG=fips140=only 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