Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for 'rootfs: verity' #876

Merged
merged 1 commit into from
Dec 11, 2019
Merged

Conversation

cgwalters
Copy link
Member

@cgwalters cgwalters commented Oct 25, 2019

I'd like to move in the direction of using fs-verity. First, if
we detect the target kernel has CONFIG_FS_VERITY, we use it
unconditionally for /boot since that's already ext4, and we don't
need reflinks there.

To aid further development work here, add rootfs: verity as an option
in image.yaml. But this isn't the default because we don't
want to trade off incomplete security for performance (reflinks).

@cgwalters
Copy link
Member Author

See also ostreedev/ostree#1959

Using this requires at least Linux 5.4 (on both cosa and the target) - I pulled the latest f32 builds from koji, plus latest kernel-headers of same.

@cgwalters
Copy link
Member Author

Motivated by openshift/enhancements#79

@cgwalters
Copy link
Member Author

@cgwalters
Copy link
Member Author

This depends on #786

@cgwalters cgwalters added the hold waiting on something label Nov 8, 2019
@cgwalters cgwalters changed the title WIP: Add support for 'rootfs: verity' Add support for 'rootfs: verity' Dec 6, 2019
@cgwalters
Copy link
Member Author

Lifting WIP on this since it works and I'd like to avoid rebasing across the continual conflict-fest that is create_disk.sh 😄

We aren't shipping kernel-5.4 in f31 yet, but that should happen soon I think.

@cgwalters
Copy link
Member Author

It's mostly a no-op until ostreedev/ostree#1959 lands too.

cgwalters added a commit to cgwalters/ostree that referenced this pull request Dec 6, 2019
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876
cgwalters added a commit to cgwalters/ostree that referenced this pull request Dec 6, 2019
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876
Copy link
Contributor

@darkmuggle darkmuggle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cgwalters cgwalters removed the hold waiting on something label Dec 10, 2019
I'd like to move in the direction of using fs-verity.  First, if
we detect the target kernel has `CONFIG_FS_VERITY`, we use it
unconditionally for `/boot` since that's already ext4, and we don't
need reflinks there.

To aid further development work here, add `rootfs: verity` as an option
in `image.yaml`.  But this isn't the default because we don't
want to trade off incomplete security for performance (reflinks).
@cgwalters
Copy link
Member Author

Rebased 🏄‍♂️ and will merge if no further comments/objections in a bit.

@cgwalters cgwalters merged commit 118b52e into coreos:master Dec 11, 2019
@cgwalters cgwalters deleted the image-verity branch December 11, 2019 14:33
cgwalters added a commit to cgwalters/ostree that referenced this pull request Jan 27, 2020
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876
cgwalters added a commit to cgwalters/ostree that referenced this pull request Jan 27, 2020
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876
cgwalters added a commit to cgwalters/ostree that referenced this pull request Jan 27, 2020
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876
starnight pushed a commit to endlessm/ostree that referenced this pull request Mar 2, 2020
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876
starnight pushed a commit to endlessm/ostree that referenced this pull request Mar 2, 2020
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876

Rediff for https://phabricator.endlessm.com/T29416
starnight pushed a commit to endlessm/ostree that referenced this pull request Mar 2, 2020
Using fs-verity is natural for OSTree because it's file-based,
as opposed to block based (like dm-verity).  This only covers
files - not symlinks or directories.  And we clearly need to
have integrity for the deployment directories at least.

Also, what we likely need is an API that supports signing files
as they're committed.

So making this truly secure would need a lot more work.  Nevertheless,
I think it's time to start experimenting with it.  Among other things,
it does *finally* add an API that makes files immutable, which will
help against some accidental damage.

This is basic enablement work that is being driven by
Fedora CoreOS; see also coreos/coreos-assembler#876

Rediff for https://phabricator.endlessm.com/T29416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants