UiPath Documentation
automation-suite
2.2510
true
EKS/AKS 上的 Automation Suite 安装指南
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

将 HashiCorp 保险库配置为密码存储

在 EKS/AKS 上将 HashiCorp 保险库配置为 Automation Suite 的密码存储。

您可以使用以下任一身份验证方法将 HashiCorp 保险库配置为密码存储:

  • Kubernetes Auth
  • 应用角色身份验证

HashiCorp 保险库提供了用于存储密码的 KV(键值)密码引擎。

默认情况下,所有敏感数据都在input.json中定义。您可以将此数据分为两部分:

  • input.json - 仅包含配置数据。
  • HashiCorp 保险库 - 安全存储凭据。
备注:

无法将证书路径或与证书相关的凭据作为密码存储区的一部分存储。

重要提示:

在配置密码存储之前, input.json中引用的所有凭据必须作为密码存在于 HashiCorp 保险库中。如果缺少任何引用的凭据,安装将失败。

使用 Kubernetes Auth​

ESO Pod 使用其 Kubernetes 服务帐户令牌对 HashiCorp Vault 进行身份验证。保险库根据 Kubernetes API 服务器对令牌进行身份验证,并颁发具有适当策略的保险库令牌。

先决条件​

  • 启用了 Kubernetes 身份验证方法的 HashiCorp 保险库(只读)
  • 配置为允许 ESO 服务帐户的保险库角色。默认情况下,服务帐户名称为external-secrets 。
  • 从 Kubernetes 集群到保险库服务器的网络连接
  • (可选)自定义 Kubernetes 服务帐户(如果未使用 ESO 默认服务帐户)

Configuring input.json​

若要使用 Kubernetes Auth 将 HashiCorp 保险库配置为密码存储,请将以下部分添加到input.json :

{
  "secret_store": {
    "enabled": true,
    "provider_configs": [
      {
        "name": "hc-vault",
        "type": "hashicorp",
        "auth_type": "kubernetes",
        "hashicorp_kv": {
          "server": "https://vault.example.com:8200",
          "path": "secret",
          "version": "v2",
          "role": "uipath-role",
          "mount_path": "kubernetes"
        }
      }
    ]
  }
}
{
  "secret_store": {
    "enabled": true,
    "provider_configs": [
      {
        "name": "hc-vault",
        "type": "hashicorp",
        "auth_type": "kubernetes",
        "hashicorp_kv": {
          "server": "https://vault.example.com:8200",
          "path": "secret",
          "version": "v2",
          "role": "uipath-role",
          "mount_path": "kubernetes"
        }
      }
    ]
  }
}

要使用自定义服务帐户,请添加service_account_name字段,如下所示:

{
  "secret_store": {
    "enabled": true,
    "provider_configs": [
      {
        "name": "hc-vault",
        "type": "hashicorp",
        "auth_type": "kubernetes",
        "service_account_name": "vault-auth-sa",
        "hashicorp_kv": {
          "server": "http://vault.example.com:8200",
          "path": "secret",
          "version": "v2",
          "role": "uipath-role",
          "mount_path": "kubernetes"
        }
      }
    ]
  }
}
{
  "secret_store": {
    "enabled": true,
    "provider_configs": [
      {
        "name": "hc-vault",
        "type": "hashicorp",
        "auth_type": "kubernetes",
        "service_account_name": "vault-auth-sa",
        "hashicorp_kv": {
          "server": "http://vault.example.com:8200",
          "path": "secret",
          "version": "v2",
          "role": "uipath-role",
          "mount_path": "kubernetes"
        }
      }
    ]
  }
}
备注:

如果配置了service_account_name ,则服务帐户必须由客户预先创建。uipathctl验证其存在,但不创建它。

使用 AppRole Auth​

AppRole 身份验证使用保险库的 AppRole 身份验证方法,其中 ESO 使用 Kubernetes 密码中存储的角色 ID 和密码 ID 进行身份验证。此方法适用于自动化系统,不需要在保险库中启用 Kubernetes 身份验证。

先决条件​

  • 启用了 AppRole 身份验证方法的 HashiCorp 保险库
  • 已生成 AppRole 角色 ID 和密码 ID
  • 使用 AppRole 凭据预先创建的 Kubernetes 密码

Configuring input.json​

要使用 AppRole Auth 将 HashiCorp 保险库配置为密码存储,请执行以下步骤:

  1. 创建存储 AppRole 凭据的 Kubernetes 密码:

    kubectl create secret generic vault-approle-creds \
      --namespace uipath \
      --from-literal=role-id=<your-role-id> \
      --from-literal=secret-id=<your-secret-id>
    kubectl create secret generic vault-approle-creds \
      --namespace uipath \
      --from-literal=role-id=<your-role-id> \
      --from-literal=secret-id=<your-secret-id>
    

    密码必须包含以下键:

    • role-id - 保险库中的 AppRole 角色 ID
    • secret-id - 保险库中的 AppRole 密码 ID
  2. 将以下部分添加到input.json :

    {
      "secret_store": {
        "enabled": true,
        "provider_configs": [
          {
            "name": "hc-vault",
            "type": "hashicorp",
            "auth_type": "approle",
            "credentials_secret_name": "vault-approle-creds",
            "hashicorp_kv": {
              "server": "https://vault.example.com:8200",
              "path": "secret",
              "version": "v2",
              "mount_path": "approle"
            }
          }
        ]
      }
    }
    {
      "secret_store": {
        "enabled": true,
        "provider_configs": [
          {
            "name": "hc-vault",
            "type": "hashicorp",
            "auth_type": "approle",
            "credentials_secret_name": "vault-approle-creds",
            "hashicorp_kv": {
              "server": "https://vault.example.com:8200",
              "path": "secret",
              "version": "v2",
              "mount_path": "approle"
            }
          }
        ]
      }
    }
    

配置字段​

下表介绍了可用的配置字段。

字段必填默认描述
hashicorp_kv.server是-保险库服务器 URL
hashicorp_kv.path否secretKV 密码引擎装载路径
hashicorp_kv.version否v2KV 引擎版本: v1或v2
hashicorp_kv.role否uipath-role用于身份验证的保险库角色名称
hashicorp_kv.mount_path否kubernetes 或approle (基于auth_type )身份验证方法装载路径
auth_type是-必须为kubernetes或approle
credentials_secret_name是(仅限 AppRole)-包含role-id和secret-id密钥的 Kubernetes 密码
service_account_name否external-secrets用于 Kubernetes 身份验证的 Kubernetes 服务帐户如果指定了自定义服务帐户,则必须在集群中预先创建该服务帐户。

TLS CA 证书处理​

当保险库服务器使用 HTTPS 与私有 CA 证书时,请使用 CA 证书文件路径配置input.json中的additional_ca_certs :

additional_ca_certs: /path/to/client_cert
additional_ca_certs: /path/to/client_cert

在hashicorp_kv块中不需要其他配置。

在 input.json 中引用密码​

要引用存储在 HashiCorp 保险库(只读)中的凭据,请在input.json中使用以下格式:

vault/<vault-name>/<secret-path>?key=<key-name>
vault/<vault-name>/<secret-path>?key=<key-name>
  • 特定字段: vault/hc-vault/s3-credentials?key=access_key
  • 已固定的版本: vault/hc-vault/platform-sql?version=2

以下示例显示了如何在input.json中引用 HashiCorp 保险库(只读)密码:

admin_password: vault/hc-vault/admin-password-10832372?key=value
admin_password: vault/hc-vault/admin-password-10832372?key=value

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新