Skip to content

--sign-by-sigstore infrastructure#1288

Merged
openshift-merge-robot merged 1 commit intocontainers:mainfrom
mtrmac:sign-by-sigstore
Jan 17, 2023
Merged

--sign-by-sigstore infrastructure#1288
openshift-merge-robot merged 1 commit intocontainers:mainfrom
mtrmac:sign-by-sigstore

Conversation

@mtrmac
Copy link
Copy Markdown
Contributor

@mtrmac mtrmac commented Jan 11, 2023

This is infrastructure for Podman supporting something like containers/skopeo#1849 .

RFC . I’m not quite sure how to deal with the inevitable interactivity of Fulcio. Right now Fulcio interactivity is done here in c/common, and passphrase interactivity happens in Podman.

One consistent option would be to move all interactivity to Podman, i.e. to require Podman to provide a finished c/image/signature/signer.Signer (and then, within Podman, would that interactivity be in the top-level CLI, or only in the local engine implementation?).

Another consistent option would be to move all interactivity to c/common, i.e. to implement proper passphrase prompting down here in c/common.

I guess I weakly prefer Podman-side interactivity.

@vrothberg WDYT?

Copy link
Copy Markdown
Member

@vrothberg vrothberg 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 sad fact of life is +135,121

@mtrmac
Copy link
Copy Markdown
Contributor Author

mtrmac commented Jan 12, 2023

One consistent option would be to move all interactivity to Podman, i.e. to require Podman to provide a finished c/image/signature/signer.Signer

Updated that way.

Now we are only +17,106 in c/common — and 15,670 of that is vendor/github.com/rivo/uniseg. (Of course Podman would add the same dependencies again.)

@mtrmac mtrmac changed the title RFC: --sign-by-sigstore infrastructure --sign-by-sigstore infrastructure Jan 12, 2023
@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Jan 12, 2023

The interactivity needs to be done in buildah as well. so I think common makes sense for this.

@mtrmac
Copy link
Copy Markdown
Contributor Author

mtrmac commented Jan 12, 2023

The call stack is Podman CLI → Podman engine abstraction → the non-remote engine → c/common/libimage .

That means pushing the interactivity down to c/common/libimage would require passing stdout/stdin through the Podman engine abstraction, which seems aesthetically ugly to me — admittedly the current approach of passing through a *signer.Signer, which can’t be remoted either, is semantically pretty close.

The worst case is that “interactivity” means “opening a web browser”, with ~no way to control that by parameters (right now). Doing that, without warning, so deep in the call stack really seems unexpected to me.


Also, pushing the interactivity to the top allows creating a Signer (e.g. interacting with the web browser) once, and then using c/common/libimage multiple times. I don’t think we currently do that, but it seems conceptually a more correct organization.


Doing the interactivity at the top level is, I think, not that big a deal, because most of the actual logic is provided by a c/image/cli/sigstore. In Podman, it’s 24 extra lines in https://github.com/containers/podman/pull/17088/files cmd/podman/common/sign.go, and half of that is just cleanup state tracking.

Moving that down here to c/common/libimage would mean that Podman wouldn’t need to do the cleanup state tracking, but it would need to pass down stdin/stdout (and in the future potentially a browser opener) all through the call stack.

@vrothberg
Copy link
Copy Markdown
Member

Right, we should to handle the interactivity in the front end if we can. The code for that could still live somewhere in c/common if there's a considerable amount of boilerplate.

@mtrmac
Copy link
Copy Markdown
Contributor Author

mtrmac commented Jan 14, 2023

This is now vendoring from c/image main, so it can be merged; but waiting until containers/podman#17088 passes tests (or at least does not fail the image push tests) is probably warranted.

@mtrmac mtrmac marked this pull request as ready for review January 14, 2023 12:46
@vrothberg
Copy link
Copy Markdown
Member

containers/podman#17088 isn't passing tests.

This allows using Fulcio and Rekor, without having to pass around 9 options;
and the interactivity required for OIDC authentication is handled by the caller
at some higher level (possibly only once for multiple operations).

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@mtrmac
Copy link
Copy Markdown
Contributor Author

mtrmac commented Jan 17, 2023

The Podman PR is finally (mostly) passing tests.

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Jan 17, 2023

/approve
/lgtm

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jan 17, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mtrmac, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants