Skip to content

Commit

Permalink
security : check kernel module signing is enabled
Browse files Browse the repository at this point in the history
Signed-off-by: Shahriyar Jalayeri <[email protected]>
  • Loading branch information
shjala committed Nov 28, 2023
1 parent 0f7de85 commit 987aa27
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/sec/sec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ func TestMain(m *testing.M) {
os.Exit(res)
}

func TestKernelModuleSigning(t *testing.T) {
log.Println("TestKernelModuleSigning started")
defer log.Println("TestKernelModuleSigning finished")

edgeNode := tc.GetEdgeNode(tc.WithTest(t))
tc.WaitForState(edgeNode, 60)

out, err := rnode.runCommand("cat /proc/config.gz | gunzip > /tmp/running.config && cat /tmp/running.config | grep CONFIG_MODULE_SIG_FORCE")
if err != nil {
t.Fatal(err)
}

status := strings.TrimSpace(string(out))
if status != "CONFIG_MODULE_SIG_FORCE=y" {
t.Fatal("Kernel module signing is not enabled")
}
}

func TestUnconfinedProcesses(t *testing.T) {

Check failure on line 112 in tests/sec/sec_test.go

View workflow job for this annotation

GitHub Actions / yetus

golangcilint: Function TestUnconfinedProcesses missing the call to method parallel (paralleltest)
log.Println("TestUnconfinedProcesses started")
defer log.Println("TestUnconfinedProcesses finished")
Expand Down

0 comments on commit 987aa27

Please sign in to comment.