Skip to content

Commit

Permalink
fix: allow configuring tls-cipher-suites
Browse files Browse the repository at this point in the history
This patch allows you to configure TLS cipher suites for the
API server with a sane set of secure defaults.

Closes #251
  • Loading branch information
mnaser committed Nov 30, 2023
1 parent e30560a commit 09db358
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/user/labels.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,14 @@ is often accomplished by deploying a driver on each node.

Default value: `true`

* `tls_cipher_suites`

Specify the list of TLS cipher suites to use for the Kubernetes API server,
separated by commas. If not specified, the default list of cipher suites
will be used using the [Mozilla SSL Configuration Generator](https://ssl-config.mozilla.org/#server=go&config=intermediate).

Default value: `TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305`

## OIDC

* `oidc_issuer_url`
Expand Down
22 changes: 22 additions & 0 deletions magnum_cluster_api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,6 +780,13 @@ def get_object(self) -> objects.ClusterClass:
},
},
},
{
"name": "apiServerTLSCipherSuites",
"required": True,
"schema": {
"type": "string",
}
},
{
"name": "openidConnect",
"required": True,
Expand Down Expand Up @@ -1552,6 +1559,13 @@ def get_object(self) -> objects.ClusterClass:
},
},
"jsonPatches": [
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/clusterConfiguration/apiServer/extraArgs/tls-cipher-suites", # noqa: E501
"valueFrom": {
"variable": "apiServerTLSCipherSuites",
},
},
{
"op": "add",
"path": "/spec/template/spec/kubeadmConfigSpec/files/-",
Expand Down Expand Up @@ -1833,6 +1847,14 @@ def get_object(self) -> objects.Cluster:
"enabled": self.cluster.master_lb_enabled,
},
},
{
"name": "apiServerTLSCipherSuites",
"value": utils.get_cluster_label(
self.cluster,
"tls_cipher_suites",
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", # noqa: E501
),
},
{
"name": "openidConnect",
"value": {
Expand Down

0 comments on commit 09db358

Please sign in to comment.