Skip to content

Commit

Permalink
⭐ check file permissions for loader.conf (systemd-boot) (#130)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>
  • Loading branch information
atomic111 authored Feb 25, 2023
1 parent 57322c2 commit a4b6e5b
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion core/mondoo-linux-workstation-security.mql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ queries:
# chmod og-rwx /boot/grub2/user.cfg
```
Run the following commands to set ownership and permissions on your systemd-boot loader configuration file:
```
chown root:root /boot/loader/loader.conf
chmod og-rwx /boot/loader/loader.conf
```
\*\*OR If the system uses UEFI, edit `/etc/fstab` and add the `fmask=0077` , `uid=0` , and `gid=0` options:
_Example:_
Expand Down Expand Up @@ -208,7 +215,21 @@ queries:
permissions.other_writeable == false
permissions.other_executable == false
}
}
}
if ( file("/boot/loader/loader.conf").exists ) {
file("/boot/loader/loader.conf") {
user.name == 'root'
group.name == 'root'
permissions.group_readable == false
permissions.group_writeable == false
permissions.group_executable == false
permissions.other_readable == false
permissions.other_writeable == false
permissions.other_executable == false
}
}
if(mount.list.where( fstype == 'vfat' && path == /boot/) != []) {
mount.list.where( fstype == 'vfat' && path == /boot/) {
options['fmask'] == "0077"
Expand Down

0 comments on commit a4b6e5b

Please sign in to comment.