So basically, my setup has everything encrypted except /boot/efi. This means that /boot/grub is encrypted, along with my kernels.

I am now attempting to get secure boot setup, to lock some stuff, down, but I encountered this issue: https://bbs.archlinux.org/viewtopic.php?id=282076

Now I could sign the font files… but I don’t want to. Font files and grub config are located under /boot/grub, and therefore encrypted. An attacker doing something like removing my hard drive would not be able to modify them.

I don’t want to go through the effort of encrypting font files, does anyone know if there is a version of grub that doesn’t do this?

Actually, preferably, I would like a version of grub that doesn’t verify ANYTHING. Since everything but grub’s efi file is encrypted, it would be so much simpler to only do secure boot for that.

And yes, I do understand there are security benefits to being able to prevent an attacker that has gained some level of running access to do something like replacing your kernel. But I’m less concerned about that vector of attack, I would simply like to make it so that my laptops aren’t affected by evil maid attacks, without losing benefits from timeshift or whatnot.

I found the specific commit where grub enforces verification of font files: https://github.com/rhboot/grub2/commit/539662956ad787fffa662720a67c98c217d78128

But I don’t really feel interested in creating and maintaining my own fork of grub, and I am wondering if someone has already done that.

  • Baut [she/her] auf.@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 year ago

    If you’re going for secure boot, I’d advise against GRUB.
    Use an UKI, dm-verity and get one part of your disk encryption key from your TPM 2.0 (choose PCRs carefully). Is that not compatible with timeshift?
    Also see safeboot.dev, even if that’s just for Ubuntu 20.04.

  • hottari@lemmy.ml
    link
    fedilink
    arrow-up
    3
    ·
    1 year ago

    Timeshift snapper rollbacks are nice but they can only work with grub. And that legacyware keeps finding a new way to shoot itself in the foot.

    Make daily automated backups to an external drive and/or cloud. You probably don’t need the hassle of relying on both timeshift and grub at the same time to work.

    • moonpiedumplings@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      My important data is backed up to several usb drives, and kept in sync between two computers via syncthing. Soon I will back it up to my college’s box cloud, using rclone’s crypt feature.

      But this isn’t about data. This is about me being able to tinker without worry, breaking down to even the lowest level of my system. In addition to that, I don’t want to have to waste time manually restoring a system snapshot/backup, as I will soon be busy with other things like classes. I want a one step process.

      • hottari@lemmy.ml
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        Why not tinker in a VM if that’s the case? An even better solution for your need of an easy, just works distro that is impossible to FUBAR would be something like Fedora Silverblue or MicroOS.

        I think this post is you learning the hard way, there’s no such thing as a one step process in Linux.

        • moonpiedumplings@programming.devOP
          link
          fedilink
          arrow-up
          1
          ·
          1 year ago

          Why not tinker in a VM if that’s the case?

          Can’t test battery life in a VM. Also uses up too much resources.

          Fedora Silverblue or MicroOS

          It’s a bit of a pain to get my favorite optimizatons and customizations like uksmd or zram set up on immutable distros.

          I got it working, using this guide: https://wejn.org/2021/09/fixing-grub-verification-requested-nobody-cares/.

          Certainly an unorthodox grub hack, but it’s replicatable and it works. Maybe in the future systemd boot or the refind will gain the features I want. Until then, only grub offers what I want.

          If a grub update ever breaks this, or maybe just to futureproof this, then I’ll probably just use Arch’s PKGBUILD, makepkg, and patch tools to patch the grub_efi_get_secureboot function of sb.c so that grub always thinks it’s not in secure boot. And maybe put that version on the AUR.

          I think this post is you learning the hard way, there’s no such thing as a one step process in Linux.

          No, this post is me proving everybody who told me to switch away from grub, (despite my insistence that only grub has the features I need) wrong.

          • hottari@lemmy.ml
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            Can’t test battery life in a VM. Also uses up too much resources.

            KVMs barely use any resources.

            It’s a bit of a pain to get my favorite optimizatons and customizations like uksmd or zram set up on immutable distros.

            I think Fedora enable zram by default, not so sure about Silverblue.

            I got it working … … patch the grub_efi_get_secureboot function of sb.c so that grub always thinks it’s not in secure boot.

            Sounds like you are intentionally breaking secure boot code in grub. If you can’t see why this is a problem, maybe you shouldn’t be using secure boot.

            this post is me proving everybody who told me to switch away from grub.

            Nope. The post is proving how ill-equipped grub is to support modern features such as secure boot. Grub is very much legacyware at this point. New security features are being developed over at systemd land.

            • moonpiedumplings@programming.devOP
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              1 year ago

              Sounds like you are intentionally breaking secure boot code in grub. If you can’t see why this is a problem, maybe you shouldn’t be using secure boot.

              I understand why this is a problem, or would be on systems where much of the initial stages of the system are left unencrypted. But because literally everything but grubx64.efi is encrypted, there is no need for them to be verified. Only grub, which asks for my password for the decrypting, needs to be verified. This behavior is intended for systems that require more security, for example, to prevent unauthorized loading of drivers by a malicious attacker. But I don’t need or want that.

              Nope. The post is proving how ill-equipped grub is to support modern features such as secure boot. Grub is very much legacyware at this point. New security features are being developed over at systemd land.

              I have no doubt that system-boot will get the features I want, and that grub will probably never get things like tpm auto unlock. But I don’t use software based on what features they will have, I select software based on what features it currently has. And right now, grub has features I need, that systemd-boot doesn’t have. That’s just the reality of the situation.

              edit: went through your profile history and you literally made a post of where my setup would be useful, the one about the amd regressions. Oh no, if only you had a setup where you could instantly reboot into an older kernel, with one click. But you don’t, so you just have to take the performance hit, or go through the hassle of restoring an entire backup either from the local disk, or worse, from another machine/disk. ;(

              • hottari@lemmy.ml
                link
                fedilink
                arrow-up
                1
                ·
                1 year ago

                I understand why this is a problem, or would be on systems where much of the initial stages of the system are left unencrypted. But because literally everything but grubx64.efi is encrypted, there is no need for them to be verified. Only grub, which asks for my password for the decrypting, needs to be verified. This behavior is intended for systems that require more security, for example, to prevent unauthorized loading of drivers by a malicious attacker. But I don’t need or want that.

                Sounds like cope to me. You don’t get to tell an attacker which component they can attack when you have misconfigured your security guards.

                Oh no, if only you had a setup where you could instantly reboot into an older kernel, with one click.

                I keep the LTS kernel around for that. It’s a “one-click solution” for boot problems. And anyway, a simple chroot should allow me to fix any problems.

                Don’t see what advantage snapper rollbacks have for me when I would need to use it rarely. I don’t have a habit of intentionally breaking things. And when things break on me (I use Arch btw), they rarely introduce fatal errors.

                • moonpiedumplings@programming.devOP
                  link
                  fedilink
                  arrow-up
                  1
                  ·
                  1 year ago

                  Sounds like cope to me. You don’t get to tell an attacker which component they can attack when you have misconfigured your security guards.

                  There is only a single thing on my system unencrypted: the grubx64.efi binary. This binary is verified via secure boot. Unless an attacker can break luks2 encryption, they cannot get to anything else.

                  I keep the LTS kernel around for that

                  Did you read your own post? The lts kernel was affected too. That’s why I used it as an example.

                  anyway, a simple chroot should allow me to fix any problems.

                  You could also just nab the older kernel from the archive or something, if your system still boots. But I don’t want to have to do that. I have better things to spend my time on then going through the pain of disabling all my security features so I can chroot into an encrypted system.

    • moonpiedumplings@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Dunno why this is downvoted, this is unironically a last resort of mine. I don’t want to maintain a fork of grub but if it comes down to it, I may do something similar to this except the sed trick doesn’t seem to work anymore.

      EDIT: sed trick does work. I just forgot to install grub with --disable-shim-lock.