Skip to content

add configurable TLS min version and cipher suite support#485

Draft
thejasn wants to merge 9 commits into
openshift:osc-releasefrom
thejasn:thn/midstream/tls-options-config
Draft

add configurable TLS min version and cipher suite support#485
thejasn wants to merge 9 commits into
openshift:osc-releasefrom
thejasn:thn/midstream/tls-options-config

Conversation

@thejasn

@thejasn thejasn commented Jun 11, 2026

Copy link
Copy Markdown

TBD

Downstream cherry pick from confidential-containers#3135

thejasn added 9 commits June 11, 2026 18:47
The startup probe HTTP server was bound to all interfaces, exposing a
plain HTTP endpoint on external node interfaces. Kubelet is the only
intended caller and reaches it via the node loopback.

Bind the server to 127.0.0.1. Since the DaemonSet runs with
hostNetwork: true, the kubelet on the same host can reach 127.0.0.1
directly. Update the startup probe's httpGet host field to match.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit 0592120)
The tlsconfig package introduced in the following commit imports
k8s.io/component-base/cli/flag directly for TLS version and cipher suite
name resolution. Promote the dependency from indirect to direct so go.mod
accurately reflects what the module uses.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit 9f00cd9)
The minimum TLS version and permitted cipher suites are expressed as
strings but crypto/tls requires uint16 constants. Without a central
conversion point each caller would duplicate the parsing logic and the
validation constraints.

Add pkg/util/tlsconfig with ParseTLSOptions to handle this. Two
invariants are enforced: TLS 1.2 is the minimum accepted version, and
cipher suites may not be specified with VersionTLS13 since crypto/tls
does not allow configuring TLS 1.3 suites.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit fe8282c)
CAA hardcodes TLS 1.2 with no cipher suite control, providing no way to
enforce a specific minimum version or restrict the permitted cipher suites
across peer pod connections.

Add MinTLSVersion and CipherSuites fields to TLSConfig and wire them into
GetTLSConfigFor via tlsconfig.ParseTLSOptions. TLS 1.2 is kept as a hard
floor regardless of the requested version. When both fields are empty the
behaviour is identical to before.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit fffbe38)
The agent protocol forwarder runs inside the peer pod VM with no access to
external configuration sources. The only mechanism for delivering
configuration to it is the user-data (apf.json) written by CAA at
VM creation time.

Add MinTLSVersion and CipherSuites to the forwarder Config struct so they
are serialised into apf.json. In NewDaemon, propagate these fields into
the TLSConfig used for the APF TLS listener if not already set by the
caller.

Because user-data is written once at VM boot and the APF loads it
without watching for changes, updates to MinTLSVersion or CipherSuites
only take effect for newly created peer pods. Existing VMs retain their
original settings until the pod is deleted and recreated.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit d0c30d2)
MinTLSVersion and CipherSuites are stored in ServerConfig.TLSConfig. The
daemonConfig written to user-data is constructed separately in CreateVM
and the two were not connected.

Copy MinTLSVersion and CipherSuites from TLSConfig into daemonConfig
before serialising it to apf.json. Without this step these fields would
never be populated for peer pod VMs.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit 8cbb988)
Expose two new flags backed by env vars so the minimum TLS version and
permitted cipher suites can be configured without rebuilding the binary:

  --tls-min-version / TLS_MIN_VERSION      (VersionTLS12 or VersionTLS13)
  --tls-cipher-suites / TLS_CIPHER_SUITES  (comma-separated IANA names)

Warn when --disable-tls or --tls-skip-verify are used, since both
silently weaken security and should be restricted to test environments.

Warn when MinTLSVersion or CipherSuites are set: these values are baked
into peer pod VMs via user-data at creation time, so changes require
deleting and recreating existing peer pods to take effect.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit b43999a)
The webhook server's TLS configuration is fixed at Go defaults with no
way to set the minimum version or restrict cipher suites at runtime.

Add support for TLS_MIN_VERSION and TLS_CIPHER_SUITES env vars. When
set, these are applied to the webhook server's TLS configuration at
startup.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit 5829b8d)
Without an operator, there is no way to configure the minimum TLS
version or permitted cipher suites for peer pod connections or the
webhook server via helm.

Add tlsProfile.minVersion and tlsProfile.cipherSuites to the peerpods
chart values. The configmap template renders these into peer-pods-cm
so the CAA DaemonSet picks them up via envFrom.

Add tlsMinVersion and tlsCipherSuites to the webhook chart values and
render them as TLS_MIN_VERSION and TLS_CIPHER_SUITES env vars on the
manager container. Bump webhook chart version to 0.3.2.

Signed-off-by: Thejas N <thn@redhat.com>
(cherry picked from commit 06b77cd)
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 11, 2026
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 18, 2026
@openshift-ci

openshift-ci Bot commented Jun 18, 2026

Copy link
Copy Markdown

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant