Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD tls cipher suites support #6024

Merged

Conversation

liupeng0518
Copy link
Member

What type of PR is this?
/kind feature

What this PR does / why we need it:
Sometimes for security reasons, We need to add tls cipher suites and tls min version.
Which issue(s) this PR fixes:

add tls cipher suites

add tls min version

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

# tls min version: Possible values: VersionTLS10, VersionTLS11, VersionTLS12, VersionTLS13
# tls_min_version: ""

# tls cipher suites
# tls_cipher_suites: {}
# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
# - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
# - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
# - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
# - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
# - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
# - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA
# - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
# - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
# - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
# - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
# - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
# - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
# - TLS_ECDHE_RSA_WITH_RC4_128_SHA
# - TLS_RSA_WITH_3DES_EDE_CBC_SHA
# - TLS_RSA_WITH_AES_128_CBC_SHA
# - TLS_RSA_WITH_AES_128_CBC_SHA256
# - TLS_RSA_WITH_AES_128_GCM_SHA256
# - TLS_RSA_WITH_AES_256_CBC_SHA
# - TLS_RSA_WITH_AES_256_GCM_SHA384
# - TLS_RSA_WITH_RC4_128_SHA

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 26, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @liupeng0518. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 26, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 26, 2020
@woopstar
Copy link
Member

As we are a production-ready cluster, we should default these settings to secure values. At least for TLS 1.2

@Miouge1
Copy link
Contributor

Miouge1 commented Apr 27, 2020

@woopstar from what I see in the current PR, if undefined (which it is by default) it uses whatever kubeadm says, hopefully that's a secure default?

@liupeng0518 you need to fix a couple of yaml issues:

$ yamllint --strict .
 ./inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml
   264:1     warning  comment not indented like content  (comments-indentation)
 ./roles/kubernetes/master/defaults/main/main.yml
   170:1     warning  comment not indented like content  (comments-indentation)

@floryut
Copy link
Member

floryut commented Apr 27, 2020

Tls 1.2 by default

func DefaultTLSVersion() uint16 {
	// Can't use SSLv3 because of POODLE and BEAST
	// Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher
	// Can't use TLSv1.1 because of RC4 cipher usage
	return tls.VersionTLS12
}

@woopstar
Copy link
Member

Then it's ok with me :)

@liupeng0518
Copy link
Member Author

@woopstar from what I see in the current PR, if undefined (which it is by default) it uses whatever kubeadm says, hopefully that's a secure default?

@liupeng0518 you need to fix a couple of yaml issues:

$ yamllint --strict .
 ./inventory/sample/group_vars/k8s-cluster/k8s-cluster.yml
   264:1     warning  comment not indented like content  (comments-indentation)
 ./roles/kubernetes/master/defaults/main/main.yml
   170:1     warning  comment not indented like content  (comments-indentation)

OK. Fix it.

@Miouge1
Copy link
Contributor

Miouge1 commented Apr 28, 2020

The crio error in CI is unrelated to this PR. It will be fixed in #6035 so you will need to rebase once #6035 is merged.

@floryut
Copy link
Member

floryut commented Apr 28, 2020

The crio error in CI is unrelated to this PR. It will be fixed in #6035 so you will need to rebase once #6035 is merged.

@liupeng0518 and it's merge, please rebase :)

@Miouge1
Copy link
Contributor

Miouge1 commented Apr 28, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 28, 2020
@liupeng0518 liupeng0518 force-pushed the Add-tls-cipher-suites-support branch from e66cd0a to f8d2d44 Compare April 29, 2020 03:56
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 29, 2020
@woopstar
Copy link
Member

Since both tls_min_version and tls_cipher_suites is never set in any vars for any test, our CI will never test if this actually works.

@liupeng0518 liupeng0518 closed this May 1, 2020
@liupeng0518 liupeng0518 reopened this May 1, 2020
@liupeng0518
Copy link
Member Author

Since both tls_min_version and tls_cipher_suites is never set in any vars for any test, our CI will never test if this actually works.

set default values

@Miouge1
Copy link
Contributor

Miouge1 commented May 1, 2020

I think the previous way was better, and could have been tested with adding the option in one of the tests/files/*.yml

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2020
@floryut
Copy link
Member

floryut commented Jun 9, 2020

@liupeng0518 Can you please rebase ?
Also can you see latest comments, the idea is not to add a default for everyone but only to change one of the test file to ensure everything is OK

yaml lint

yamllint
@liupeng0518 liupeng0518 force-pushed the Add-tls-cipher-suites-support branch from 6f8ef1e to 450b44b Compare June 12, 2020 09:35
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 12, 2020
@k8s-ci-robot
Copy link
Contributor

@liupeng0518: The following commands are available to trigger jobs:

  • /test pull-kubespray-yamllint

Use /test all to run all jobs.

In response to this:

/test ?

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 12, 2020
@liupeng0518 liupeng0518 force-pushed the Add-tls-cipher-suites-support branch from 6353a01 to 71a095d Compare June 13, 2020 01:19
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 13, 2020
@liupeng0518 liupeng0518 force-pushed the Add-tls-cipher-suites-support branch from 71a095d to d88777c Compare June 14, 2020 03:19
@liupeng0518
Copy link
Member Author

@floryut done.

@Miouge1
Copy link
Contributor

Miouge1 commented Jun 16, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liupeng0518, Miouge1

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 16, 2020
@@ -106,6 +106,11 @@ packet_opensuse-canal:
# extends: .packet
# when: on_success

packet_centos7-tls-cipher-suites-check:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing addons CI job would be better suited, we don't have to add a new CI job for every flag

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Miouge1 packet_centos7-flannel-containerd-addons-ha is ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Miouge1 packet_centos7-flannel-containerd-addons-ha is ok?

Yup that would do

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! ❤️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@floryut
Copy link
Member

floryut commented Jun 16, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 16, 2020
@k8s-ci-robot k8s-ci-robot merged commit dba6454 into kubernetes-sigs:master Jun 16, 2020
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 29, 2020
* ADD tls cipher suites support

yaml lint

yamllint

* update test case

* update test case
@floryut floryut mentioned this pull request Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants