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

eliminate insecureSkipTLSVerify=true in karmada #4024

Closed
5 tasks done
chaosi-zju opened this issue Sep 4, 2023 · 5 comments
Closed
5 tasks done

eliminate insecureSkipTLSVerify=true in karmada #4024

chaosi-zju opened this issue Sep 4, 2023 · 5 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@chaosi-zju
Copy link
Member

chaosi-zju commented Sep 4, 2023

What would you like to be added:

insecureSkipTLSVerify=true means prohibit clientside from verifing the cert of serverside, this is an unsafe configuration, we can avoid unnecessary unsafe configurations.

Why is this needed:

avoid unnecessary unsafe configurations.

@chaosi-zju chaosi-zju added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 4, 2023
@chaosi-zju
Copy link
Member Author

/assign

@RainbowMango
Copy link
Member

remove insecureSkipTLSVerify in karmadactl register. (just one line, can not be deleted)

I guess you mean this piece of code:
https://github.com/karmada-io/karmada/blob/f2c7d0b80614816879d9fe734b334602ac9850f5/pkg/karmadactl/register/register.go#L839C6-L839C6

Why can not be removed?

@chaosi-zju
Copy link
Member Author

chaosi-zju commented Oct 28, 2023

@RainbowMango yes, is this line:

// buildInsecureBootstrapKubeConfig makes a kubeconfig object that connects insecurely to the API Server for bootstrapping purposes
func buildInsecureBootstrapKubeConfig(endpoint, clustername string) *clientcmdapi.Config {
controlPlaneEndpoint := fmt.Sprintf("https://%s", endpoint)
bootstrapConfig := CreateBasic(controlPlaneEndpoint, clustername, BootstrapUserName, []byte{})
bootstrapConfig.Clusters[clustername].InsecureSkipTLSVerify = true
return bootstrapConfig
}
// buildSecureBootstrapKubeConfig makes a kubeconfig object that connects securely to the API Server for bootstrapping purposes (validating with the specified CA)
func buildSecureBootstrapKubeConfig(endpoint string, caCert []byte, clustername string) *clientcmdapi.Config {
controlPlaneEndpoint := fmt.Sprintf("https://%s", endpoint)
bootstrapConfig := CreateBasic(controlPlaneEndpoint, clustername, BootstrapUserName, caCert)
return bootstrapConfig
}

The corresponding code are building kubeconfig for member cluster to access Karmada, including:

1、member cluster use token to get CA from karmada-apiserver (one-way authentication, a token and InsecureSkipTLSVerify flag in temporary kubeconfig is needed).

2、member cluster use Bootstrap Token to access karmada-apiserver to apply for assignment of certificate (two-way authentication, Bootstrap Token and CA in temporary kubeconfig is needed).

3、 write certificate and CA into kubeconfig, then member cluster can access karmada-apiserver by this kubeconfig in following requests.

if remove bootstrapConfig.Clusters[clustername].InsecureSkipTLSVerify = true this line, then above step 1 will failed.

@RainbowMango
Copy link
Member

RainbowMango commented Oct 28, 2023

Thanks for the clarification.
/close
as all tasks have been resolved.

@karmada-bot
Copy link
Collaborator

@RainbowMango: Closing this issue.

In response to this:

Thanks for the clarification.
/close
as all tasks has been resolved.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants