Chkboot
github.com
github.com
https://www1.informatik.uni-erlangen.de/tresor
It has been on HN before. I doubt anyone is running it on tablet to secure their lights, TV, and toiles though.
(Everyone, forgive the joke; but I loved this presumed user's artcile on Android light controls in hotels: https://news.ycombinator.com/item?id=11266796)
By that argument, if the attacker can modify the contents of /boot then you've lost and this doesn't buy you anything.
a) Use signatures instead of hashes and keep the "correct" signature secret. This would prevent attacker from hard-coding correct looking output into the tampered system.
b) Do not store the correct signature anywhere where the potentially tampered system could read it. I'm thinking using smartphone or possibly some usb module for verification, or maybe just rely on users memory (assisted with something akin to SSH randomart fingerprints)
c) Fill free space on /boot with random data and calculate the signature for the whole partition. This is to detect if attacker attempts to store backup copies of untampered files.
To me it's not immediately obvious how attacker could tamper with boot files without detection, presuming that their ability to tamper is restricted to the hard drive (i.e. no firmware attacks etc).
edit: for clarification, I'm talking only hypothetically here, I'm not considering this sort of system for personal use nor would I be recommending it to anyone else.
[1] https://www.google.co.uk/search?q=rootkit+intercepting+open+...
[2] http://phrack.org/issues/66/16.html
[3] https://www.ece.cmu.edu/~ganger/712.fall02/papers/p761-thomp...
Could you be bit more specific about this?
Or the attacker could just use the hard drive. Pick a random block. Chances are decent the corruption won't be noticed anytime soon, especially if the block is, say, at the end of the ext4 journal, which was probably clean at shutdown anyway.
It's the same problem as UEFI defining that a certain UEFI variable will be set if you booted securely -- but a malicious kernel could just fake that UEFI variable.
Instead, you should have authenticated encryption for both /boot and your root filesystem. GRUB has been able to boot from encrypted partitions for a while, we should push for that to be the default (I'm not sure if it's authenticated encryption though).
# chkboot
Checks for changes (once) then updates the file list. If you run chkboot again, it will erase the changes list! $ chkboot-check
This basically just runs `cat` on a file made by chkboot.Also, there's a long-standing bug where `chkboot -u` just doesn't work, making the mkinitcpio hook useless.
A better interface would be:
# chkboot-update
Updates hashes. # chkboot-verify
Checks hashes and writes any failures to syslog/stderr/logfile. Return code tells you if it was successful.Since you need root permissions to access many of the files in /boot, you really can't avoid running chkboot-verify as root.
https://bbs.archlinux.org/viewtopic.php?pid=1502651#p1502651
But as I know LUKS and other disk systems in Unix decrypt, and do not MAC then encrypt, I wonder if I am wasting even more of my time I do not have to begin with.
edit: I also think it might be ever so slightly better to calculate signatures instead of plain hashes. That would make it bit more difficult for attacker to forge correct values.