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

⭐ check file permissions for loader.conf (systemd-boot) #130

Merged
merged 1 commit into from
Feb 25, 2023
Merged
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
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 ) {
atomic111 marked this conversation as resolved.
Show resolved Hide resolved
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