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

Support image signing and verification #295

Open
ningziwen opened this issue Mar 14, 2023 · 6 comments
Open

Support image signing and verification #295

ningziwen opened this issue Mar 14, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@ningziwen
Copy link
Member

What is the problem you're trying to solve?.
Nerdctl has signing and verification by Cosign and Notation as experimental features today.
https://github.com/containerd/nerdctl/blob/main/docs/cosign.md
https://github.com/containerd/nerdctl/blob/main/docs/notation.md

However, without the binaries installed in Finch VM, the signing and verification related functionalities are not working in Finch and would throw

cosign executable not found in path $PATH

Describe the feature you'd like
Package Cosign and Notation in Finch VM.

Additional context
Add any other context or screenshots about the feature request here.

@ningziwen ningziwen added the enhancement New feature or request label Mar 15, 2023
@ningziwen
Copy link
Member Author

ningziwen commented Mar 15, 2023

One blocker of adding Cosign is that there is one step in cosign that requires users passing cosign password as environment variable.

finch <sub_command> actually calls limactl shell finch sudo nerdctl <sub_command>. limactl shell can't pass-through environment variable today. Created an issue in Lima to understand if it is expected.

If Lima wants to suppport env pass-through by limactl shell, we can add -E after sudo to make nerdctl command use the COSIGN_PASSWORD env var.

Otherwise, we will need to inject COSIGN_PASSWORD=<pass> between sudo and nerdctl to handle it specially.


Will inject COSIGN_PASSWORD=<pass> between sudo and nerdctl based on Lima's response.

@ningziwen
Copy link
Member Author

Another blocker is in the latest Cosign 2.0.0, cosign sign needs to pass --yes to prevent prompt.
Making the change in Nerdctl. containerd/nerdctl#2109

@ningziwen
Copy link
Member Author

This change updated the OS image which includes Cosign binary. The overall Finch size will increase by around 40MB with this OS image. As there are other pending Cosign changes, we may need to only package Cosign which increases 40MB size, but without making Cosign work in the next version. Considering the size increasing is not significant and it will anyways increase later, I think it is ok to not revert the OS image change. Let me know if anyone has concerns. cc @estesp @pendo324

ningziwen added a commit that referenced this issue Apr 11, 2023
)

#295

*Description of changes:*
Add COSIGN_PASSWORD env pass-through to allow users use Cosign.

The feature should be experimental as it is experimental in Nerdctl. As
Finch points to Nerdctl documentation today, users could see Cosign
feature is experimental in Nerdctl documentation so will not mention
experimental in Finch explicitly.

*Testing done:*
The tests only covers signing by push and verification by pull and run
with the keys as MVP. The tests won't pass until the
[changed](containerd/nerdctl#2109) is integrated
to Finch. Tested locally that it can work with this change in Nerdctl.


- [ X ] I've reviewed the guidance in CONTRIBUTING.md


#### License Acceptance

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.

Signed-off-by: Ziwen Ning <ningziwe@amazon.com>
@ningziwen
Copy link
Member Author

Logging the recent work of Cosign experiemental support here:

  • There was a regression for Cosign in nerdctl 1.3.0 and it was fixed in nerdctl 1.3.1 now. Nerdctl 1.3.1 is already merged in Finch.
  • Cosign released 2.0.1 recently, and the key generated by 2.0.1 can't be used to sign in 2.0.0 because of this change. So upgraded the Cosign in Finch to 2.0.1.
  • There were error message change in Cosign 2.0.1. Changed the e2e tests to match it.
  • Noticed keyless verification with Cosign 2.0.0+ is not working in nerdctl (and also Finch). Raised an issue in nerdctl and fixing it. This fix will come later as follow up and won't block the Finch release.

@ningziwen
Copy link
Member Author

About Notation, Nerdctl Notation integration is done. containerd/nerdctl#1974

The major blocker of Finch Notation integration is Docker credential sharing (Issue). Without it, Notation login and logout are required to manage Notation credentials. Providing extra commands in Finch or asking users to log in Finch VM to run it are both not desirable. When the issue is resolved, Notation can share the credentials of Docker/Nerdctl so Finch login/logout can manage it.

Once it is completed, we may consider integrating Notation 1.0 RC as experimental support.

Before Notation 1.0, there is a risk of spec change, implementation change, and other experience gaps like plugin installation(Issue) and local key signing(Issue). So the full support in Finch will be after Notation 1.0.

@weikequ
Copy link
Contributor

weikequ commented Oct 31, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants