Re: overlayfs vs. fscrypt

From: James Bottomley
Date: Wed Mar 13 2019 - 15:22:05 EST


On Wed, 2019-03-13 at 14:58 -0400, Theodore Ts'o wrote:
> On Wed, Mar 13, 2019 at 10:45:04AM -0700, James Bottomley wrote:
> > > If they can't break root, then the OS's user-id based access
> > > control checks (or SELinux checks if you are using SELinux) will
> > > still protect you.
> >
> > Well, that's what one would think about the recent runc exploit as
> > well. The thing I was looking to do was reduce the chances that
> > unencrypted data would be lying around to be discovered. I suppose
> > the potentially biggest problem is leaking the image after it's
> > decrypted by admin means like a badly configured backup, but
> > unencryped data is potentially discoverable by breakouts as well.
>
> But while the container is running, the key is available and
> instantiated in the kernel, and the kernel is free to decrypt any
> encrypted file/block.

In the current encrypted tar file implementation, while the container
is running the decrypted tar file is extracted into the container root
and available for all to see.

The main security benefit of this implementation, as I said, is
security of at rest images and the runtime security is guaranteed by
other systems.

> The reason why the kernel won't do this is because of its access
> control checks.
>
> And we're talking about this within the context of the overlayfs.
> When in the container world will we have persistent data that lasts
> beyond the lifetime of the running container that will be using
> overlayfs? I didn't think that existed; if you are using, say, a
> Docker storage volume, does overlayfs ever get into the act? And if
> so, how, and what are the desired security properties?

Are you asking about persistent volumes? I can answer, but that's not
the current use case. The current use case is encrypted images, which
are overlays. If you mean the misconfigured backup comment then I was
thinking a backup that wrongly sweeps container root while the
container is running.

Lets go back to basics: can fscrypt provide equivalent or better
protection than the current encrypted tarfile approach? If the answer
is no because it's too tightly tied to the android use case then
perhaps there's not much point discussing it further.

James