summaryrefslogtreecommitdiff
path: root/src/op_mode
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 /src/op_mode
parent56cd7de907ef26ae27909a5d468768bb6e1e7f6f (diff)
downloadvyos-1x-b78cc96cc4c4d506b7e959ec6ec9c3e7fc09fc33.tar.gz
vyos-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 'src/op_mode')
-rwxr-xr-xsrc/op_mode/version.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/op_mode/version.py b/src/op_mode/version.py
index 09d69ad1d..71a40dd50 100755
--- a/src/op_mode/version.py
+++ b/src/op_mode/version.py
@@ -25,6 +25,9 @@ import vyos.opmode
import vyos.version
import vyos.limericks
+from vyos.utils.boot import is_uefi_system
+from vyos.utils.system import get_secure_boot_state
+
from jinja2 import Template
version_output_tmpl = """
@@ -43,6 +46,7 @@ Build comment: {{build_comment}}
Architecture: {{system_arch}}
Boot via: {{boot_via}}
System type: {{system_type}}
+Secure Boot: {{secure_boot}}
Hardware vendor: {{hardware_vendor}}
Hardware model: {{hardware_model}}
@@ -57,6 +61,11 @@ Copyright: VyOS maintainers and contributors
def _get_raw_data(funny=False):
version_data = vyos.version.get_full_version_data()
+ version_data["secure_boot"] = "n/a (BIOS)"
+ if is_uefi_system():
+ version_data["secure_boot"] = "disabled"
+ if get_secure_boot_state():
+ version_data["secure_boot"] = "enabled"
if funny:
version_data["limerick"] = vyos.limericks.get_random()