Skip to contentSkip to conversation

Feitian PKI donation to dm-crypt projetc

dm-crypt Jean-Michel Pouré - GOOZE 8 participants 16 messages Nov 3, 2010 – Nov 8, 2010

lore
Share & tools
lore
#0 lore raw

Dear friends,

We would be happy to offer three Feitian PKI smartcards to the dm-crypt project. Free Software developer can register here:
http://gooze.eu/feitian-pki-free-software-developer-card

Also, we are currently writing a HOWTO to publish on GOOZE.

Is there a way to enable dm-crypt using opensc-pkcs11.so on startup? The idea is to have a complete encrypted system on boot.

This probably involves creating an initrd with OpenSSL and OpenSC included. Did anyone succeed in this?

Kind regards,
Jean-Michel POURE

Signature · 1 line
                  Jean-Michel Pouré - Gooze - http://www.gooze.eu
#1 lore raw
Quoted 5 lines · Jean-Michel Pouré - GOOZE

Is there a way to enable dm-crypt using opensc-pkcs11.so on startup? The idea is to have a complete encrypted system on boot.

This probably involves creating an initrd with OpenSSL and OpenSC included. Did anyone succeed in this?

e.g. Debian includes some very basic scripts to use those two, although they're dis-functional in several cases, you can use them as starting point.

Cheers,
Chris.

#2 lore raw
In reply to Jean-Michel Pouré - GOOZE
Quoted 6 lines · Jean-Michel Pour? - GOOZE

Dear friends,

We would be happy to offer three Feitian PKI smartcards to the dm-crypt project. Free Software developer can register here:
http://gooze.eu/feitian-pki-free-software-developer-card

Quoted 7 lines

Also, we are currently writing a HOWTO to publish on GOOZE.

Is there a way to enable dm-crypt using opensc-pkcs11.so on startup? The idea is to have a complete encrypted system on boot.

This probably involves creating an initrd with OpenSSL and OpenSC included. Did anyone succeed in this?

Having a not completely encrypted initrd and kernel does not qualify as "completely encrypted system on boot".

Anyways, this is not really in the dm-crypt/LUKS focus, although some people go the way of having an initrd that does set-up an encrypted root. They typically find it painful and difficult to set-up, but it is possible.

The main dm-crypt/LUKS focus is encrypted partitions in an otherwise not encrypted system.

The only interface for integrating external keys is by reading them from file or stdin and that is by desing to keep things simple.

Arno

Signature · 7 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: [email protected] 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 
#3 lore raw
Quoted 3 lines · Arno Wagner

The only interface for integrating external keys is by reading them from file or stdin and that is by desing to keep things simple.

I am maintaining it with the basic idea that libcrypsetup/cryptsetup is simple tool to configure encrypted partitions using kernel crypto. Nothing more, nothing less.

New api in libcrypsetup provides two trivial interfaces to get passphrase or key - directly provided buffer (owned by application) or keyfile.

For the compatibility reasons it fallbacks to read from terminal/stdin but the focus is to move passphrase reading into application responsibility.

IOW if anyone want to handle LUKS mapping in program (imagine e.g. systemd - issue of these days) it can use libcryptsetup and handle safe password reading dialog in application.

(Using stdin in cryptsetup in scripts is problematic - you cannot control and wipe all buffers. But this option will be always there. I mean constructions like echo "password" | cryptsetup luksOpen ...)

Handling of various tokens and cards is always wrapper around cryptsetup - (either scripts or binaries linked to libcryptsetup).

Maybe one day these scripts will be part of upstream tarball, currently it is up to the distribution to add them.

Milan

#4 lore raw
In reply to Arno Wagner
Quoted 2 lines · Arno Wagner

Having a not completely encrypted initrd and kernel does not qualify as "completely encrypted system on boot".

How would you boot such a system when initramfs / initrd is encrypted? I'm just curious.

#5 lore raw
Quoted 3 lines · Heinz Diehl
Quoted 1 line · Arno Wagner

Having a not completely encrypted initrd and kernel does

How would you boot such a system when initramfs / initrd is encrypted?

Enable your boot-loader to decrypt it. Meanwhile, grub can do this.

This somewhat reduces but, of course, not eliminates the trust-problem:
instead of having to trust your hardware, BIOS, boot-loader, kernel, and initramfs, you now have to trust your hardware, BIOS, and boot-loader only.

regards
Mario

Signature · 2 lines
Wine is fine, but wiskey is quicker. Suicide is slow with liquor.
                                                 -- Ozzy Osbourne
#6 lore raw
Quoted 6 lines · Mario 'BitKoenig' Holbe
Quoted 3 lines · Heinz Diehl
Quoted 1 line · Arno Wagner

