Skip to content

Conversation

@jiparis
Copy link
Member

@jiparis jiparis commented May 31, 2024

This PR uses the service exposed in #861 and enables keyless signing in the CLI.

If a --key option is not provided, the CLI will create a ephemeral certificate signing request, and send it to the chainloop service to be signed by the configured CA, returning back a full certificate chain for signing. This is the standard flow for PKI keyless signatures.

This should be considered experimental, since currently the public key is discarded, and verification is not yet complete.

Refs #865

jiparis added 6 commits May 31, 2024 09:37
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis requested a review from migmartri June 3, 2024 07:35
jiparis added 7 commits June 3, 2024 12:44
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>

# Conflicts:
#	app/controlplane/api/controlplane/v1/signing.pb.go
#	app/controlplane/api/controlplane/v1/signing.proto
#	app/controlplane/api/controlplane/v1/signing_grpc.pb.go
#	app/controlplane/api/gen/frontend/controlplane/v1/signing.ts
#	app/controlplane/cmd/main.go
#	app/controlplane/cmd/wire_gen.go
#	app/controlplane/internal/biz/signing.go
#	app/controlplane/internal/biz/signing_test.go
#	app/controlplane/internal/conf/conf.pb.go
#	app/controlplane/internal/conf/conf.proto
#	app/controlplane/internal/service/signing.go
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis requested a review from migmartri June 3, 2024 17:52
jiparis added 2 commits June 3, 2024 19:54
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis requested a review from javirln June 3, 2024 18:00
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Copy link
Member

@migmartri migmartri left a comment

Choose a reason for hiding this comment

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

Much better although I am not completely sold on the way signer became a bag of things for all signer types.

To me, it would make more sense to have

signer.go
chainloop/
  chainloop.go
cosign/
  cosign.go

and each one of those two will implement the sigstore interface, and will have their own initialization and auxiliary helpers (load pass from terminal, create CSR, ...)

then signer.go can be the one that just picks one or the other if you want.

In any case, that's how I'd do it to simplify testing but I do not think we need to do it in this patch, so I am approving it.

Thanks!


var _ sigstoresigner.Signer = (*ChainloopSigner)(nil)

func NewChainloopSigner(keyPath string, sc pb.SigningServiceClient, logger zerolog.Logger) *ChainloopSigner {
Copy link
Member

Choose a reason for hiding this comment

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

since it supports both, we might want to indicate how this works, meaning that they key is optional and will use keyless in that case.

// See the License for the specific language governing permissions and
// limitations under the License.

package signer
Copy link
Member

Choose a reason for hiding this comment

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

not necessarily for this patch, but don't forget to add tests for this package.

jiparis added 6 commits June 4, 2024 09:58
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis merged commit 65be1d6 into chainloop-dev:main Jun 4, 2024
@jiparis jiparis deleted the feat-plat-633-4 branch June 4, 2024 09:50
)

// GetSigner creates a new Signer based on input parameters
func GetSigner(keyPath string, logger zerolog.Logger, client pb.SigningServiceClient) sigstoresigner.Signer {
Copy link
Member

Choose a reason for hiding this comment

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

yes yes, nice :)

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

Successfully merging this pull request may close these issues.

2 participants