TEP-0102: HTTPS Connection to Triggers ClusterInterceptor
October 18, 2023 ยท View on GitHub
- Summary
- Motivation
- Proposal
- Design Details
- Implementation Details
- Implementation Pull Requests
- References
Summary
This TEP proposes to run ClusterInterceptor server as HTTPS and to provide a secure connection between EventListener and ClusterInterceptor.
Motivation
ClusterInterceptor calls are done using HTTP instead of HTTPS which is considered a security problem because
in many environments(like OpenShift Container Platform 4) there is a hard requirement to have all traffic using HTTPS.
so, running ClusterInterceptor server as HTTPS provide a secure connection to eventlistener which helps to Triggers users to handle all connections securely.
Goals
- Running ClusterInterceptor as
HTTPSand making sure a secure connection between Eventlistener and ClusterInterceptor. - No configuration changes asked from user.
Non-Goals
- Requiring configuration changes from end user
Proposal
Triggers now have full support of end to end secure connection by Running ClusterInterceptor as HTTPS.
Triggers uses knative libraries to generate self signed certs in the same way that knative/pkg uses it for admission webhooks.
User Stories
- ClusterInterceptor calls are done using
HTTPinstead ofHTTPSwhich is considered a security problem because in many environments(like OpenShift Container Platform 4) there is a hard requirement to have all traffic usingHTTPS. Meaning all traffic needs to be secured. Since ClusterInterceptor are not offering HTTPS, they can't be used unless they are offering HTTPS. Hence the goal is to make sure that all ClusterInterceptor calls are using HTTPS instead, to comply with security regulation/requirements.
Design Details
- By default ClusterInterceptor server which is part of Triggers run as
HTTPSfor all core interceptors(GitLab, GitHub, BitBucket, CEL) - End user can write their custom interceptor server for both
httpandhttpsand configure usingcaBundleclusterinterceptor spec field
Note:
Support of http for custom interceptor exist for 1-2 releases in order to support backward compatibility.
- Triggers make use of Knative pkg to generate
certandkeyinternally to run ClusterInterceptor server asHTTPS. - While installing
Triggers Interceptoran empty secrettekton-triggers-core-interceptors-certswill be created and later ClusterInterceptor server will update secret withcert,keyandcacert. - Connection between ClusterInterceptor and Eventlistener is secured using
cacertfromtekton-triggers-core-interceptors-certssecret usingcaBundle.
apiVersion: triggers.tekton.dev/v1alpha1
kind: ClusterInterceptor
metadata:
name: github
spec:
clientConfig:
caBundle: <cert data>
service:
name: tekton-triggers-core-interceptors
namespace: tekton-pipelines
path: "github"
where
caBundle contains cacert
-
For core interceptors (GitLab, GitHub, BitBucket, CEL)
caBundlefilled withcacertfromtekton-triggers-core-interceptors-certssecrets by Triggers. -
For custom interceptors
- When user write
httpsClusterInterceptor server its their responsibility to passcaBundlebecause they have control over their server. - when user write
httpClusterInterceptor server no need to pass value tocaBundleand support ofhttpexist for 1-2 release in order to have backward compatibility.
- When user write
Note:
- No inputs required from user to run ClusterInterceptor server as
HTTPSas everything is handled internally by Triggers.
Implementation Details
At high level below are few implementation details
- Port and ENV changes in core-interceptors-deployment.yaml.
- Add new secret file to config/interceptors folder.
- Update clusterroles, clusterrolebinding in order to give permission to interceptor to access/update secrets and update clusterinterceptors.
- Changes to ClusterInterceptor server to run as
HTTPS. - Changes to EventListener in order to connect with ClusterInterceptor securely.
To support secure connection between clusterinterceptor and eventlistener added new field
caBundleto clusterinterceptor spec which contains ca cert and will be used by eventlistener in order to verify clusterinterceptor server.
Implementation Pull Requests
References
- GitHub issue: #871