Skip to content

Conversation

@anmaxvl
Copy link
Contributor

@anmaxvl anmaxvl commented Sep 15, 2021

A new feature has been added to hcsshim where read-only LCOW layers
can be mounted with integrity protection. This is done by reading
the hash device information from layer VHD and passing it to the
LCOW UVM, where device mapper checks the integrity via dm-verity
Linux kernel feature. Layout on disk is expected to be:

|Byte 0   |Byte size(ext4)      |Byte size(ext4)+size(hash device)|
|ext4 data|dm-verity hash device|VHD footer                       |

This PR adds ability to append hash device data during LCOW image
extraction. The additional metadata to tar2ext4 converter is passed
via diff.ApplyConfig.ProcessorPayloads.

Signed-off-by: Maksim An [email protected]

@k8s-ci-robot
Copy link

Hi @anmaxvl. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 15, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 15, 2021

Build succeeded.

@mikebrow
Copy link
Member

/ok-to-test

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 15, 2021

Build succeeded.

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Sep 15, 2021

We're trying to finalize new hcsshim release (0.9.0), that's why this is still in draft.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 15, 2021

Build succeeded.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 15, 2021

Build succeeded.

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Sep 15, 2021

@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 15, 2021

Build succeeded.

@anmaxvl anmaxvl changed the title Adds support for enabling integrity protection for LCOW layers WIP: Adds support for enabling integrity protection for LCOW layers Sep 16, 2021
@anmaxvl anmaxvl marked this pull request as ready for review September 16, 2021 18:13
@anmaxvl anmaxvl changed the title WIP: Adds support for enabling integrity protection for LCOW layers Adds support for enabling integrity protection for LCOW layers Sep 22, 2021
@theopenlab-ci
Copy link

theopenlab-ci bot commented Sep 28, 2021

Build succeeded.

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Oct 11, 2021

hcsshim has been re-vendored #6099, can anyone take a look?

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 11, 2021

Build succeeded.

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Oct 13, 2021

@kevpar @katiewasnothere @dcantah PTAL 😃

Copy link

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

couple questions, but otherwise LGTM

@dcantah
Copy link
Member

dcantah commented Oct 14, 2021

Are the extra bits just ignored (like the vhd footer, virtstacks the only thing that cares about it) if the kernels not built with dm-verity?

Copy link
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

lgtm also, minor suggestion and a question

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Oct 14, 2021

Are the extra bits just ignored (like the vhd footer, virtstacks the only thing that cares about it) if the kernels not built with dm-verity?

Yeah, if the linux guest doesn't read the dm-verity footer, like we do in opengcs, the extra bits will just be ignored. ext4 file system isn't even aware of the footer, since we don't update the superblock at all.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 14, 2021

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Oct 14, 2021

Build succeeded.

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Oct 14, 2021

/retest

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Oct 20, 2021

@kevpar PTAL 😄

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Oct 22, 2021

@mikebrow any thoughts on Labels vs Annotations and PR in general? thanks 😄

@anmaxvl
Copy link
Contributor Author

anmaxvl commented Nov 10, 2021

gentle ping

Copy link

@katiewasnothere katiewasnothere left a comment

Choose a reason for hiding this comment

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

lgtm

A new feature has been added to hcsshim where read-only LCOW layers
can be mounted with integrity protection. This is done by reading
the hash device information from layer VHD and passing it to the
LCOW UVM, where device mapper checks the integrity via dm-verity
Linux kernel feature. Layout on disk is expected to be:

```
|Byte 0   |Byte size(ext4)      |Byte size(ext4)+size(hash device)|
|ext4 data|dm-verity hash device|VHD footer                       |
```

This PR adds ability to append hash device data during LCOW image
extraction. The additional metadata to tar2ext4 converter is passed
via diff.ApplyConfig.ProcessorPayloads.

Signed-off-by: Maksim An <[email protected]>
client_opts.go Outdated

// WithContainerLayerIntegrity enables integrity protection of WCOW/LCOW layers by
// setting appropriate RemoteContext label
func WithContainerLayerIntegrity() RemoteOpt {
Copy link
Member

Choose a reason for hiding this comment

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

Makes me wonder whether we should have this option, I don't see any RemoteOpt's before this that only work for a specific platform. I don't think supplying the WithPullLabel bit would be too cumbersome and would leave all of the options freely usable on *nix and Windows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, makes sense. maybe I'll just limit the change to our fork.

@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 15, 2022

Build succeeded.

1 similar comment
@theopenlab-ci
Copy link

theopenlab-ci bot commented Feb 15, 2022

Build succeeded.

@dmcgowan dmcgowan marked this pull request as draft November 30, 2022 01:42
@anmaxvl anmaxvl closed this Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants