接触 Kubernetes 以来,我经常看到 Kubernetes 在不同的地方使用了证书(Certificate),在 Kubernetes 安装和组件启动参数中也需要配置大量证书相关的参数。但是 Kubernetes 的文档在解释这些证书的工作机制方面做得并不是太好。经过大量的相关阅读和分析工作后,我基本弄清楚了 Kubernetes 中证书的使用方式。在本文中,我将试图以一种比官方文档更容易理解的方式来说明 Kubernetes 中证书相关的工作机制,如果你也存在这方面的疑惑,希望这篇文章对你有所帮助。
其实。。。ssl 证书没啥的,就是加密通讯用的,真正让大家头疼的不是 ssl 证书,而是跟 k8s 放在一块,结合 k8s 产生各种证书绕晕了。
商户进入微信支付【商户平台—>产品中心—>商家转账到零钱】,点击开通进入开通流程。
在一个安全的内网环境中, Kubernetes的各个组件与Master之间可以通过apiserver的非安全端口http://apiserver:8080进行访问。但如果apiserver需要对外提供服务,或者集群中的某些容器也需要访问apiserver以获取集群中的某些信息,则更安全的做法是启用HTTPS安全机制。Kubernetes提供了基于CA签名的双向数字证书认证方式和简单的基于HTTP BASE或TOKEN的认证方式,其中CA证书方式的安全性最高。本节先介绍以CA证书的方式配置Kubernetes集群,要求Master上的kube-apiserver.kube-controller-manager. kube-scheduler进程及各Node上的kubelet, kube-proxy进程进行CA签名双向数字证书安全设置
众所周知 TLS 的作用就是对通讯加密,防止中间人窃听;同时如果证书不信任的话根本就无法与 apiserver建立连接,更不用提有没有权限向 apiserver 请求指定内容。在开启了 TLS 的集群中,每当与集群交互的时候少不了的是身份认证,使用 kubeconfig(即证书) 和 token 两种认证方式是最简单也最通用的认证方式。
本文试图以一种比官方文档更容易理解的方式来说明 Kubernetes 和证书(Certificate)相关的工作机制,如果你也存在这方面的疑惑,希望这篇文章对你有所帮助。
官方解释:“商户证书”是指由商户申请的,包含商户的商户号、公司名称、公钥信息的证书。 新接入商户请参考什么是API证书?如何获取API证书?。 我的解释:服务商在微信支付->账户中心->API安全->API证书中申请的证书,就是商户证书。其实也是在微信支付平台申请的,但是不叫微信平台证书(大概因为这个证书是由商户保管把,而微信只是提供了一个入口供我们去申请下载)我真的是很想教写文档的好好做人。
serving 证书: --tls-cert-file和--tls-private-key-file,API server用这两个选项来认证连接到自己的TLS。这两个证书也是CA(可以是自签CA)签署的。由于客户端节点可能会拒绝自签CA,因此需要将该CA分发给客户端节点,并在客户端指定该CA。如下kubelet的kubeconfig中的certificate-authority就指定了用于认证tls证书的CA。--tls-cert-file中需要有server字段的名称。API server和kubelet(当需要认证到kubelet的请求时)都有这两个选项,工作原理一样。 current-context: my-context apiVersion: v1 clusters: - cluster: certificate-authority: /path/to/my/ca.crt # CERTIFICATE AUTHORITY THAT ISSUED YOUR TLS CERT server: https://horse.org:4443 # this name needs to be on the certificate in --tls-cert-file name: my-cluster kind: Config users: - name: green-user user: client-certificate: path/to/my/client/cert client-key: path/to/my/client/key
背景 最近有网友反馈腾讯云 API Explorer工具,通过API上传证书(https://console.cloud.tencent.com/api/explorer?Product=ssl&Ve
Kubernetes需要PKI证书才能通过TLS进行身份验证。如果使用kubeadm安装Kubernetes,则会自动生成集群所需的证书。还可以生成自己的证书,例如,通过不将私钥存储在API服务器上来保持私钥更安全。 当然,我们目前是在手动安装嘛。
用户在访问Kubernetes集群的API server时,访问请求需要经过身份验证、授权和准入控制这三个阶段的检查,才能真正到达API服务,如下图所示:
2018年3月8日,微信支付商户平台发布公告:微信支付HTTPS服务器计划于2018年5月29日更换服务器证书。这则公告对使用沃通SSL证书的商户没有任何影响,不需要更换SSL证书。
首先是觉得在 Service 文件里面引用环境变量的方式似乎没有什么特别的好处。因此丢弃了环境变量文件,直接把参数写入了 Service 文件。
证书一般是由CA权威机构颁发,一般包含了网站与公钥的信息,用于创建HTTPS加密连接
Docker是一种容器化技术,可通过容器化技术提供的API进行访问和管理。您可以通过配置Docker API来开启对Docker API的访问,并使用双向证书验证确保通信的安全性。以下是配置Docker API以开启访问和双向证书验证的步骤:
笔者最初接触 kubernetes 时使用的是 v1.4 版本,集群间的通信仅使用 8080 端口,认证与鉴权机制还未得到完善,到后来开始使用 static token 作为认证机制,直到 v1.6 时才开始使用 TLS 认证。随着社区的发展,kubernetes 的认证与鉴权机制已经越来越完善,新版本已经全面趋于 TLS + RBAC 配置,但其认证与鉴权机制也极其复杂,本文将会带你一步步了解。
所有的系统都存在访问和使用其的用户,Kubernetes也一样,在Kubernetes集群中有存在两类用户:
银联支付 之前做过一次银联支付的配置工作,然而第二次配置,虽然有点印象,但最终还是翻查了半天资料和代码,才完成了配置。这里对银联支付所需做一个简单的整理说明,以便后期查阅,同时分享给大家。 至于如何申请账号,那是公司层面的操作,这里我不清楚,也不做相关的介绍了,我只清楚拿到账号之后的操作。 申请成功以后你会拿到以下四个文件,按照文档流程生成相应的证书即可: License.doc 附件1:生产证书下载、导出及上传流程.docx 附件2:自助化入网测试平台说明书.doc 附件3:云闪付业务商户入网服务指引.
在上一篇文章一文带你彻底厘清 Kubernetes 中的证书工作机制中,我们介绍了 Kubernetes 中证书的工作机制。在这篇文章中,我们继续探讨 Istio 是如何使用证书来实现网格中服务的身份认证和安全通信的。
本文我们将了解如何将一个新的 DNS 名称或者 IP 地址添加到 Kubernetes APIServer 使用的 TLS 证书中。在某些情况下默认的证书包含的名称可能不能满足我们的要求,又或者是 APIServer 地址有所变化,都需要重新更新证书。
Kubernetes通过一系列机制来实现集群的安全控制,其中包括API Server的认证授权、准入控制机制及保护敏感信息的Secret机制等。集群的安全性主要有如下目标:
之前做过一次银联支付的配置工作,然而第二次配置,虽然有点印象,但最终还是翻查了半天资料和代码,才完成了配置。这里对银联支付所需做一个简单的整理说明,以便后期查阅,同时分享给大家。
在 Kube-apiserver 中提供了很多认证方式,其中最常用的就是 TLS 认证,当然也有 BootstrapToken,BasicAuth 认证等,只要有一个认证通过,那么 Kube-apiserver 即认为认证通过。下面就主要讲解 TLS 认证。
使用 kubeadm 安装 kubernetes 集群非常方便,但是也有一个比较烦人的问题就是默认的证书有效期只有一年时间,所以需要考虑证书升级的问题,本文的演示集群版本为 v1.16.2 版本,不保证下面的操作对其他版本也适用,在操作之前一定要先对证书目录进行备份,防止操作错误进行回滚。本文主要介绍两种方式来更新集群证书。
在 K8s 中,kube-apiserver 使用 etcd 对 REST object 资源进行持久化存储,本文介绍如何配置生成自签 https 证书,搭建 etcd 集群给 apiserver 使用,并附相关坑点记录。
我一直使用的都是Let's Encrypt免费的证书,昨天看到群里的大佬发出了一个测试的证书申请的脚本命令,我才接触到acme.sh,于是我查阅了很多大佬的博文了解这个脚本的使用方法。acme.sh功能非常强大,自动安装证书,支持广泛的环境和场景的部署。
Ø MCHID:指的是微信支付商户号,可以登录微信支付商户后台(pay.weixin.qq.com),在【账户设置->账户信息】中查看
只是使用商户号的支付功能可以不配置 API 证书,因为 API 证书只有在一些敏感操作中才用到。比如: 企业付款到零钱、公众号中的现金红包、商户号订单退款,也可以理解为商户号往外出钱的操作
作者赵化冰,腾讯云高级工程师,Istio Member,ServiceMesher管理委员,热衷于开源、网络和云计算。目前主要从事服务网格的开源和研发工作。 目录 Istio 安全架构 控制面证书签发流程 为什么要通过 Pilot-agent 中转? 控制面身份认证 SDS 工作原理 网格边车证书配置 Gateway 证书配置 数据面使用的所有证书 小结 参考文档 在这篇文章中,我们将探讨 Istio 是如何使用证书来实现网格中服务的身份认证和安全通信的。 本文是对 Istio 认证工作机制的深度分
user证书是以"-----BEGIN CERTIFICATE-----“和”-----BEGIN EC PRIVATE KEY-----“开头,ca证书只有”-----BEGIN CERTIFICATE-----",没有"-----BEGIN EC PRIVATE KEY-----"
要使用证书进行身份验证, CA 必须向账号颁发一个包含允许域身份验证的 EKU OID 的证书(例如客户端身份验证)。
要深入了解证书的作用,首先需要了解一些原理和具备一些基本知识,比如什么是非对称加密,什么是公钥,私钥,数字签名是啥等。先从RSA算法说起。
程振东,腾讯高级工程师,腾讯云TKE后台研发,负责TKE Edge的功能开发,SuperEdge核心开发成员,lite-apiserver的主要作者之一。 引言 在 SuperEdge 0.2.0版本中,lite-apiserver 进行了重大的架构升级和功能增强。本文将从 lite-apiserver 实现及其与其它 SuperEdge 组件协同的角度,分析 SuperEdge 的边缘自治能力,给大家的研究和选型提供参考。 边缘节点自治 在云边协同的边缘计算场景中,边缘节点通过公网与云端连接。边缘节点
Let's Encrypt是一个证书颁发机构(CA),它为传输层安全性(TLS)加密供免费证书。它提供了一个名为Certbot的软件客户端,它简化了证书创建,验证,签名,安装和续订的过程。
细节参见官方文档:https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping/
节点kubelet的公钥与私钥:是通过boostrap响应的方式,在启动kubelet自动会产生, 然后在master通过csr请求,就会产生。 那么知道这些基本概念之后,下面就开始创建证书的步骤说明。 再次之前可以先看看生成之后的结果图:
不用代理,SRS就可以提供HTTPS API。不用代理,SRS就可以调用HTTPS Callback。不用代理,SRS就可以提供HTTPS FLV。不用代理,SRS就可以支持WebRTC推流(需要HTTPS API)。不用代理,SRS就可以支持HTTPS HLS。 HTTPS FLV和HLS SRS4之前只提供HTTP FLV和HLS,可以使用go-oryx作为HTTPS代理,将HTTP FLV和HLS转成HTTPS FLV和HLS提供服务。 SRS4只需要配置一下,就可以支持HTTPS FLV和HLS了
Kubernetes 作为一个分布式集群的管理工具,保证集群的安全性是其一个重要的任务。API Server 是集群内部各个组件通信的中介,也是外部控制的入口。所以 Kubernetes 的安全机制基本就是围绕保护 API Server 来设计的,Kubernetes 使用了认证(Authentication)、鉴权(Authorization)、准入控制(AdmissionControl)三步来保证API Server的安全 。
k8s 除了需要 ssl 证书认证之外,还创建了一套鉴权机制。常用的 RBAC 鉴权通过在 ssl 证书中指定 CN 用户名以及 O
Kubernetes系统的各个组件需要使用TLS证书对其通信加密以及授权认证,建议在部署之前先生成相关的TLS证书。
在Java 中的微信支付(1):API V3 版本签名详解一文中胖哥讲解了微信支付 V3 版本 API 的签名,当我方(你自己的服务器)请求微信支付服务器时需要根据我方的API 证书对参数进行加签,微信服务器会根据我方签名验签以确定请求来自我方服务器。那么同样的道理我方的服务器也要对微信支付服务器的响应进行鉴别来确定响应真的来自微信支付服务器,这就是验签。验签使用的是【微信支付平台证书公钥】,不是商户 API 证书。使用商户 API 证书是验证不过的。今天就来分享一下如何获得微信平台公钥和动态刷新微信平台公钥。
这是一个系列文章,将会通过七篇内容和大家一起聊聊 Kubernetes 中的证书管理。
利用 Gateway API 作为你可信赖的盾牌,保护你的 Kubernetes 王国。
最近在折腾微信支付,证书还是比较烦人的,所以有必要分享一些经验,减少你在开发微信支付时的踩坑。目前微信支付的 API 已经发展到V3版本,采用了流行的 Restful 风格。
Let's Encrypt 是一个证书颁发机构(CA),它为传输层安全性(TLS)加密提供免费证书。它提供了一个名为Certbot的软件客户端,它简化了证书创建,验证,签名,安装和续订的过程。
(https://kubernetes.io/zh-cn/docs/reference/access-authn-authz/bootstrap-tokens/)
领取专属 10元无门槛券
手把手带您无忧上云