Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/kola: Add lockdown LSM test #3326

Open
wants to merge 1 commit into
base: testing-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/kola/security/data/commonlib.sh
27 changes: 27 additions & 0 deletions tests/kola/security/lockdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
## kola:
## exclusive: false
## architectures: x86_64 aarch64
## description: Verify that the lockdown LSM is set to integrity when booted using Secure Boot
#
# See https://bugzilla.redhat.com/show_bug.cgi?id=2333706

set -xeuo pipefail

. $KOLA_EXT_DATA/commonlib.sh

lockdown_state="$(cat "/sys/kernel/security/lockdown")"

if [[ "$(mokutil --sb)" == "SecureBoot enabled" ]]; then
if [[ "${lockdown_state}" == "none [integrity] confidentiality" ]]; then
ok "lockdown LSM set to integrity on a Secure Boot system"
else
fatal "lockdown LSM not set to integrity on a Secure Boot system"
fi
else
if [[ "${lockdown_state}" == "[none] integrity confidentiality" ]]; then
ok "lockdown LSM set to non on a non Secure Boot system"
else
fatal "lockdown LSM not set to none on a non Secure Boot system"
fi
fi