IBM Cloud Docs
认证位置端点流量

认证位置端点流量

缺省情况下,所有端点流量都已加密。 但是,您可以选择提供自己的证书以实现源和目标认证。 对于 TLS 或 HTTPS 端点,可能需要在端点请求流中配置两个 TLS 连接。 第一次 TLS 握手是在源和 Satellite Link 服务之间进行的。 第二次 TLS 握手是在 Satellite Link 服务与目的地或目标服务器之间进行的。 您可以为其中一个或两个连接提供证书。

如果不配置任何端点身份验证设置,端点流量仍会被加密,但 Satellite Link 仅充当转接服务。 这甚至适用于使用 TCP 或 HTTP 协议的端点。 对于使用 TLS 或 HTTPS 协议的端点,通过 Satellite Link 的流量默认情况下会尝试使用简单的身份验证,依赖于其众所周知的内置证书,这可能足够,也可能不够。

查看以下认证选项。

Satellite Link服务与目的地之间的简单验证
目标服务器通过 Satellite Link 服务进行身份验证。 要在目的地设置简单身份验证,终端的目的地协议必须是 TLS。 如果目的地的服务器证书不是由知名证书颁发机构签署的,也不是自签名的,则需要配置可信 CA 证书或链,以验证目的地的服务器证书。
使用Satellite Link服务进行简单验证
Satellite Link服务会对源进行身份验证。 要使用 Satellite Link 服务设置简单身份验证,必须将端点的源协议设置为 TLS 或 HTTPS。 然后,证书配置取决于终端的目的地类型。
对于目标类型为“云”的端点,您必须提供服务器证书和密钥,Satellite Link 服务将使用这些证书和密钥与源进行验证。 请注意,如果服务器证书不是由知名签名机构签署,则还必须在源环境中安装 CA 根证书。
对于目标类型为 "location "的端点,您不需要配置任何 Satellite Link 服务证书,因为 Satellite Link 使用由 DigiCert 签名的自己的证书。 DigiCert certificates are 兼容的 with all modern browsers and platforms but if your source has no root CA certificate, you will need to 下载 one from DigiCert and install it in your source environment.
Satellite Link和目的地服务器之间的相互验证
通过相互验证,目的地服务器向 Satellite Link 服务验证自己,而 Satellite Link 服务必须向目的地验证自己。 要在 Satellite Link 服务和目标服务器之间设置相互身份验证,需要配置 Satellite Link 服务身份验证,方法与简单目标身份验证情况相同。 不过,您还需要提供客户端证书和密钥,Satellite Link 服务将使用这些证书和密钥与目的地进行身份验证。
源和Satellite Link服务之间的相互验证
通过相互验证,Satellite Link 服务向源验证自己,而源必须向Satellite Link 服务验证自己。 要在源和 Satellite Link 服务之间设置相互身份验证,必须按照与简单源身份验证相同的方式配置 Satellite Link 服务身份验证。 但是,您还需要配置一个 CA 证书,Satellite Link 服务将使用该证书验证源的客户端证书。
源和Satellite Link服务以及Satellite Link和目的地服务器之间的相互验证
向 Satellite Link 服务和目标服务器发出的请求都要经过验证。 必须先验证两个 TLS 握手,然后才能允许流量。 为此,请创建一个端点,其源协议为 TLS 或 HTTPS,目的协议为 TLS。 然后,如上所述,提供源端和目的地相互验证所需的证书。

如果您选择提供自己的证书以进行端点认证,那么您将负责轮换证书和管理到期日期。 如果证书到期,您可能会迂到中断的流量。

在 CLI 中设置认证

source 选项指的是源和 Satellite Link 服务之间的 TLS 握手。 dest 选项指的是 Satellite Link 服务与目的地或目标服务器之间的 TLS 握手。 您可以为其中一个或两个连接提供证书。 未指定的设置将设置为其缺省值。

ibmcloud sat endpoint authn 命令仅用于为 Satellite Link 服务设置证书,在源端充当服务器,在目的端充当客户端。 您可能还需要在相应的应用环境中为源(客户端)和目标(服务器)配置证书。

