Skip to content

Commit c8f236f

Browse files
committed
tests/kola: Add lockdown LSM test
See: https://bugzilla.redhat.com/show_bug.cgi?id=2333706
1 parent 72e06ee commit c8f236f

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

tests/kola/security/data/commonlib.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../data/commonlib.sh

tests/kola/security/lockdown

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
## kola:
3+
## exclusive: false
4+
## architectures: x86_64 aarch64
5+
## description: Verify that the lockdown LSM is set to integrity when booted using Secure Boot
6+
#
7+
# See https://bugzilla.redhat.com/show_bug.cgi?id=2333706
8+
9+
set -xeuo pipefail
10+
11+
. $KOLA_EXT_DATA/commonlib.sh
12+
13+
lockdown_state="$(cat "/sys/kernel/security/lockdown")"
14+
15+
if [[ "$(mokutil --sb)" == "SecureBoot enabled" ]]; then
16+
if [[ "${lockdown_state}" == "none [integrity] confidentiality" ]]; then
17+
ok "lockdown LSM set to integrity on a Secure Boot system"
18+
else
19+
fatal "lockdown LSM not set to integrity on a Secure Boot system"
20+
fi
21+
else
22+
if [[ "${lockdown_state}" == "[none] integrity confidentiality" ]]; then
23+
ok "lockdown LSM set to non on a non Secure Boot system"
24+
else
25+
fatal "lockdown LSM not set to none on a non Secure Boot system"
26+
fi
27+
fi

0 commit comments

Comments
 (0)