feat(tls): inject centrally managed TLS config into pipelines webhook#3383
Conversation
|
/kind feature |
|
@jkhelil - The env vars for weebhook are different from the ones expected for Results api. The PR injects TLS_MIN_VERSION and TLS_CIPHER_SUITES into the tekton-pipelines-webhook deployment. However, the tekton-pipelines-webhook binary uses the Knative webhook framework (https://github.com/tektoncd/operator/blob/main/vendor/knative.dev/pkg/webhook/webhook.go#L193) which reads WEBHOOK_TLS_MIN_VERSION and WEBHOOK_TLS_CIPHER_SUITES (with WEBHOOK_ prefix). Verified the effect of of injecting the correct variable with following steps: Step 1: Applied this PR changes to openshift cluster and verified the default propagation
Step 2: Port forwarded and attempted to make a client connection to webhook service Step 3: kill the port forward, reduce the deployment replica to 0 so that tektonconfig does not override the env var manually set to deployment and set the new var WEBHOOK_TLS_MIN_VERSION
Step 4: Port forwarded agains and attempted to make a client connection to webhook service (repeated step 2) |
|
|
||
| // Inject APIServer TLS profile env vars into the webhook so that it applies | ||
| // the cluster-wide TLS version and cipher suite policy (PQC readiness). | ||
| if oe.resolvedTLSConfig != nil { |
There was a problem hiding this comment.
webhook's env vars are prefixed with WEBHOOK_. please consider having a prefix based extension for this.
…webhook Wire the OpenShift APIServer TLS profile (TLS_MIN_VERSION, TLS_CIPHER_SUITES, TLS_CURVE_PREFERENCES) into the tekton-pipelines-webhook Deployment to support PQC readiness (SRVKP-9614). Made-with: Cursor
|
fixed now |
|
Thanks @jkhelil. tls 1_2 and 1_3 are correctly accepted and 1_1 is rejected on a Openshift cluster with default profile. Could not evaluate for propagation by patching a hosted cluster. With the core feature working, proceeding to approve. |
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: anithapriyanatarajan The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |




The tekton-pipelines-webhook managed its own TLS configuration locally, preventing Post-Quantum Cryptography (PQC) readiness. Changes to the cluster's APIServer TLS profile had no effect on the webhook.
Solution
Wire the OpenShift APIServer TLS security profile into the webhook deployment via environment variables (WEBHOOK_TLS_MIN_VERSION, WEBHOOK_TLS_CIPHER_SUITES, WEBHOOK_TLS_CURVE_PREFERENCES), and ensure any future profile changes automatically re-reconcile the webhook.
Changes:
openshift/tektonpipeline/extension.go — resolve TLS profile in PreReconcile, inject it via Transformers into the tekton-pipelines-webhook Deployment
openshift/tektonconfig/controller.go — watch APIServer resource; on TLS profile change, re-enqueue TektonConfig
openshift/tektonconfig/extension.go — GetPlatformData() returns a SHA-256 hash of the resolved TLS profile
shared/tektonconfig/tektonconfig.go — stamp the hash as operator.tekton.dev/platform-data-hash on the TektonPipeline CR
shared/tektonconfig/pipeline/pipeline.go — propagate the annotation during CR updates
kubernetes/tektoninstallerset/client/ — include PlatformDataHashKey in the InstallerSet spec hash so manifest re-application is triggered when the TLS profile changes
Feature is opt-in via TektonConfig.spec.platforms.openShift.enableCentralTLSConfig
Evidence
Enabling the feature injects the cluster's TLS profile into the webhook:
Changing the APIServer TLS profile automatically updates the webhook (no operator restart):
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
make test lintbefore submitting a PRSee the contribution guide for more details.
Release Notes