查看以下示例方案。

Satellite Link服务与目的地之间的简单身份验证

  1. 创建 HTTPS 端点,连接 HTTPS 服务器。

    ibmcloud sat endpoint create
      --location ID \
      --name myEndpoint \
      --dest-hostname example.com \
      --dest-port 443 \
      --source-protocol HTTPS \
      --dest-type location
    
  2. 使用目标服务器配置简单 TLS。

    此示例提供可信 CA 的证书以验证目标服务器的证书。

    ibmcloud sat endpoint authn set \
      --location ID \
      --endpoint myEndpoint \
      --dest-tls-mode simple \
      --dest-ca-cert-file /path/to/serverCACerts.pem
    
  3. 在证书到期之前,请通过将现有认证证书替换为新认证证书来轮换这些证书。 只有您指定的证书才会被替换。

    ibmcloud sat endpoint authn rotate \
      --location ID \
      --endpoint myEndpoint \
      --dest-ca-cert-file /path/to/serverCACerts.pem
    

使用Satellite Link服务进行简单验证

大多数配置可以使用 locationcloud 的端点 --dest-type,而本配置不同,它必须使用 --dest-type cloud,因为不支持为位置目标端点设置源证书。

  1. 创建 HTTPS 端点,连接 HTTP 服务器。

    ibmcloud sat endpoint create \
      --location ID \
      --name myEndpoint \
      --dest-hostname example.com \
      --dest-port 80 \
      --dest-protocol TCP \
      --source-protocol HTTPS \
      --dest-type cloud
    
  2. 在源和Satellite Link服务之间配置简单的 TLS。

    此示例为Satellite Link服务提供服务器证书,以便与源进行身份验证。

    ibmcloud sat endpoint authn set \
      --location ID \
      --endpoint myEndpoint \
      --source-tls-mode simple \
      --source-cert-file /path/to/serverCertificate.pem \
      --source-key-file /path/to/serverKey.pem
    
  3. 在证书到期之前,请通过将现有认证证书替换为新认证证书来轮换这些证书。 只有您指定的证书才会被替换。

    ibmcloud sat endpoint authn rotate \
      --location ID \
      --endpoint myEndpoint \
      --source-cert-file /path/to/serverCertificate.pem \
      --source-key-file /path/to/serverKey.pem
    

Satellite Link服务与目的地之间的相互验证

  1. 创建 HTTP 端点,连接 HTTPS 服务器。

    ibmcloud sat endpoint create \
      --location ID \
      --name myEndpoint \
      --dest-hostname example.com \
      --dest-port 443 \
      --dest-protocol TLS \
      --source-protocol HTTP \
      --dest-type location
    
  2. 配置与目标服务器的相互 TLS。

    与简单身份验证示例类似,--dest-ca-cert-file 验证目标服务器的证书。 要进行 TLS 相互握手,需要使用 --dest-cert-file--dest-key-file

    ibmcloud sat endpoint authn set \
      --location ID \
      --endpoint myEndpoint \
      --dest-tls-mode mutual \
      --dest-cert-file /path/to/clientCertificate.pem \
      --dest-key-file /path/to/clientKey.pem \
      --dest-ca-cert-file /path/to/serverCACerts.pem
    
  3. 在证书到期之前,请通过将现有认证证书替换为新认证证书来轮换这些证书。 只有您指定的证书才会被替换。

    ibmcloud sat endpoint authn rotate \
      --location ID \
      --endpoint myEndpoint \
      --dest-cert-file /path/to/clientCertificate.pem \
      --dest-key-file /path/to/clientKey.pem \
      --dest-ca-cert-file /path/to/serverCACerts.pem
    

源和 Satellite Link服务之间的相互验证

大多数配置可以使用 locationcloud 的端点 --dest-type,而本配置不同,它必须使用 --dest-type cloud,因为不支持为位置目标端点设置源证书。

  1. 创建 HTTPS 端点,连接 HTTP 服务器。

    ibmcloud sat endpoint create \
      --location ID \
      --name myEndpoint \
      --dest-hostname example.com \
      --dest-port 80 \
      --dest-protocol TCP \
      --source-protocol HTTPS \
      --dest-type cloud
    
  2. 在源和 Satellite Link 服务之间配置相互 TLS。

    此示例为Satellite Link服务提供了服务器证书,以便与信息源进行身份验证,还提供了受信任 CA 的证书,以验证信息源的客户端证书。

    ibmcloud sat endpoint authn set \
      --location ID \
      --endpoint myEndpoint \
      --source-tls-mode mutual \
      --source-cert-file /path/to/serverCertificate.pem \
      --source-key-file /path/to/serverKey.pem \
      --source-ca-cert-file /path/to/clientCACerts.pem
    
  3. 在证书到期之前,请通过将现有认证证书替换为新认证证书来轮换这些证书。 只有您指定的证书才会被替换。

    ibmcloud sat endpoint authn rotate \
      --location ID \
      --endpoint myEndpoint \
      --source-cert-file /path/to/serverCertificate.pem \
      --source-key-file /path/to/serverKey.pem \
      --source-ca-cert-file /path/to/clientCACerts.pem
    

在源和目标上相互认证

  1. 创建 HTTPS 端点,连接 HTTPS 服务器。

    ibmcloud sat endpoint create \
      --location ID \
      --name myEndpoint \
      --dest-hostname example.com \
      --dest-port 443 \
      --source-protocol HTTPS \
      --dest-type location
    
  2. 配置与源服务器和目标服务器的相互 TLS 认证。

    此示例启用了源和 Satellite Link 服务之间以及 Satellite Link 服务和目标服务器之间的相互验证。

    ibmcloud sat endpoint authn set \
      --location ID \
      --endpoint myEndpoint \
      --source-tls-mode mutual \
      --source-ca-cert-file /path/to/clientCACerts.pem \
      --dest-tls-mode mutual \
      --dest-cert-file /path/to/clientCertificate.pem \
      --dest-key-file /path/to/clientKey.pem \
      --dest-ca-cert-file /path/to/serverCACerts.pem
    
  3. 在证书到期之前,请通过将现有认证证书替换为新认证证书来轮换这些证书。 只有您指定的证书才会被替换。

    ibmcloud sat endpoint authn rotate \
      --location ID \
      --endpoint myEndpoint \
      --source-ca-cert-file /path/to/clientCACerts.pem \
      --dest-cert-file /path/to/clientCertificate.pem \
      --dest-key-file /path/to/clientKey.pem \
      --dest-ca-cert-file /path/to/serverCACerts.pem
    

显示身份验证设置

ibmcloud sat endpoint authn get 命令可用于显示端点已配置的身份验证设置。 例如,可以使用以下命令输出端点 myEndpoint 当前配置的 TLS 模式和证书。

ibmcloud sat endpoint authn get --location ID --endpoint myEndpoint

假设 myEndpoint 的配置 如源和目标相互验证示例 所示,该命令将产生类似下面的输出。

OK

Destination TLS Mode:          mutual
Destination Certificate:       /path/to/clientCertificate.pem
Destination Key:               /path/to/clientKey.pem
Destination CA Certificates:   /path/to/serverCACerts.pem
Source TLS Mode:               mutual
Source Certificate:            -
Source Key:                    -
Source CA Certificates:        /path/to/clientCACerts.pem

移除证书

ibmcloud sat endpoint authn set 命令可用于删除一个或多个现有证书。 设置命令会删除除命令选项中指定的证书以外的所有证书。 例如,以下命令将删除端点 myEndpoint 当前配置的所有证书。

ibmcloud sat endpoint authn set --location ID --endpoint myEndpoint

如果只想删除某些证书,而其他证书则保持不变,请确保传递其他证书当前值的选项。 例如,可使用以下命令删除当前设置的 source 证书,保留 dest 证书不变。

ibmcloud sat endpoint authn set \
  --location ID \
  --endpoint myEndpoint \
  --dest-tls-mode mutual \
  --dest-cert-file /path/to/current/clientCertificate.pem \
  --dest-key-file /path/to/current/clientKey.pem \
  --dest-ca-cert-file /path/to/current/serverCACerts.pem