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

Roundtripping a commit via oci image looses the commitmeta which makes signed ostree break #4973

Closed
alexlarsson opened this issue May 23, 2024 · 4 comments

Comments

@alexlarsson
Copy link
Collaborator

I created an oci image based on an automotive image that used signed composefs, when I rebased to it everything works, but on reboot the signatures fails:

[    0.419101] ostree-prepare-root[528]: ostree-prepare-root: Error loading signatures from repo: No commitmeta for commit 24e46035399c03969d5e6f610425a9adfc7a9959507fe9c32f6ccd12b3467573

Seems the detached metadata is lost somewhere along the way, which means that the signature is not available in the deployed repo.

@cgwalters
Copy link
Member

This is an issue for https://github.com/ostreedev/ostree-rs-ext/ but basically this is currently expected behavior, because we always create a local merge commit. Arguably this is a bug.

The vision with the ostree-container stuff is that we start to sign containers, not ostree commits.

But, yes. In the end, we can change the logic in https://github.com/ostreedev/ostree-rs-ext/blob/main/lib/src/container/store.rs to not make a merge commit. We were doing that originally, but for derived images today we need to synthesize a local one. (Until we get to ostreedev/ostree-rs-ext#388 )

That said, changing the store code to not make a merge commit by default is probably doable, the main thing would be switching to storing the container metadata (manifest/config) in detached commitmeta or somewhere else.

@alexlarsson
Copy link
Collaborator Author

This is an issue for https://github.com/ostreedev/ostree-rs-ext/ but basically this is currently expected behavior, because we always create a local merge commit. Arguably this is a bug.

Do you want me to move it?

The vision with the ostree-container stuff is that we start to sign containers, not ostree commits.

Well, at boot time in the initrd we need to validate something that has the composefs digest. This could be something else, but i'm not sure what is available at boottime?

@cgwalters
Copy link
Member

Do you want me to move it?

Yeah let's, it's unrelated to rpm-ostree.

Well, at boot time in the initrd we need to validate something that has the composefs digest. This could be something else, but i'm not sure what is available at boottime?

This is a larger discussion but basically I think actually where we need to get to is actually that the manifest and config at least (and possibly, for a manifest listed image all the manifests) are part of a composefs instead of living externally so they can be runtime trusted easily.

@alexlarsson
Copy link
Collaborator Author

Moved to ostreedev/ostree-rs-ext#630

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

No branches or pull requests

2 participants