-
Notifications
You must be signed in to change notification settings - Fork 890
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
set golang's secure cipher suites as etcd's cipher suites #4253
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #4253 +/- ##
==========================================
- Coverage 52.83% 52.79% -0.04%
==========================================
Files 240 240
Lines 23595 23620 +25
==========================================
+ Hits 12466 12470 +4
- Misses 10453 10471 +18
- Partials 676 679 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I guess the CLI part also needs this. |
You are absolutely right! I'll add this part in this pr later. |
I have some suggestions #4191 (comment) @zhzhuang-zju |
be037c5
to
1742a8f
Compare
@@ -82,6 +82,7 @@ spec: | |||
- --trusted-ca-file=/etc/karmada/pki/etcd-ca.crt | |||
- --data-dir=/var/lib/etcd | |||
- --snapshot-count=10000 | |||
- --cipher-suites=TLS_RSA_WITH_AES_128_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_128_GCM_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384,TLS_AES_128_GCM_SHA256,TLS_AES_256_GCM_SHA384,TLS_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256,TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great to have a comment to describe where these suites come from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great to have a comment to describe where these suites come from.
+1
Other parts, lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Referring to go/src/crypto/tls/cipher_suites.go, golang supports 17 security algorithms.
On this basis, k8s adds map mapping to two of the security algorithms. Finally, these 19 cipher suites were formed.
karmada/vendor/k8s.io/component-base/cli/flag/ciphersuites_flag.go
Lines 33 to 44 in 98e655f
func init() { | |
for _, suite := range tls.CipherSuites() { | |
ciphers[suite.Name] = suite.ID | |
} | |
// keep legacy names for backward compatibility | |
ciphers["TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"] = tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 | |
ciphers["TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305"] = tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 | |
for _, suite := range tls.InsecureCipherSuites() { | |
insecureCiphers[suite.Name] = suite.ID | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean comment in the code, so that when people read the code they can get where these cipher suites come from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it~, I'll comment in the code right away
3914017
to
6c7d34f
Compare
Signed-off-by: zhzhuang-zju <[email protected]>
6c7d34f
to
9b1e18b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
@yanfeng1992 would you like to take another look?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
@@ -44,7 +44,8 @@ spec: | |||
- --key-file=/etc/karmada/pki/etcd/etcd-server.key | |||
- --data-dir=/var/lib/etcd | |||
- --snapshot-count=10000 | |||
- --log-level=debug | |||
- --log-level=debug= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does add = here have any effect? @zhzhuang-zju
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for finding this problem. I fixed it in PR #4286 . Can you help with review?
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
set golang's default secure cipher suites as etcd's cipher suites to fix CVE-2016-2183.
Which issue(s) this PR fixes:
Parts of #4191
Special notes for your reviewer:
none
Does this PR introduce a user-facing change?: