-
-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add notification for secure boot key check
- Add script to check for sb enabled and key registration - Add systemd service to run script and notify
- Loading branch information
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
FINGERPRINT="2B:E9:91:E3:B1:B5:40:70:F4:3D:80:BB:13:EB:C6:57:E5:A3:78:0D" | ||
mokutil --list-enrolled | grep -q $FINGERPRINT | ||
ENROLLED=$? | ||
mokutil --sb-state | grep -q enabled | ||
SB_ENABLED=$? | ||
|
||
if [[ $ENROLLED -eq 1 ]] && [[ $SB_ENABLED -eq 0 ]]; then | ||
exit 1 | ||
fi | ||
|
||
exit 0 |
17 changes: 17 additions & 0 deletions
17
system_files/shared/usr/lib/systemd/system/sb-key-notify.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[Unit] | ||
Description=Service to check for secure boot key enrollment and send notifications | ||
|
||
[Service] | ||
ExecStart=/usr/bin/check-sb-key || notify-send 'WARNING' \ | ||
"This machine has secure boot turned on, but you haven't enrolled Universal Blue's keys. Failing to enroll these before rebooting may cause your system to fail to boot. Follow this link https://docs.projectbluefin.io/introduction#secure-boot for instructions on how to enroll the keys." \ | ||
-i dialog-warning \ | ||
-u critical \ | ||
-a mokutil \ | ||
--wait | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
|
||
[Timer] | ||
OnBootSec=1min | ||
OnUnitActiveSec=1h |