Having a not completely encrypted initrd and kernel does

How would you boot such a system when initramfs / initrd is encrypted?

Enable your boot-loader to decrypt it. Meanwhile, grub can do this.

One other option is trusted hardware, that can do the initial decryption.

Quoted 4 lines

This somewhat reduces but, of course, not eliminates the trust-problem:
instead of having to trust your hardware, BIOS, boot-loader, kernel, and initramfs, you now have to trust your hardware, BIOS, and boot-loader only.

I completely agree. And with trusted hardware, you still have to trust the hardware. However, there is some (limited) benefit, namely the earlier in the boot process, the harder it gets for an attacker, i.e. the more expensive.

Also, with good trusted hardware, remote attacks become infeasible and you have to physically access the hardware. The same could be done with booting from a write-protected memory stick or CD/DVD.

In all cases a class vulnerability remains, namely that everything is open once the system runs. This is one reason, why encrypted root is basically only worthwhile if the attacker _has_ physical access. But in that case a whole set of new attacks become possible, that encryption does not help against, such as hardware-keyloggers, patched BIOSes, changes to your read-only boot-medium, etc..

I doubt that system encryption does help a lot in cases other than when the complete system gets stolen (laptop). But then normal system encryption for Windoes (e.g. TrueCrytp), and data+tmp+var+swap encryption for Linux is quite enough.

Side note: Benefit of a chipcard in the scope of disk encryption is that people that have trouble with passwords do not need to remember them. I really don't see any other. This can be a valid application, though.

Arno

Signature · 7 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: [email protected] 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 
#7 lore raw
In reply to Arno Wagner
Quoted 2 lines · Arno Wagner

The main dm-crypt/LUKS focus is encrypted partitions in an otherwise not encrypted system.

Thank you for answers. Reading them, I understand I did not explain correctly.

I would like to encrypt a whole system using dm-crypt. The problem is that I have to run pcsc prior to mounting partitions. But then pcsc will need access to libraries, which need to be on a mounted partition.

Is there a way around?

Kind regards,

Signature · 1 line
                  Jean-Michel Pouré - Gooze - http://www.gooze.eu
#8 lore raw
Quoted 5 lines · Jean-Michel Pouré - GOOZE

I would like to encrypt a whole system using dm-crypt. The problem is that I have to run pcsc prior to mounting partitions. But then pcsc will need access to libraries, which need to be on a mounted partition.

Is there a way around?

Simply include all required stuff (binaries libraries, etc) in the initramfs image.

The (actually booting) kernel and initramfs image need to be unencrypted anyways.

E.g. Debian brings you nice tools to include something in initramfs images + its (library)dependencies (copy_exec).

Cheers,
Chris.

#9 lore raw
Quoted 7 lines · Christoph Anton Mitterer
Quoted 5 lines · Jean-Michel Pour?? - GOOZE

I would like to encrypt a whole system using dm-crypt. The problem is that I have to run pcsc prior to mounting partitions. But then pcsc will need access to libraries, which need to be on a mounted partition.

Is there a way around?

Quoted 8 lines

Simply include all required stuff (binaries libraries, etc) in the initramfs image.

The (actually booting) kernel and initramfs image need to be unencrypted anyways.

E.g. Debian brings you nice tools to include something in initramfs images + its (library)dependencies (copy_exec).

An alternative would also be a static compile with the library functions in the executable. That can be a bit painful to do at thimes though and the executable will be pretty large. You will also need to the the static libraries for that, AFAIK.

Arno

Signature · 7 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: [email protected] 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 
#10 lore raw

On Fri, 5 Nov 2010 15:21:34 +0100, Arno Wagner <[email protected]> wrote to [email protected] and CC-ed to :

Quoted 14 lines · Christoph Anton Mitterer
Quoted 13 lines · Jean-Michel Pour?? - GOOZE
Quoted 5 lines

I would like to encrypt a whole system using dm-crypt. The problem is that I have to run pcsc prior to mounting partitions. But then pcsc will need access to libraries, which need to be on a mounted partition.

Is there a way around?

Simply include all required stuff (binaries libraries, etc) in the initramfs image.

The (actually booting) kernel and initramfs image need to be unencrypted anyways.

Quoted 8 lines
Quoted 2 lines

E.g. Debian brings you nice tools to include something in initramfs images + its (library)dependencies (copy_exec).

An alternative would also be a static compile with the library functions in the executable. That can be a bit painful to do at thimes though and the executable will be pretty large. You will also need to the the static libraries for that, AFAIK.

Sources of inspiration I used:
http://en.gentoo-wiki.com/wiki/Booting_encrypted_system_from_USB_stick#Preparing_the_USB_stick
http://en.gentoo-wiki.com/wiki/DM-Crypt_with_LUKS
http://en.gentoo-wiki.com/wiki/DM-Crypt

