summaryrefslogtreecommitdiff
path: root/python/vyos/utils/system.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-08-26 20:23:32 +0200
committerChristian Breunig <christian@breunig.cc>2024-09-16 17:28:50 +0200
commitb78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33 (patch)
treee4769e5024246c8cd84cd4318b6cc3fc9a4d7fee /python/vyos/utils/system.py
parent56cd7de907ef26ae27909a5d468768bb6e1e7f6f (diff)
downloadveeos-1x-b78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33.tar.gz
veeos-1x-b78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33.zip
T861: op-mode: "show version" will display secure boot state
vyos@vyos:~$ show ver ... Architecture: x86_64 Boot via: installed image System type: KVM guest Secure Boot: enabled ...
Diffstat (limited to 'python/vyos/utils/system.py')
-rw-r--r--python/vyos/utils/system.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/utils/system.py b/python/vyos/utils/system.py
index fca93d118..7b12efb14 100644
--- a/python/vyos/utils/system.py
+++ b/python/vyos/utils/system.py
@@ -139,3 +139,11 @@ def get_load_averages():
res[15] = float(matches["fifteen"]) / core_count
return res
+
+def get_secure_boot_state() -> bool:
+ from vyos.utils.process import cmd
+ from vyos.utils.boot import is_uefi_system
+ if not is_uefi_system():
+ return False
+ tmp = cmd('mokutil --sb-state')
+ return bool('enabled' in tmp)