You are not logged in.

#1 2017-04-30 13:06:46

archalex6
Member
From: Bangkok, Thailand
Registered: 2016-09-13
Posts: 18

Run interactive command on boot before login

Hi guys. I am trying to achieve something for which I couldn't really find documentation. I have an encrypted Arch system using KDE Plasma.

When the system boots up, I want a terminal message that validates the checksum of the files in the /boot partition against the checksum list that's inside my encrypted volume, to detect tampering (evil maid attacks). I want that message to be displayed on the console. For example:

---- Welcome to Arch Linux ---
All bootloader files are correct!
Press any key within 5 seconds to abort KDE loading...
<start SDDM here>

Or...

---- Welcome to Arch Linux ---
Bootloader file checksum mismatch!
Falling back to console

I already have a fully functional bootlaoder validation script - the only thing I'm trying to find out is how to get this to prompt before the user login prompt.
I tried /etc/profile, /etc/issue, /etc/bash.bashrc but I don't seem to be able to get any luck with that.

Might be something simple but I can't figure it out.

Offline

#2 2017-04-30 16:17:08

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,722

Re: Run interactive command on boot before login

You might try it with a systemd service that is wanted by the multi-user level and is required for the graphical level.

But, let me really bake your noodle.  If those files on boot have already executed, how do you know that they don't have you wrapped up in some little VM and will lie to you when your user space tool tries to read them by giving you the results you want? (Hence my 'Matrix' reference)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#3 2017-04-30 16:26:44

archalex6
Member
From: Bangkok, Thailand
Registered: 2016-09-13
Posts: 18

Re: Run interactive command on boot before login

Obviously no protection is perfect if I'm not able to restrict physical access to the computer - but I have other layers of protection, such as:
- BIOS locked down and boot order can't be altered
- All files have their signatures in the BIOS's secure boot DB
- The text file containing the hash list is inside the encrypted volume
- Root account disabled
- SSH access possible only by using key authentication
- All ports on stealth mode (except 22)
- All sensitive information inside VeraCrypt volumes inside my encrypted partition

Now I am aware that a very determined hacker such as the NSA will be able to find around this. I'm mostly trying to reduce the attack vectors as much as possible.

You might try it with a systemd service that is wanted by the multi-user level and is required for the graphical level.

Not sure what you mean there, do you have an example?

Offline

Board footer

Powered by FluxBB