HTH,
Viorel

#11 lore raw
In reply to Christoph Anton Mitterer

Am 5. November 2010 14:48 schrieb Christoph Anton Mitterer <[email protected]>:

Quoted 5 lines · Jean-Michel Pouré - GOOZE
Quoted 4 lines

I would like to encrypt a whole system using dm-crypt. The problem is that I have to run pcsc prior to mounting partitions. But then pcsc will need access to libraries, which need to be on a mounted partition.

Quoted 8 lines
Quoted 1 line

Is there a way around?

Simply include all required stuff (binaries libraries, etc) in the initramfs image.

The (actually booting) kernel and initramfs image need to be unencrypted anyways.

two additional ideas to make it more secure:

1. You can put your initramfs image ona usb stick to have it even more secure.

2. A script on a encrypted root partition could compare (upon decryption) md5 checksum of initramfs with the saved md5 checksum (with md5sum) and show alert message if sums do not match.

#12 lore raw
Quoted 5 lines · Ma Begaj

A script on a encrypted root partition could compare (upon decryption) md5
checksum of initramfs with the saved md5 checksum (with md5sum) and show
alert message if sums do not match.

When using smartcards, secrets are not displayed. So why should we need to crypt the initramfs at first stage? We only need to boot in first stage, non-encrypted, and then request secrets from PKCS#11 and uncrypt the complete system.

What do you think?

Signature · 1 line
                  Jean-Michel Pouré - Gooze - http://www.gooze.eu
#13 lore raw
Quoted 4 lines · Jean-Michel Pouré - GOOZE

When using smartcards, secrets are not displayed. So why should we need to crypt the initramfs at first stage? We only need to boot in first stage, non-encrypted, and then request secrets from PKCS#11 and uncrypt the complete system.

Well, what you should need does primarily depend on what you want to have, i.e. on your security goals.

If your only security goal is the typical "stolen notebook" scenario, i.e. prevent off-line access to your data, you don't need to care about crypted initramfs or whatever.

If your security goals go further and you want to prevent secrets (keys, passphrases) from being stolen you have to care about things like root-access, backdoors, loggers, etc. An untrusted initramfs is able to install such backdoors or loggers - so are untrusted boot-loaders, BIOSes and hardwares.

If your security goal is to establish a full trust-chain, you have to care about lot more things.

regards
Mario

Signature · 2 lines
As a rule, the more bizarre a thing is, the less mysterious it proves to be.
                                    -- Sherlock Holmes by Arthur Conan Doyle
#14 lore raw
In reply to Jean-Michel Pouré - GOOZE
Quoted 4 lines · Jean-Michel Pour? - GOOZE

Le mercredi 03 novembre 2010 ?? 23:34 +0100, Arno Wagner a ??crit :

Quoted 2 lines

The main dm-crypt/LUKS focus is encrypted partitions in an otherwise not encrypted system.

Quoted 8 lines

Thank you for answers. Reading them, I understand I did not explain correctly.

I would like to encrypt a whole system using dm-crypt. The problem is that I have to run pcsc prior to mounting partitions. But then pcsc will need access to libraries, which need to be on a mounted partition.

Is there a way around?

No. You have to read something from disk in order to boot and that something needs to be unencrypted. You can do an initrd that is unencrypted or a boot-sector like TrueCrypt (and grub 2?), but neither quelifies as full system encryption.

For dm-crypt, the initrd is the means of coice.

Arno

Signature · 7 lines
Arno Wagner, Dr. sc. techn., Dipl. Inform., CISSP -- Email: [email protected] 
GnuPG:  ID: 1E25338F  FP: 0C30 5782 9D93 F785 E79C  0296 797F 6B50 1E25 338F
----
Cuddly UI's are the manifestation of wishful thinking. -- Dylan Evans

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier 
#15 lore raw
In reply to Jean-Michel Pouré - GOOZE
Quoted 8 lines · Jean-Michel Pouré - GOOZE

We would be happy to offer three Feitian PKI smartcards to the dm-crypt project. Free Software developer can register here:
http://gooze.eu/feitian-pki-free-software-developer-card

Also, we are currently writing a HOWTO to publish on GOOZE.

Is there a way to enable dm-crypt using opensc-pkcs11.so on startup? The idea is to have a complete encrypted system on boot.

Hi,
see my response later in this thread - it is not directly cryptsetup/dm-crypt job but it is closely related.

Quoted 2 lines

This probably involves creating an initrd with OpenSSL and OpenSC included. Did anyone succeed in this?

I can probably send this to people who maintain such things in Fedora distro, but maybe you already did that.

Milan