-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add FIPS builds for linux amd64 * add version check * fix CI labels and add local dev commands * fix ci version tagging * switch to ubuntu 20.04 * add CLI version tag * add gcompat for alpine glibc cgo compatibility * remove FIPS version check from connect-init * address comments
- Loading branch information
1 parent
bc4af33
commit 1ed3306
Showing
12 changed files
with
210 additions
and
37 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//go:build fips | ||
|
||
package version | ||
|
||
// This validates during compilation that we are being built with a FIPS enabled go toolchain | ||
import ( | ||
_ "crypto/tls/fipsonly" | ||
"runtime" | ||
"strings" | ||
) | ||
|
||
// IsFIPS returns true if consul-k8s is operating in FIPS-140-2 mode. | ||
func IsFIPS() bool { | ||
return true | ||
} | ||
|
||
func GetFIPSInfo() string { | ||
str := "Enabled" | ||
// Try to get the crypto module name | ||
gover := strings.Split(runtime.Version(), "X:") | ||
if len(gover) >= 2 { | ||
gover_last := gover[len(gover)-1] | ||
// Able to find crypto module name; add that to status string. | ||
str = "FIPS 140-2 Enabled, crypto module " + gover_last | ||
} | ||
return str | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build !fips | ||
|
||
package version | ||
|
||
// IsFIPS returns true if consul-k8s is operating in FIPS-140-2 mode. | ||
func IsFIPS() bool { | ||
return false | ||
} | ||
|
||
func GetFIPSInfo() string { | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//go:build fips | ||
|
||
package version | ||
|
||
// This validates during compilation that we are being built with a FIPS enabled go toolchain | ||
import ( | ||
_ "crypto/tls/fipsonly" | ||
"runtime" | ||
"strings" | ||
) | ||
|
||
// IsFIPS returns true if consul-k8s is operating in FIPS-140-2 mode. | ||
func IsFIPS() bool { | ||
return true | ||
} | ||
|
||
func GetFIPSInfo() string { | ||
str := "Enabled" | ||
// Try to get the crypto module name | ||
gover := strings.Split(runtime.Version(), "X:") | ||
if len(gover) >= 2 { | ||
gover_last := gover[len(gover)-1] | ||
// Able to find crypto module name; add that to status string. | ||
str = "FIPS 140-2 Enabled, crypto module " + gover_last | ||
} | ||
return str | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build !fips | ||
|
||
package version | ||
|
||
// IsFIPS returns true if consul-k8s is operating in FIPS-140-2 mode. | ||
func IsFIPS() bool { | ||
return false | ||
} | ||
|
||
func GetFIPSInfo() string { | ||
return "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters