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

Feature: A way to run the Action as a local service #101

Open
laurentsimon opened this issue Jan 22, 2024 · 2 comments
Open

Feature: A way to run the Action as a local service #101

laurentsimon opened this issue Jan 22, 2024 · 2 comments

Comments

@laurentsimon
Copy link

Package managers (e.g., npm) need to implement sigstore client library to enable provenance for their users. If we could turn the GHA in this repo into a deamon (that users could can add as a step), it would lower the barrier to entry. Package managers could send a REST API to a local address and get the provenance in the response.

Maybe there's another way to do it, but above is the first that comes to mind

@trevrosen
Copy link
Contributor

TBH I'm not 100% what you're asking for here - do you mind clarifying? The Action writes provenance, and GH CLI verifies it. I don't follow turn the GHA in this repo into a daemon (that users could add as a step)

The new gh-attestation CLI extension / command ships the trust root for both GitHub and Sigstore PGI Fulcio instances, so anything constructed on GitHub can be subsequently verified in a fairly high-trust way b/cgh is a static binary. You could imagine package managers potentially shipping this binary to client machines in the future.

To my way of thinking, the larger barrier to entry for registry adoption is getting registries to produce a publish attestation (the way that npm does today) in order to bind the published artifact to the build job that produced it.

@laurentsimon
Copy link
Author

laurentsimon commented Jan 23, 2024

Let me clarify. As a package manager CLI, if you want to support provenance and send it to the registry at publication time, you have 2 options:

  1. Implement a Sigstore client in the language the CLI is written with. For npm, that was sigstore-js
  2. Use a platform-provided feature

(1) is a lot of work and a barrier to entry. (2) seems a better option. A package CLI cannot call a GitHub Action. So there are 2 options for a CLI to take advantage of this Action:

  1. Ask users to split the npm publish (or equivalent for their package manager) into 2 step: cli create-package, then call the Action in this repo, then call cli publish-tarball.
  2. Let users call the GHA to set up a deamon that listens on a local port on the runner. When the daemon receives a request, it signs the artifact. The CLI then just needs to implement a REST API call to 127.0.0.1:port.

(1) does not seem great UX-wise, and may be complicated for certain ecosystems that create multiple files (Maven?).

So I was suggesting option (2). A GitHub Action (or this one with a specific --as-daemon option) that would listen to a local port and crate / sign attestation on demand. Users would add a step to their job before calling cli publish --with-provenance. Ideally this daemon could be enabled without a call to this Action, to further simplify UX.

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