log the fips140 mode and version

Requires go1.26 for fips140.Version()
This commit is contained in:
Wade Simmons
2026-04-27 16:43:35 -04:00
parent e6eeb3709b
commit fcfbec4710
4 changed files with 22 additions and 4 deletions

View File

@@ -156,13 +156,15 @@ make bin-boringcrypto
make release-boringcrypto make release-boringcrypto
``` ```
Nebula can also be built using the [FIPS 140-3](https://go.dev/doc/security/fips140) mode of Go by running either of the following make targets: Nebula can also be built to support the [FIPS 140-3](https://go.dev/doc/security/fips140) mode of Go by running either of the following make targets. (this must be set at compile time so that the correct AES-GCM can be used for FIPS 140-3 enforcement mode).
```sh ```sh
make fips140 make fips140
make fips140 release make fips140 release
``` ```
You will then also need to run nebula with `GODEBUG=fips140=only` to enable usage at runtime.
This is not the recommended default deployment, but may be useful based on your compliance requirements. This is not the recommended default deployment, but may be useful based on your compliance requirements.
## Credits ## Credits

17
fips140.go Normal file
View File

@@ -0,0 +1,17 @@
package nebula
import (
"crypto/fips140"
"fmt"
)
func fips140version() string {
switch {
case fips140.Enforced():
return fmt.Sprintf("only,version=%s", fips140.Version())
case fips140.Enabled():
return fmt.Sprintf("on,version=%s", fips140.Version())
default:
return "off"
}
}

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/slackhq/nebula module github.com/slackhq/nebula
go 1.25.0 go 1.26
require ( require (
dario.cat/mergo v1.0.2 dario.cat/mergo v1.0.2

View File

@@ -2,7 +2,6 @@ package nebula
import ( import (
"context" "context"
"crypto/fips140"
"errors" "errors"
"fmt" "fmt"
"io" "io"
@@ -234,7 +233,7 @@ func (f *Interface) activate() error {
"build", f.version, "build", f.version,
"udpAddr", addr, "udpAddr", addr,
"boringcrypto", boringEnabled(), "boringcrypto", boringEnabled(),
"fips140", fips140.Enabled(), "fips140", fips140version(),
) )
if f.routines > 1 { if f.routines > 1 {