-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
session/variable: forbid changing @@global.require_secure_transport to 'on' with SEM enabled #47677
Conversation
…visible when SEM is on
Hi @tiancaiamao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #47677 +/- ##
================================================
- Coverage 71.9282% 69.1164% -2.8119%
================================================
Files 1396 2771 +1375
Lines 404781 945914 +541133
================================================
+ Hits 291152 653782 +362630
- Misses 94027 268296 +174269
- Partials 19602 23836 +4234
Flags with carried forward coverage won't be shown. Click here to find out more.
|
cfg := config.GetGlobalConfig() | ||
if cfg.Security.EnableSEM { | ||
return "", errors.New("require_secure_transport can not be set to ON with SEM(security enhanced mode) enabled") | ||
} | ||
// Refuse to set RequireSecureTransport to ON if the connection | ||
// issuing the change is not secure. This helps reduce the chance of users being locked out. | ||
if vars.TLSConnectionState == nil { |
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.
The current PR is a workaround.
Maybe in a real fix we can make this check stronger? vars.TLSConnectionState can be non-nil even when tls.crt and tls.key are not provided.
If the check become tls.ca && tls.crt && tls.key, maybe things become better?
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.
LGTM
Co-authored-by: bb7133 <[email protected]>
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.
LGTM
I plan to collect 2 LGTMs to ensure this code change is ready. |
However, whether it should be merged into |
/hold |
…o 'on' with SEM enabled pingcap#47677
[LGTM Timeline notifier]Timeline:
|
…o 'on' with SEM enabled pingcap#47677
/unhold |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, CbcWestwolf, easonn7 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 |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <[email protected]>
What problem does this PR solve?
Issue Number: close #47665
Problem Summary:
The configuration for TiDB Cloud dedicated cluster is:
We just provide the
ca.crt
file for the the users to connect the TiDB cluster. Whenrequire_secure_transport = OFF
, there is no problem.But if the user set the value of require_secure_transport to 'ON', the users can not connect to the cluster anymore!
This is because the new configuration require the mysql client to pass all
ca.crt
tls.crt
tls.key
correctly, while the user only have theca.crt
file.What is changed and how it works?
To prevent the user from losing access of the cluster, we can forbid changing
require_secure_transport
system variable to 'on' as a workaround, then the user can not modify it and trigger the issue.Check List
Tests
Modify the config.toml.example:
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.