Skip to content

One-pager for Package Signing Validation Proposal#3297

Closed
jessesanford wants to merge 1 commit intocrossplane:masterfrom
jessesanford:master
Closed

One-pager for Package Signing Validation Proposal#3297
jessesanford wants to merge 1 commit intocrossplane:masterfrom
jessesanford:master

Conversation

@jessesanford
Copy link
Copy Markdown
Contributor

@jessesanford jessesanford commented Sep 8, 2022

Description of your changes

One Pager for Package Signature Validation
Addresses Issue #3048

Pull Request for implementation: #3552

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

NA

Copy link
Copy Markdown

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

@jessesanford I've added a couple of high level comments.

It's also worth pointing out the similarities between Crossplane & Helm in the context of consuming packages. This work looks to be closely aligned to helm/helm#11496 & helm/helm#10644.

## Goals

- Enable provenance validation of crossplane packages
- Allow the specification of a trusted public key to use for validation
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it reasonable to assume that all components could be validated from a single public key? I'd argue that this should be a per-component configuration, potentially via a selector based policy.

Also is a public key the best MVP solution over a cosign keyless signature identity?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sorry for the delay. Lots of things happening since early November. I would agree that we should consider allowing for keyless. The keyless isn't much harder to do now. There is some prior art in this PR from @developer-guy on flux here: https://github.com/fluxcd/source-controller/pull/876/files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@stevehipwell I believe that we can now do a per-package set of secrets for validation with #3552 let me know what you think.

```
[Link]: https://github.com/crossplane/crossplane/blob/master/internal/controller/pkg/manager/revisioner_test.go#L113-L131

## Alternatives Considered
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could the stated goals be achieved with an external system such as OPA Gatekeeper or Kyverno? These external systems, where used, would be validating the OCI images in the deployments for providers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It might also be possible to utilise Flux's source-controller / OCIRepository in a similar way to what Pulumi are doing in their Kubernetes Operator.

See:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

"Could the stated goals be achieved with an external system such as OPA Gatekeeper or Kyverno? These external systems, where used, would be validating the OCI images in the deployments for providers."

Unfortunately, the image pull operations are done within the crossplane controller, and the image signature can't be verified until the image is pulled. So this all has to be evaluated after "admission". The same applies for config packages and provider packages.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could patterns not be defined for OPA Gatekeeper or Kyverno to validate the image references in the Crossplane resources?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@stevehipwell yes I imagine that we could have them watch for the package install CRDs and deny them if they don't contain valid signature information, but how would we validate the signatures are correct? The evaluation of the signature can only be done once the image has been downloaded. That pull of the image is all internal to the crossplane controllers.

```
[Link]: https://github.com/crossplane/crossplane/blob/b01b17353198a8de28664cf1eec601aaaf2fd95a/internal/xpkg/fetch.go#L119

#### Prior Art For Validation:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Kyverno image verifications documentation could offer some prior art for the configuration of the validation.

Copy link
Copy Markdown
Contributor Author

@jessesanford jessesanford Dec 15, 2022

Choose a reason for hiding this comment

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

The ClusterImagePolicies of sigstore policy-controller are also good reference for how we can surface control of which images to validate https://docs.sigstore.dev/policy-controller/overview/#configuring-policy-controller-clusterimagepolicy , however maybe it makes sense for this policy to be more crossplane centric? IE allowing the policy to be directed at all the fields of the crossplane pkg.crossplane.io/v1 crossplane group types? https://docs.crossplane.io/v1.9/concepts/packages/#installing-a-package

Signed-off-by: Jesse Sanford <jesse.sanford@autodesk.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2023

Crossplane does not currently have enough maintainers to address every issue and pull request. This pull request has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Adding a comment starting with /fresh will mark this PR as not stale.

@github-actions github-actions Bot added the stale label Jun 2, 2023
@jbw976
Copy link
Copy Markdown
Member

jbw976 commented Jun 2, 2023

/fresh

@github-actions github-actions Bot removed the stale label Jun 2, 2023
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 1, 2023

Crossplane does not currently have enough maintainers to address every issue and pull request. This pull request has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Adding a comment starting with /fresh will mark this PR as not stale.

@github-actions github-actions Bot added the stale label Sep 1, 2023
@github-actions github-actions Bot closed this Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants