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

Storage does not validate client certificate #117

Open
slashben opened this issue May 28, 2024 · 6 comments
Open

Storage does not validate client certificate #117

slashben opened this issue May 28, 2024 · 6 comments

Comments

@slashben
Copy link
Contributor

The current implementation does not validate peer TLS certificates and any client can connect it and pull data. It should only be the Kubernetes API server that is allowed to do queries.

@matthyx
Copy link
Contributor

matthyx commented Sep 3, 2024

@slashben do we want to fix that?

@slashben
Copy link
Contributor Author

slashben commented Sep 4, 2024

we must, but it should be fairly simple

@slashben
Copy link
Contributor Author

slashben commented Sep 4, 2024

it should be set up in ClientCA in the SecureServingInfo
see more here
https://pkg.go.dev/k8s.io/apiserver/pkg/server#SecureServingInfo

@matthyx
Copy link
Contributor

matthyx commented Sep 4, 2024

it should be set up in ClientCA in the SecureServingInfo see more here https://pkg.go.dev/k8s.io/apiserver/pkg/server#SecureServingInfo

nice, do we want to add a config entry for that certificate? or should we read it from somewhere in the downward API?

@slashben
Copy link
Contributor Author

slashben commented Sep 4, 2024

Wait, we have two problems here.

One is we need to have the client certificate of the API server (it can be take with kubectl get configmap -n kube-public cluster-info -o jsonpath='{.data.kubeconfig}' | yq | jq .clusters[0].cluster."certificate-authority-data" , I guess we can read it during the helm installation)

The second is that we do not generate server certificate 😞

apiVersion: apiregistration.k8s.io/v1                                                                                                   
kind: APIService                                                                                                                        
metadata:
  spec:                                                                                                                                
    insecureSkipTLSVerify: true

@slashben
Copy link
Contributor Author

slashben commented Sep 4, 2024

@matthyx see my PRs (they were tested locally)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants