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

[TEP-0102] HTTPS Connection to Triggers ClusterInterceptor #662

Merged
merged 2 commits into from
Apr 8, 2022

Conversation

savitaashture
Copy link
Contributor

Issue: tektoncd/triggers#871

As part of this TEP proposing to make default secure connection between ClusterInterceptor and EventListener.

@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 21, 2022
@savitaashture
Copy link
Contributor Author

/assign @dibyom @khrm

@savitaashture
Copy link
Contributor Author

/kind tep

@tekton-robot tekton-robot added the kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). label Mar 21, 2022
* No inputs required from user to run ClusterInterceptor server as `HTTPS` as everything is handled internally by Triggers.

## Implementation Details
At high level below are few implementation details
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we also require changes in interceptor SDK so that custom interceptor can also be used in tls mode only.
So this work should start after tektoncd/triggers#1312

Copy link
Member

Choose a reason for hiding this comment

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

Good catch but I don't think we need to block on it. I can rebase that PR/update it to use TLS once the implementation for this is done.

At high level below are few implementation details
* Port and ENV changes in [core-interceptors-deployment.yaml](https://github.com/tektoncd/triggers/blob/main/config/interceptors/core-interceptors-deployment.yaml).
* Add new secret file to [config/interceptors](https://github.com/tektoncd/triggers/tree/main/config/interceptors) folder.
* Update roles, clusterroles.
Copy link
Member

Choose a reason for hiding this comment

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

what will be the changes? the Cluster role for interceptor would need secret access to write that specific secret?

* Add new secret file to [config/interceptors](https://github.com/tektoncd/triggers/tree/main/config/interceptors) folder.
* Update roles, clusterroles.
* Changes to ClusterInterceptor server to run as `HTTPS`.
* Changes to EventListener in order to connect with ClusterInterceptor securely.
Copy link
Member

Choose a reason for hiding this comment

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

How will the EventListener find the cacert? In admission controllers, the WebhookConfiguration CR has (I think) a cacert field? Do we need to add something similar to the ClusterInterceptor CRD?

* Changes to EventListener in order to connect with ClusterInterceptor securely.

## A look into the future
* Providing a way to user to pass their own certificate to run ClusterInterceptor server.
Copy link
Member

Choose a reason for hiding this comment

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

If we add a caCert or something similar to the ClusterInterceptor CRD, this might be as simple as a user filling out this field. If it is missing, and the knative/pkg cert controller can generate the cert

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

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

Overall looks the proposal looks good to me. +1 to doing the secure by default approach.

Just had one question on how to surface the caCert field easily.

@tekton-robot tekton-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 24, 2022
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 4, 2022
@savitaashture
Copy link
Contributor Author

Overall looks the proposal looks good to me. +1 to doing the secure by default approach.

@dibyom addressed review comments

Just had one question on how to surface the caCert field easily.

I like the way we do it for WebhookConfiguration today
I have included under A look into the future

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, vdemeester

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

The pull request process is described here

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

@dibyom
Copy link
Member

dibyom commented Apr 8, 2022

I like the way we do it for WebhookConfiguration today
I have included under A look into the future

Great, could we open a GH issue to track this feature?

I have one small comment on moving some text to the Motivation section instead. I think that can also be done in a new PR where we change the status to implementable given that we already have tektoncd/triggers#1333 open

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 8, 2022

### User Stories

* ClusterInterceptor calls are done using `HTTP` instead of `HTTPS` which is considered a security problem because
Copy link
Member

Choose a reason for hiding this comment

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

I'd say this makes more sense in the Motivation section than in the User Stories section :)

@tekton-robot tekton-robot merged commit 59f1bcc into tektoncd:main Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/tep Categorizes issue or PR as related to a TEP (or needs a TEP). lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
Status: @ dibyom
Development

Successfully merging this pull request may close these issues.

5 participants