Using Anywhere Cloud Secret Service and Vault for agent secrets

A Cloudera Migration Assistant agent can store its connection credentials in Anywhere Cloud Secret Service instead of in its internal keystore. Anywhere Cloud Secret Service keeps secrets in your external HashiCorp Vault.

Anywhere Cloud Secret Service is available only for agents that run inside the Anywhere Cloud cluster. Agents outside the cluster, for example on a Cloudera Base on premises cluster, always use their internal keystore. The Cloudera Migration Assistant engine itself does not store connection credentials, so this setting applies to agents only.

The setting is off by default. When you turn it on, the agent stores each connection credential in Anywhere Cloud Secret Service under a path for that agent instance. Anywhere Cloud Secret Service limits the number of secrets that each owner can store. The default limit is 1,000 secrets.

To turn on Anywhere Cloud Secret Service for an agent, see Turning on Anywhere Cloud Secret Service for agents.

Vault token policy

Create a Vault token with a dedicated bootstrap policy, for example, the ss-bootstrap policy, that allows full lifecycle management of secret engines. This policy is used only for the initial vault setup and becomes obsolete after bootstrapping is finalized.

Run the following commands to create the ss-bootstrap policy:

export VAULT_NAMESPACE="admin/my-namespace"   # Scopes the following CLI commands; skip when Vault has no namespaces

vault policy write ss-bootstrap - <<'EOF'
path "sys/mounts/*"        { capabilities = ["create", "update"] }
path "+/config"           { capabilities = ["create", "update"] }
path "+/metadata/*"       { capabilities = ["read"] }
path "sys/auth/*"         { capabilities = ["create", "update", "sudo"] }
path "auth/+/config"      { capabilities = ["create", "update"] }
path "sys/policies/acl/*" { capabilities = ["create", "update"] }
path "auth/+/role/*"      { capabilities = ["create", "update", "read"] }
EOF

Vault token use

Generate a bootstrap token. If a Vault namespace is enabled, generate the token under that namespace. Specify a Time to Live (TTL) value long enough for Secret Service to deploy before the token expires. Because this token is required only for preliminary vault configuration, your administrator can revoke it after Secret Service deployment is finalized. Provide this token when you configure Secret Service, as the Vault token field in the Cloudera console, or in the /api/v1/secret-service/config/ backend API.

Run the following commands to generate the bootstrap token. Set a TTL long enough to finish configuring Secret Service; the token can expire after configuration succeeds.

export VAULT_NAMESPACE="admin/my-namespace"   # Or set "admin" as appropriate

vault token create \
  -orphan \
  -display-name="secret-service-bootstrap" \
  -policy="ss-bootstrap" \
  -ttl="vault-token-ttl" \
  -format=json | jq -r '.auth.client_token'

Vault CA certificate

You need a CA certificate only if your Vault server's Transport Layer Security (TLS) certificate is issued by a private Certificate Authority (CA). If your Vault server uses a certificate from a publicly trusted CA, skip this step.

Obtain the CA certificate in PEM format from the team that manages your Vault server or your organization's public key infrastructure (PKI). If the chain includes intermediate CAs, include them in the same file. Save the certificate as vault-ca.pem.

Optionally, verify that the certificate validates your Vault server by running the following command from a machine that can reach Vault:

openssl s_client -connect vault.example.com:8200 \
  -servername vault.example.com \
  -CAfile vault-ca.pem \
  -verify_return_error </dev/null

A successful check ends with Verify return code: 0 (ok). If the command reports a verification error, the certificate does not match your Vault server; check with your Vault or PKI team.

Provide the vault-ca.pem file when you connect the vault in the Anywhere Cloud Console or through the API.

Configuration parameters

For the parameters that connect Anywhere Cloud Secret Service to your vault, see Configuring secrets in the Anywhere Cloud documentation.