LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-22-2017, 04:47 AM   #1
AtheroS
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Rep: Reputation: Disabled
Unlock LUKS from network (wifi and LAN)


Hello, I want to configure my LUKS encrypted device (currently Raspberry 3, but this should work on any machine running Debian or Debian based distro with initramfs) to be unlockable from LAN and from a WiFi. The custom initramfs should be responsible for connecting via LAN, hosting a wifi network with hostapd and running a ssh server to get the password to unlock the LUKS. There aren't any tutorials on the net for doing this, only for the parts, which aren't fully working, that's why I'am asking for help.

The Parts working already:

Generating an initramfs with Debian tools on Kali and the modified version of Simoschiele's initramfs-hooks(https://github.com/simonschiele/initramfs-hooks), i will make a new github repo for these modified scripts. This initramfs can connect to a network via LAN.

Creating an encrypted rootfs (https://github.com/NicoHood/NicoHood...ition-Tutorial)

Work In Progress:

Fix that Dropbear in the initramfs with Simonschiele's configuration isn't accepting logins (Permission Denied (publickey) - i will give more precise logs), or find a working ssh server for this and 'port' it for the initramfs environment.

Make hostapd work in the initramfs.

Create a script that automatizes the creation of this whole thing and creates a checksum of the initramfs that is easily writeable to a one time write media for integrity checks.

I will give the files and logs that I already made.
Update, here's the repo of the project: https://github.com/AtheroS-dev/luks-initramfs
Thanks for any help, I would be thankful for any type of idea or solution that can help this project.

Last edited by AtheroS; 06-22-2017 at 05:03 AM. Reason: adding link to logs and files
 
Old 08-10-2017, 05:30 AM   #2
AtheroS
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I started a new thread

I started a new thread, because i can't edit my posts here. The new, relevant thread:
https://forums.kali.org/showthread.p...-(wifi-and-LAN)
 
Old 08-10-2017, 05:47 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Well, I'm too lazy to join the Kali forum, so I'll just post on LQ. You would solve most of the problem if you didn't encrypt any system files. Those don't need to be encrypted, because they're not secret. Just make a separate place for data files and encrypt that.

If you have only one partition, then make a sparse file, encrypt it, open it, and format it like a disk. Put all your data in the virtual drive. Close it.
 
Old 08-10-2017, 06:57 AM   #4
AtheroS
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
Well, I'm too lazy to join the Kali forum, so I'll just post on LQ. You would solve most of the problem if you didn't encrypt any system files. Those don't need to be encrypted, because they're not secret. Just make a separate place for data files and encrypt that.

If you have only one partition, then make a sparse file, encrypt it, open it, and format it like a disk. Put all your data in the virtual drive. Close it.
If I encrypt the whole partition, I don't have to search rootkits in the system files, only in the /boot partition, which is small and i can simply overwrite it from a backup with a trusted device. I don't only encrypt files to hide something, i want to know that they aren't modified.
 
Old 08-10-2017, 07:36 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
So you're worried about your system files being modified whilst it isn't even powered on ?.
 
Old 08-11-2017, 02:24 AM   #6
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Quote:
Originally Posted by syg00 View Post
So you're worried about your system files being modified whilst it isn't even powered on ?.
That kind of struck me also.
 
Old 08-12-2017, 10:26 AM   #7
AtheroS
LQ Newbie
 
Registered: Jun 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Please think before post !

Quote:
Originally Posted by AwesomeMachine View Post
That kind of struck me also.
Someone steals the microSD card, plugs it into another computer, places a keylogger on it, the puts it back to my RPi3. This works only without disk encryption. LUKS protects the integrity of the encrypted partition.(You can't modify encrypted files correctly, because you don't understand them.) Of course there's always a non-encrypted partition for asking for password, but these can be smaller and checked easier than the whole rootfs.
 
Old 08-13-2017, 01:07 AM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
Yes, if the hacker gains physical access to the hardware all bets are off. I hadn't thought of that particular scenario. But the OP has a valid point.
 
Old 08-13-2017, 08:11 AM   #9
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,130
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Maybe have the initramfs download a keyfile from a trusted machine when it connects to wifi?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help: luks auto-unlock via usb flashdrive Centos7 xingkorabo03 Linux - Security 1 04-26-2017 06:53 PM
[SOLVED] Dracut: Fails to unlock/mount LUKS after update jebriggsy Linux - Software 2 03-28-2014 10:54 AM
[SOLVED] Can't unlock LUKS volume with a keyfile during boot natharran Slackware 3 02-27-2013 02:00 PM
[SOLVED] Unlock LUKS encrypted partition with USB drive yenn Slackware 4 02-26-2013 04:39 PM
[SOLVED] can't unlock luks home when booting gorillus Slackware 4 01-16-2012 05:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration