证书管理
更新时间:2022-09-05
1.证书分类
BIE主要有两类证书:
-
节点证书:
- 主要用于云边通道安全认证。在云端创建边缘节点,会为边缘节点签发唯一的节点证书。在边缘节点上执行节点安装命令时,会自动从云端下载该节点的证书,用于建立云边双向认证通道。
- 云端CA是统一的,不同的边缘节点证书,使用的是相同的云端CA。
-
应用证书:
- 主要用于边缘应用间访问认证。在边缘节点上执行节点安装命令时,会自动在边缘节点上动态自签应用CA证书,该CA会为每一个BIE应用(baetyl-edge-system和baetyl-edge两个namespace下的应用)签发应用证书,从而实现服务间无密码访问。
- 节点应用CA是自签的,每一个节点的应用CA都不相同。
2.证书路径
2.1 节点证书
- 节点证书负责云边通讯,因此节点证书只会存在于
baetyl-init
和baetyl-core
两个 系统应用 当中。 - 查看baetyl-core这个pod信息,我们可以看到,node-cert映射到baetyl-core容器内的目录是
/var/lib/baetyl/node
,node-cert对应的是一个Secret资源crt-pd-vm-1-djcyzzzqh
。
$ kubectl describe pod baetyl-core-feliu75bb-64546d5945-rghzj -n baetyl-edge-system
......
Containers:
Mounts:
/etc/baetyl from core-conf (ro)
/var/lib/baetyl/bin from baetyl-program-config-baetyl-core (ro)
/var/lib/baetyl/host from host-root-path (rw)
/var/lib/baetyl/node from node-cert (rw)
/var/lib/baetyl/object from object-download-path (rw)
/var/lib/baetyl/run from native-app-run-path (rw)
/var/lib/baetyl/store from core-store-path (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lw5x2 (ro)
......
Volumes:
node-cert:
Type: Secret (a volume populated by a Secret)
SecretName: crt-pd-vm-1-djcyzzzqh
Optional: false
- 查看
crt-pd-vm-1-djcyzzzqh
这个Secret,可以看到base64编码以后的ca.pem
、client.key
和client.pem
。
$ kubectl get secret crt-pd-vm-1-djcyzzzqh -n baetyl-edge-system -oyaml
apiVersion: v1
data:
ca.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUUxakNDQTc2Z0F3SUJBZ0lJTC9yZnBVWUhrNU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VHNzhZbXNlNEEvU0RRKysKVVZPa3gvRWNHTFIvbEpqbjRIZVlSTm05M2ZKQ2FwK3FiWUE5bksvL0VnYVA3bzk1cGJTUCtQRU5ld0ZmUjVQZApJWDV0ZG02MG1rbz0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
kind: Secret
metadata:
creationTimestamp: "2022-06-14T07:06:21Z"
labels:
baetyl-app-name: baetyl-core-feliu75bb
baetyl-cloud-system: "true"
baetyl-node-name: pd-vm-1
resource-invisible: "true"
secret-type: config
name: crt-pd-vm-1-djcyzzzqh
namespace: baetyl-edge-system
resourceVersion: "29328"
uid: 5e457048-a057-471c-9f09-7d471cf4bd11
type: Opaque
- 访问 https://base64.us/ ,对Secret内容进行base64解码,得到明文的
ca.pem
、client.key
和client.pem
。
ca.pem
-----BEGIN CERTIFICATE-----
MIIE1jCCA76gAwIBAgIIL/rfpUYHk5IwDQYJKoZIhvcNAQELBQAwcDELMAkGA1UE
BhMCQ04xEDAOBgNVBAgMB0JlaUppbmcxEDAOBgNVBAcMB0JlaUppbmcxDjAMBgNV
BAoMBUJhaWR1MREwDwYDVQQLDAhCYWlkdSBDQTEaMBgGA1UEAwwRQmFpZHUgUlNB
IFJvb3QgQ0EwIBcNMjAwNjMwMDczOTMyWhgPMjA3MDA2MTgwNzM5MzJaMG4xCzAJ
BgNVBAYTAkNOMSMwIQYDVQQDDBpvbmxpbmUuaW90ZGV2aWNlLmJhaWR1LmNvbTEO
MAwGA1UECgwFQkFJRFUxDDAKBgNVBAsMA0JDRTEcMBoGCSqGSIb3DQEJARYNaW90
QGJhaWR1LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM1RHpHm
k/LzqMIu6UDpf61payG97YwGuGW+o/hT6djsVa7HVNbhbBXDmsqwLjHFHyUmfELG
qiCwNtXa8ycgiZvuUwaM4fYVcZQvFCUBvKXyUWz7SpweupXNnHtEsV1E86YeMx9v
LcedujnReysO9/dG0hsnbvgbAP0I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kwEwYH
KoZIzj0CAQYIKoZIzj0DAQcDQgAEVoqAg2hyZRVQBlzWVSJGkxvlPf2IPdcXF6Wq
dtLctx2iEGVGAr0s7ZZQWbl9GGyrras69aJp58Agojal4vkwyaOCAWswggFnMB0G
A1UdDgQWBBTuzHwz8TJzZCSLSkBXOU6TXpSa6jAMBgNVHRMBAf8EAjAAMB8GA1Ud
IwQYMBaAFLPrE8QwTwDCp+sVDszYKyd2E2RXMIGjBgNVHR8EgZswgZgwgZWggZKg
gY+GgYxodHRwOi8vcGtpaW92LmJhaWR1YmNlLmNvbS92MS9wa2kvY3JsP2NtZD1j
cmwmZm9ybWF0PVBFTSZpc3N1ZXI9Qz1DTixDTj1vbmxpbmUuaW90ZGV2aWNlLmJh
aWR1LmNvbSxFTUFJTEFERFJFU1M9aW90QGJhaWR1LmNvbSxPPUJBSURVLE9VPUJD
RTBCBggrBgEFBQcBAQQ2MDQwMgYIKwYBBQUHMAGGJmh0dHA6Ly9wa2lpb3YuYmFp
ZHViY2UuY29tL3YxL3BraS9vY3NwMA4GA1UdDwEB/wQEAwID+DAdBgNVHSUEFjAU
BggrBgEFBQcDAgYIKwYBBQUHAwQwDQYJKoZIhvcNAQELBQADggEBAJSNmBNAh0X5
k9dRaAWktcLbxXSKx+O8tLk0ZP7IeT0bMk8yzSMSjwpLeMvqaz4kwUMyokHD48As
CYVSGiIxCAi9YMv8R1EDMrehtu1QiF9MX1KRQy2URyXqLXgGqkuOCedH4Db1/sry
RBdTkM06onM8VEpSDns9xoF1MmQvNWRow+qd2wmzurnLukb/6v5LNz04LYN4RbgJ
nLBD6x7dSbaXv2+dFmn4Unfp2irgl8G5aE4EDZ90XXK62q8beG78Ymse4A/SDQ++
UVOkx/EcGLR/lJjn4HeYRNm93fJCap+qbYA9nK//EgaP7o95pbSP+PENewFfR5Pd
IX5tdm60mko=
-----END CERTIFICATE-----
- 直接进入baetyl-core的pod,访问
/var/lib/baetyl/node
路径,查看ca.pem证书,发现跟上面得到的ca.pem是一样的。
$ kubectl exec -it baetyl-core-feliu75bb-64546d5945-rghzj -n baetyl-edge-system /bin/sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/ # cd /var/lib/baetyl/node/
/var/lib/baetyl/node # ls
ca.pem client.key client.pem
/var/lib/baetyl/node # cat ca.pem
-----BEGIN CERTIFICATE-----
MIIE1jCCA76gAwIBAgIIL/rfpUYHk5IwDQYJKoZIhvcNAQELBQAwcDELMAkGA1UE
BhMCQ04xEDAOBgNVBAgMB0JlaUppbmcxEDAOBgNVBAcMB0JlaUppbmcxDjAMBgNV
BAoMBUJhaWR1MREwDwYDVQQLDAhCYWlkdSBDQTEaMBgGA1UEAwwRQmFpZHUgUlNB
IFJvb3QgQ0EwIBcNMjAwNjMwMDczOTMyWhgPMjA3MDA2MTgwNzM5MzJaMG4xCzAJ
BgNVBAYTAkNOMSMwIQYDVQQDDBpvbmxpbmUuaW90ZGV2aWNlLmJhaWR1LmNvbTEO
MAwGA1UECgwFQkFJRFUxDDAKBgNVBAsMA0JDRTEcMBoGCSqGSIb3DQEJARYNaW90
QGJhaWR1LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM1RHpHm
k/LzqMIu6UDpf61payG97YwGuGW+o/hT6djsVa7HVNbhbBXDmsqwLjHFHyUmfELG
qiCwNtXa8ycgiZvuUwaM4fYVcZQvFCUBvKXyUWz7SpweupXNnHtEsV1E86YeMx9v
LcedujnReysO9/dG0hsnbvgbAP0I2lXOdwJLOtc6/dwzVbwFUUTONw3OdZ80Avpy
gme8gHjvjVa1UwmR9BrSjahadSZkGKSRfDq/Adyrcghfd9WLVVn790OvzZHbwTyF
z9bjikcuf3ZzjkfaJIcnYy0KJlgNJufbRLG0o43/8YtYqdZ2g9/8+LqO0Liwg19v
JFDPd4XnnieXNisCAwEAAaOCAXIwggFuMB0GA1UdDgQWBBSz6xPEME8AwqfrFQ7M
2CsndhNkVzAPB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+VuKYdJoFX+XbQbB+aRG86yx+V0TMJeO5T7d3r2w0f
sGn4XKb5+bUf
-----END CERTIFICATE-----/var/lib/baetyl/node
2.2 应用证书
- 应用证书存在于所有BIE边缘应用当中,即
baetyl-edge-system
命名空间下的系统应用和baetyl-edge
命名空间下的用户应用。 - 下面以baetyl-broker为例进行说明应用证书路径。
- 查看baetyl-broker这个pod信息,我们可以看到有一个Secret资源
baetyl-cert-secret-89fdc95764e99d25fa6050e6cc7c57cd
映射到了baetyl-broker容器内的相对目录var/lib/baetyl/system/certs
,因为工作目录是/
,所以对应的绝对路径是/var/lib/baetyl/system/certs
。业务应用可以直接使用绝对路径/var/lib/baetyl/system/certs
来调用证书。
$ kubectl describe pod baetyl-broker-paefptjz9-6d654fd786-cddjd -n baetyl-edge-system
......
Containers:
Mounts:
/etc/baetyl from broker-conf (ro)
/var/lib/baetyl/bin from baetyl-program-config-baetyl-broker (ro)
/var/lib/baetyl/run from native-app-run-path (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-jwpbw (ro)
var/lib/baetyl/system/certs from baetyl-cert-volume-89fdc95764e99d25fa6050e6cc7c57cd (ro)
......
Volumes:
baetyl-cert-volume-89fdc95764e99d25fa6050e6cc7c57cd:
Type: Secret (a volume populated by a Secret)
SecretName: baetyl-cert-secret-89fdc95764e99d25fa6050e6cc7c57cd
Optional: false
- 查看
baetyl-cert-secret-89fdc95764e99d25fa6050e6cc7c57cd
这个Secret,可以看到base64编码以后的ca.pem
、client.key
和client.pem
。
$ kubectl get secret baetyl-cert-secret-89fdc95764e99d25fa6050e6cc7c57cd -n baetyl-edge-system -oyaml
apiVersion: v1
data:
ca.pem: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUMwekNDQW5tZ0F3SUJBZ0lJRnZocTZZS2VhNFF3Q2dZSUtvWkl6ajBFQXdJd2djWXhDekFKQmdOVkJBWVQKQWtOT01SQXdEZ1lEVlFRSUV3ZENaV2xxYVc1bk1Sa3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Q0FURS0tLS0tCg==
key.pem: LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUtXc3FGL0VNYnFpbVFFODFIWlNMMHIwczFodmZMQ1VBeVBEeHZXN2t0bVRvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFcVBXbVFWNVowTlcvZmRISldVSThiM0djdjYyUUFnaXR5Tk5aOU5SN21UdCsvaERuMmJtSQpDRWFRellpamZOdE5nTDVwUTlTNE1mVnVvUWE2YzRTREF3PT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQo=
kind: Secret
metadata:
creationTimestamp: "2022-06-14T07:07:05Z"
labels:
baetyl-app-name: baetyl-broker-paefptjz9
security-type: certificate
name: baetyl-cert-secret-89fdc95764e99d25fa6050e6cc7c57cd
namespace: baetyl-edge-system
resourceVersion: "29361"
uid: 5364af96-e40b-44e8-8628-e855d7f49ece
type: Opaque
- 访问 https://base64.us/ ,对Secret内容进行base64解码,得到明文的
ca.pem
、crt.pem
和key.pem
。
ca.pem
-----BEGIN CERTIFICATE-----
MIIC0zCCAnmgAwIBAgIIFvhq6YKea4QwCgYIKoZIzj0EAwIwgcYxCzAJBgNVBAYT
AkNOMRAwDgYDVQQIEwdCZWlqaW5nMRkwFwYDVQQHExBIYWlkaWFuIERpc3RyaWN0
MRUwEwYDVQQJEwxCYWlkdSBDYW1wdXMxDzANBgNVBBETBjEwMDA5MzEeMBwGA1UE
ChMVTGludXggRm91bmRhdGlvbiBFZGdlMQ8wDQYDVQQLEwZCQUVUWUwxMTAvBgNV
BAMTKDFjZDJkNzc5MGI2ZjQzNDdiYmViM2VjZWU1NGVjYTZlLnBkLXZtLTEwIBcN
MjIwNjE0MDcwNjU0WhgPMjA3MjA2MDEwNzA2NTRaMIHGMQswCQYDVQQGEwJDTjEQ
MA4GA1UECBMHQmVpamluZzEZMBcGA1UEBxMQSGFpZGlhbiBEaXN0cmljdDEVMBMG
A1UECRMMQmFpZHUgQ2FtcHVzMQ8wDQYDVQQREwYxMDAwOTMxHjAcBgNVBAoTFUxp
bnV4IEZvdW5kYXRpb24gRWRnZTEPMA0GA1UECxMGQkFFVFlMMTEwLwYDVQQDEygx
Y2QyZDc3OTBiNmY0MzQ3YmJlYjNlY2VlNTRlY2E2ZS5wZC12bS0xMFkwEwYHKoZI
zj0CAQYIKoZIzj0DAQcDQgAEPerJVz6I5aThPGWmBjMMSmvg4Rgv8khy+37Vslcv
X1D8shy+qjI3GR4wFtpQc0j3cyCuyO/iM2T2BsfZU9AHdqNNMEswDgYDVR0PAQH/
BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wKAYDVR0RBCEwH4cEAAAAAIcEfwAAAYYR
aHR0cHM6Ly9sb2NhbGhvc3QwCgYIKoZIzj0EAwIDSAAwRQIhAK9Ke1f5E8/bWd5c
vAgoo1pmR+elyD0J7M/3KJJK9F5HAiACzBapC2/ZTgLt2fqr91/SHJ+Vi9/y+n4S
2PWDeEBLFA==
-----END CERTIFICATE-----
- 直接进入baetyl-broker的pod,访问
var/lib/baetyl/system/certs
路径,查看ca.pem证书,发现跟上面得到的ca.pem是一样的。
$ kubectl exec -it baetyl-broker-paefptjz9-6d654fd786-cddjd -n baetyl-edge-system /bin/sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/ # cd /var/lib/baetyl/system/certs/
/var/lib/baetyl/system/certs # ls
ca.pem crt.pem key.pem
/var/lib/baetyl/system/certs # cat ca.pem
-----BEGIN CERTIFICATE-----
MIIC0zCCAnmgAwIBAgIIFvhq6YKea4QwCgYIKoZIzj0EAwIwgcYxCzAJBgNVBAYT
AkNOMRAwDgYDVQQIEwdCZWlqaW5nMRkwFwYDVQQHExBIYWlkaWFuIERpc3RyaWN0
MRUwEwYDVQQJEwxCYWlkdSBDYW1wdXMxDzANBgNVBBETBjEwMDA5MzEeMBwGA1UE
ChMVTGludXggRm91bmRhdGlvbiBFZGdlMQ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