Linux kernel authentication

0

For the problem that I am facing is actually that I am working on a project which is about checking the integrity of the kernel image "vmlinuz" that is in the hard disk!
To do so, am trying to add a code that will be loaded by grub before the kernel started! So this code is going to compute the HMAC of the kernel image to see if it's well authenticated or not! Then load it.

The problem is, I don't know how to charge the image from the hard disk so I can check it! I looked in the grub manual to see how does grub do things, but it was kinda complicated and I got lost!

So please if you can help I would be so grateful.

What I have tried:

Build the linux kernel, Implementing the program that is going to compute the HMAC of the image.

Mega D-Ichi

Posted 2019-03-15T13:09:07.827

Reputation: 1

1

Don't reinvent the wheel, use signature checks. https://www.gnu.org/software/grub/manual/grub/grub.html#Using-digital-signatures

– gronostaj – 2019-03-15T13:16:41.907

1

Oh, and don't forget to secure GRUB too, so that others can't just disable signature checks. This is a good starting point: https://github.com/JohnstonJ/ubuntu-secure-boot

– gronostaj – 2019-03-15T13:22:27.917

thanl you so much bro ;) – Mega D-Ichi – 2019-03-15T13:27:23.867

2@gronostaj Don't reinvent the "Answer" form, post an answer – user1686 – 2019-03-15T13:45:46.733

No answers