You've already forked runc
mirror of
https://github.com/opencontainers/runc.git
synced 2025-07-30 17:43:06 +03:00
libcontainer: force apps to think fips is enabled/disabled for testing
The motivation behind this change is to provide a flexible mechanism for containers within a Kubernetes cluster to opt out of FIPS mode when necessary. This change enables apps to simulate FIPS mode being enabled or disabled for testing purposes. Users can control whether apps believe FIPS mode is on or off by manipulating `/proc/sys/crypto/fips_enabled`. Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
This commit is contained in:
@ -134,6 +134,21 @@ func TestCheckMountDestNsLastPid(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckCryptoFipsEnabled(t *testing.T) {
|
||||
m := mountEntry{
|
||||
Mount: &configs.Mount{
|
||||
Destination: "/proc/sys/crypto/fips_enabled",
|
||||
Source: "tmpfs",
|
||||
Device: "tmpfs",
|
||||
},
|
||||
}
|
||||
dest := "/rootfs/proc/sys/crypto/fips_enabled"
|
||||
err := checkProcMount("/rootfs", dest, m)
|
||||
if err != nil {
|
||||
t.Fatalf("/proc/sys/crypto/fips_enabled should not return an error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNeedsSetupDev(t *testing.T) {
|
||||
config := &configs.Config{
|
||||
Mounts: []*configs.Mount{
|
||||
|
Reference in New Issue
Block a user