-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OCP: Add vaiabled support for kubelet_configure_tls_cipher_suites
User can choose which cipher to be used by setting two variable, var_kubelet_tls_cipher_suites_regex, and var_kubelet_tls_cipher_suites Add regex varaible support to yamlfile_value template
- Loading branch information
1 parent
dfad74d
commit c67e7a4
Showing
10 changed files
with
186 additions
and
10 deletions.
There are no files selected for viewing
7 changes: 2 additions & 5 deletions
7
applications/openshift/kubelet/kubelet_configure_tls_cipher_suites/kubernetes/shared.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
--- | ||
# platform = multi_platform_ocp | ||
# {{.var_kubelet_tls_cipher_suites_regex}} we have to put variable array name here for mutilines remediation | ||
apiVersion: machineconfiguration.openshift.io/v1 | ||
kind: KubeletConfig | ||
spec: | ||
kubeletConfig: | ||
tlsCipherSuites: | ||
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | ||
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 | ||
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | ||
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | ||
tlsCipherSuites: [{{.var_kubelet_tls_cipher_suites}}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
applications/openshift/kubelet/kubelet_configure_tls_cipher_suites/tests/tls_cipher.fail.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
# remediation = none | ||
|
||
# Create infra file for CPE to pass | ||
mkdir -p "/etc/kubernetes" | ||
|
||
cat <<EOF > "/etc/kubernetes/kubelet.conf" | ||
kind: KubeletConfiguration | ||
apiVersion: kubelet.config.k8s.io/v1beta1 | ||
authentication: | ||
x509: | ||
clientCAFile: /etc/kubernetes/kubelet-ca.crt | ||
anonymous: | ||
enabled: false | ||
cgroupDriver: systemd | ||
cgroupRoot: / | ||
clusterDNS: | ||
- 10.217.4.10 | ||
clusterDomain: cluster.local | ||
containerLogMaxSize: 50Mi | ||
maxPods: 250 | ||
kubeAPIQPS: 50 | ||
kubeAPIBurst: 100 | ||
rotateCertificates: true | ||
serializeImagePulls: false | ||
staticPodPath: /etc/kubernetes/manifests | ||
systemCgroups: /system.slice | ||
systemReserved: | ||
ephemeral-storage: 1Gi | ||
featureGates: | ||
APIPriorityAndFairness: true | ||
LegacyNodeRoleBehavior: false | ||
NodeDisruptionExclusion: true | ||
RotateKubeletServerCertificate: true | ||
ServiceNodeExclusion: true | ||
SupportPodPidsLimit: true | ||
DownwardAPIHugePages: true | ||
serverTLSBootstrap: true | ||
tlsMinVersion: VersionTLS12 | ||
tlsCipherSuites: | ||
- 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_SHA256 | ||
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | ||
EOF |
46 changes: 46 additions & 0 deletions
46
applications/openshift/kubelet/kubelet_configure_tls_cipher_suites/tests/tls_cipher.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# remediation = none | ||
|
||
# Create infra file for CPE to pass | ||
mkdir -p "/etc/kubernetes" | ||
|
||
cat <<EOF > "/etc/kubernetes/kubelet.conf" | ||
kind: KubeletConfiguration | ||
apiVersion: kubelet.config.k8s.io/v1beta1 | ||
authentication: | ||
x509: | ||
clientCAFile: /etc/kubernetes/kubelet-ca.crt | ||
anonymous: | ||
enabled: false | ||
cgroupDriver: systemd | ||
cgroupRoot: / | ||
clusterDNS: | ||
- 10.217.4.10 | ||
clusterDomain: cluster.local | ||
containerLogMaxSize: 50Mi | ||
maxPods: 250 | ||
kubeAPIQPS: 50 | ||
kubeAPIBurst: 100 | ||
rotateCertificates: true | ||
serializeImagePulls: false | ||
staticPodPath: /etc/kubernetes/manifests | ||
systemCgroups: /system.slice | ||
systemReserved: | ||
ephemeral-storage: 1Gi | ||
featureGates: | ||
APIPriorityAndFairness: true | ||
LegacyNodeRoleBehavior: false | ||
NodeDisruptionExclusion: true | ||
RotateKubeletServerCertificate: true | ||
ServiceNodeExclusion: true | ||
SupportPodPidsLimit: true | ||
DownwardAPIHugePages: true | ||
serverTLSBootstrap: true | ||
tlsMinVersion: VersionTLS12 | ||
tlsCipherSuites: | ||
- 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 | ||
EOF |
46 changes: 46 additions & 0 deletions
46
...s/openshift/kubelet/kubelet_configure_tls_cipher_suites/tests/tls_cipher_diff_seq.pass.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# remediation = none | ||
|
||
# Create infra file for CPE to pass | ||
mkdir -p "/etc/kubernetes" | ||
|
||
cat <<EOF > "/etc/kubernetes/kubelet.conf" | ||
kind: KubeletConfiguration | ||
apiVersion: kubelet.config.k8s.io/v1beta1 | ||
authentication: | ||
x509: | ||
clientCAFile: /etc/kubernetes/kubelet-ca.crt | ||
anonymous: | ||
enabled: false | ||
cgroupDriver: systemd | ||
cgroupRoot: / | ||
clusterDNS: | ||
- 10.217.4.10 | ||
clusterDomain: cluster.local | ||
containerLogMaxSize: 50Mi | ||
maxPods: 250 | ||
kubeAPIQPS: 50 | ||
kubeAPIBurst: 100 | ||
rotateCertificates: true | ||
serializeImagePulls: false | ||
staticPodPath: /etc/kubernetes/manifests | ||
systemCgroups: /system.slice | ||
systemReserved: | ||
ephemeral-storage: 1Gi | ||
featureGates: | ||
APIPriorityAndFairness: true | ||
LegacyNodeRoleBehavior: false | ||
NodeDisruptionExclusion: true | ||
RotateKubeletServerCertificate: true | ||
ServiceNodeExclusion: true | ||
SupportPodPidsLimit: true | ||
DownwardAPIHugePages: true | ||
serverTLSBootstrap: true | ||
tlsMinVersion: VersionTLS12 | ||
tlsCipherSuites: | ||
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 | ||
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 | ||
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 | ||
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 | ||
EOF |
14 changes: 14 additions & 0 deletions
14
applications/openshift/kubelet/var_kubelet_tls_cipher_suites.var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
documentation_complete: true | ||
|
||
title: 'Configure Kubelet use of the Strong Cryptographic Ciphers' | ||
|
||
description: 'Cryptographic Ciphers Available for Kubelet, seperated by comma' | ||
|
||
type: string | ||
|
||
operator: equals | ||
|
||
interactive: false | ||
|
||
options: | ||
default: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" |
14 changes: 14 additions & 0 deletions
14
applications/openshift/kubelet/var_kubelet_tls_cipher_suites_regex.var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
documentation_complete: true | ||
|
||
title: 'Configure Kubelet use of the Strong Cryptographic Ciphers' | ||
|
||
description: 'Cryptographic Ciphers Available for Kubelet' | ||
|
||
type: string | ||
|
||
operator: equals | ||
|
||
interactive: false | ||
|
||
options: | ||
default: "^(TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384|TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384|TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256|TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256)$" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters