From: Arno Wagner <arno@wagner.name>
To: dm-crypt@saout.de
Subject: Re: [dm-crypt] Encrypt all partitions with dm-crypt
Date: Sat, 8 Sep 2012 21:36:35 +0200 [thread overview]
Message-ID: <20120908193635.GA31299@tansi.org> (raw)
In-Reply-To: <20120908163907.GA27265@fancy-poultry.org>
On Sat, Sep 08, 2012 at 06:39:07PM +0200, Heinz Diehl wrote:
> On 08.09.2012, Arno Wagner wrote:
>
> > So? You miss the point: If swap can be securely encrypted
> > independently, this decreases overall system complexity and
> > hence increase security.
>
> If swap is created on installation, encrypted with the same
> passphrase as the rest of the system, and just gets opened while
> booting, it is clearly _less_ complex than having it created on every
> single (re)boot, incl. generating a new passphrase.
> You simply boot, enter the passphrase and you're done.
It is not. The complexity is lesser because a single system
doing two different things is basically always more complex
than two systems doint the things individually. It may not
appear to be from the code, but design, architecture and
security analysis are part of the system and they definitely
get more complex. This poses for example an incresed risk to
get it wrong., also on any changes.
The user-interface may be more complex though. Decreased risk
of user errors and decreased user inconvenience are the only
possible advantages of having one thing do two very different
tasks. It is not in this case as one task (swap encryption)
does not require user interaction but is completely autonomous.
One important paradigm in secure system design is to automatize
anythign that can be automatized without decreasing security.
For swap, automatizing encryption increases security.
What you seem to miss is that swap encryption and data encryption
are two very different things. One protects data potentially
leaked from memory and one protects data at rest. Memory
needs more protection, as there can be a lot of sensitive
data in there that never makes it to disk.
True, it sometimes requires design errors or system
shortcommings. Some examples:
- Neither Firefox nor Opera lock any memory when an SSL
connection is active. (Suspected this a long time, but just
checked. It is in the VmLck field in /proc/<pid>/status.)
This means SSL session keys will not be protected against
swapping and the same for anything sent or received over SSL.
- Upgrade the last item. Say you use Tor for something secret.
Same risk.
- The same is likely true for any chat application.
> > For example, swap encryption done
> > this way will not be subject to any problems with weak
> > passwords.
>
> If you use weak passphrases, you have a substantial problem which goes
> far beyond the fact of automatic swapspace generation/encryption on
> boot vs. singe passphrase setup.
But if you only encrypt wap, this problem will not be present
with a random key at all.
> Your whole system would be prone to
> brute force / dictionary attacks. Assuming your swap passphrase is
> randomly generated at boot-time, your swapspace would be secure, while
> the rest is not. That makes no sense to me.
Swap needs more protection than data at rest. The reason is that
the risk to swap is data-leakage from main memory. There can be
things in swap that never make it to data storage.
> > And yes, it is possible that there are things in swap that
> > cannot be found in the data partitions. Swap encryption
> > solves a different problem than data partition encryption.
>
> You're right, I don't get the point. Really.
>
> > That other encryption could be insecure on the system is
> > immaterial, swap can (and should) be solved on its own.
>
> Frankly, nobody would try to attack swap on a fully encrypted system
> in the first place. If an attacker thinks it's worth the effort, where
> would he/she think are most of the relevant data? I strongly guess it
> would be the root and/or the home partition.
Oh, yes, a competent attacker would very much like to look
at swap as well, in particular if it is free anyways (only one
passphrase for everything). In autonomous swap encryption, the
attacker has to spent likely more effort to get at swap. Which
is appropriate as it may need more protection anyways, depending
on attacker model.
> > And, as I have pointed out, there are reasons to want swap
> > encryption even when noting else on the system is encrypted,
> > so the independent approach needs to be engineered anyways.
>
> I agree in this situation, just I don't understand why one would do
> that when all the rest is unencrypted. It's more likely that the
> various /tmp direcories will contain leaked sensitive data, or that
> sensitive data is dumped to disk under a crash or system fault.
That is rather unlikely. It also only happens on crashes, so
the user will know. And it requires misconfiguration. And it
is subject to the permission system. Nothing of that is true
for swap.
> Even
> the randomly generated passphrase could leak/be dumped, because the
> root partition will be mounted before the swap is generated.
It could basically only leak to swap. And that is not a problem
with a random key. It may be with a non-random one.
Now, all this is not a make-or-break item in most scenarios.
Dping swap encryption with a static key is not massively less
secure than doing it with a random key in most scenarios.
But if you want to do it right, then swap gets encrypted
automatically with a one-time random key (that may even get
regenerated periodically) and data gets encrypted with a user
supplied key or a key that is protected by a user-supplied
passphrase.
Arno
--
Arno Wagner, Dr. sc. techn., Dipl. Inform., Email: arno@wagner.name
GnuPG: ID: 1E25338F FP: 0C30 5782 9D93 F785 E79C 0296 797F 6B50 1E25 338F
----
One of the painful things about our time is that those who feel certainty
are stupid, and those with any imagination and understanding are filled
with doubt and indecision. -- Bertrand Russell
next prev parent reply other threads:[~2012-09-08 19:36 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 12:10 [dm-crypt] Encrypt all partitions with dm-crypt Stayvoid
2012-08-22 12:24 ` Arno Wagner
2012-08-22 15:40 ` Stayvoid
2012-08-22 15:52 ` Heinz Diehl
2012-08-22 15:54 ` Matthew Monaco
2012-08-22 15:57 ` Javier Juan Martínez Cabezón
2012-08-23 7:28 ` Arno Wagner
2012-08-23 9:00 ` Christophe
2012-08-23 11:27 ` Arno Wagner
2012-08-23 14:12 ` Heinz Diehl
2012-08-23 15:10 ` Christophe
2012-08-23 16:07 ` Arno Wagner
2012-08-23 18:12 ` Milan Broz
2012-08-23 19:34 ` Arno Wagner
2012-08-24 14:01 ` Milan Broz
2012-08-24 14:40 ` Heinz Diehl
2012-08-24 15:14 ` Arno Wagner
2012-09-05 4:21 ` Stayvoid
2012-09-05 13:01 ` Arno Wagner
2012-09-06 12:54 ` Stayvoid
2012-09-06 16:46 ` Arno Wagner
2012-09-06 17:53 ` Heinz Diehl
2012-09-06 19:58 ` Arno Wagner
2012-09-07 16:10 ` Stayvoid
2012-09-07 19:04 ` Arno Wagner
2012-09-08 2:50 ` Stayvoid
2012-09-08 7:01 ` Milan Broz
2012-09-09 16:21 ` Stayvoid
2012-09-15 0:52 ` Stayvoid
2012-09-15 1:09 ` Matthew Monaco
2012-09-15 1:10 ` Matthew Monaco
2012-09-20 7:13 ` Stayvoid
2012-09-20 9:18 ` Javier Juan Martínez Cabezón
2012-09-21 5:01 ` Stayvoid
2012-09-21 10:01 ` Arno Wagner
2012-09-21 18:14 ` Stayvoid
2012-09-22 22:36 ` Stayvoid
2012-09-25 3:12 ` Stayvoid
2012-09-25 6:31 ` Matthew Monaco
2012-09-25 7:13 ` Stayvoid
2012-09-25 13:58 ` Stayvoid
2012-09-25 19:06 ` Matthew Monaco
2012-09-25 23:54 ` Stayvoid
2012-09-26 2:12 ` Matthew Monaco
2012-09-26 8:23 ` Stayvoid
2012-09-26 9:24 ` Matthew Monaco
2012-09-26 10:49 ` Stayvoid
2012-09-26 10:51 ` Stayvoid
2012-09-26 11:13 ` Matthew Monaco
2012-09-26 23:34 ` Stayvoid
2012-09-15 6:13 ` Javier Juan Martínez Cabezón
2012-09-08 8:13 ` Heinz Diehl
2012-09-08 13:26 ` Arno Wagner
2012-09-08 14:37 ` Heinz Diehl
2012-09-08 16:05 ` Arno Wagner
2012-09-08 16:39 ` Heinz Diehl
2012-09-08 19:36 ` Arno Wagner [this message]
2012-09-08 14:58 ` Marc MERLIN
2012-09-19 4:15 ` Two Spirit
2012-09-19 4:52 ` Javier Juan Martínez Cabezón
2012-09-19 5:13 ` Arno Wagner
2012-08-24 14:47 ` Arno Wagner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120908193635.GA31299@tansi.org \
--to=arno@wagner.name \
--cc=dm-crypt@saout.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.