Kubernetes webhook用户客户端证书配置的含义是什么?
我需要为Kubernetes实现一个自定义身份验证和授权模块。这必须通过web钩子来完成 和Webhook的文档描述了API服务器启动时需要使用的配置文件 对于身份验证和授权,配置文件看起来完全相同,如下所示:Kubernetes webhook用户客户端证书配置的含义是什么?,kubernetes,kubernetes-security,Kubernetes,Kubernetes Security,我需要为Kubernetes实现一个自定义身份验证和授权模块。这必须通过web钩子来完成 和Webhook的文档描述了API服务器启动时需要使用的配置文件 对于身份验证和授权,配置文件看起来完全相同,如下所示: # clusters refers to the remote service. clusters: - name: name-of-remote-authn-service cluster: certificate-authority: /path/to/ca.
# clusters refers to the remote service.
clusters:
- name: name-of-remote-authn-service
cluster:
certificate-authority: /path/to/ca.pem # CA for verifying the remote service.
server: https://authn.example.com/authenticate # URL of remote service to query. Must use 'https'.
# users refers to the API server's webhook configuration.
users:
- name: name-of-api-server
user:
client-certificate: /path/to/cert.pem # cert for the webhook plugin to use
client-key: /path/to/key.pem # key matching the cert
# kubeconfig files require a context. Provide one for the API server.
current-context: webhook
contexts:
- context:
cluster: name-of-remote-authn-service
user: name-of-api-sever
name: webhook
我可以看到,clusters
部分提到了远程服务,即它定义了webhook,从而回答了API服务器需要回答的问题:“当需要authn/authz决策时,以及当我通过HTTPS连接时,要命中的URL端点是什么?谁是webhook的TLS证书的CA颁发机构,以便我知道我可以信任远程webhook?”
我不确定用户
部分。客户端证书
和客户端密钥
字段的用途是什么?文件中的注释是“webhook插件使用的证书”,但由于此配置文件是提供给API服务器的,而不是web钩子,我不明白这意味着什么。这是允许webhook服务验证API服务器将与其启动的连接的证书吗?i、 e.客户端证书需要进入webhook服务器的信任库吗
这两个假设都正确吗?Kubernetes webhook正在使用,因此
users
部分中的字段用于配置“客户端身份验证”的证书
clusters
部分配置只是正常工作的单向SSL身份验证,即服务器(这里是您的webhook模块)将使用配置的证书验证客户端(这里是Kubernetes)的请求
只要您在users
部分配置了证书,客户端(Kubernetes)就可以验证服务器(webhook模块)的响应,就像单向SSL的反向CA身份验证一样