5

I'm conducting a security audit and came across this utility running on my Debian system. (Debian 3.16.36-1+deb8u1)

It strikes me that a piece of software like this should not be installed on a secure server. I don't know exactly what it does when it finds any installed OSs. Should I be disabling os-prober, and how do I do that? OR Should I be disabling grub, and how do I do that?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
Murray
  • 51
  • 1
  • 2

2 Answers2

5

os-prober is there to detect other operating systems. If you do not need that functionality, you can disable it; I have done that in all my Debian VMs after hitting some hiccup in testing.

You add to /etc/default/grub the line:

GRUB_DISABLE_OS_PROBER=true

And then, the commands dpkg-reconfigure linux-image-xxxxx and update-grub no longer will use os-prober.

Another alternative is to uninstall os-prober.

dpkg --purge os-prober

As Stephen Kitt points out, "The package itself is only recommended (by grub-common), so the package manager will allow you to remove it."

Or just to be on the safe side, for it not to be used anymore, do both actions.

From this link

os-prober is a spinoff of debian-installer. One of the installer's features is that it can probe disks on the system for other operating systems, and add them to the boot loader, so that installing Debian doesn't make your other installed OS hard to boot.

see Debian: New error message upgrading kernel (to 4.9) - reload ioctl error

Summing it up: it is a good idea to disable os-prober for linux servers; furthermore it is also conducive to the (security) philosophy of Unix, of keeping it simple and installing the less amount of services/software.

While in theory you could also manage to go without grub I would not trade the standard way, convenience, flexibility of booting and debugging capabilities it offers, for other scenarios. See LILO/ELILO; and u-boot-tools for an alternative, at least in some architectures.

As for grub security, I would worry more of adding a password to it.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
  • 2
    GRUB2 is an abomination forced upon the Linux community. There is nothing simple about it - just look at the number of shell scripts, executives, and configuration files it installs. Suffers from a major architectural flaw - If you have multiple Linux installations, each Linux installation keeps its own notion of GRUB configuration state. – fpmurphy May 05 '17 at 00:46
  • @fpmurphy What are you using? I am doing a lateral move to Free or OpenBSD; some links about Grub? – Rui F Ribeiro May 05 '17 at 06:41
-2

os-prober is used by GRUB to configure GRUB startup options such as menu stanzas.

If you boot your system using EFI STUB, coreboot, or some other non-GRUB mechanism (there are many!) , you certainly can disable/remove GRUB and os-prober.

If you boot your system using GRUB (which is the default boot mechanism), do not disable/remove anything associated with GRUB including os-prober or you can end up not being able to boot into other OSes on a multi-OS platform.

fpmurphy
  • 4,556
  • 3
  • 23
  • 26
  • 5
    Removing `os-prober` won’t result in an unbootable system; at worst it will result in other OSs no longer being listed in the Grub boot menu. – Stephen Kitt May 04 '17 at 06:18
  • 2
    @StephenKitt. GRUB is intended to be a multiboot loader. Many users regard a system as unbootable when they cannot boot into one of the installed OSes they wish to boot into. – fpmurphy May 05 '17 at 02:26
  • I don’t claim to speak for “many users”, but I consider that a system that can boot something useful without an external recovery CD or USB key is bootable. Especially in this case — removing `os-prover` would still allow the user to boot the system needed to restore access to the other OSs (by re-installing `os-prober`; admittedly that may not be obvious since the reboot might occur a long time after the removal). – Stephen Kitt May 07 '17 at 21:27