Set up HashiCorp Vault
A HashiCorp Vault (opens in a new tab) integration lets Astralis read integration credentials from a KV secrets engine in your Vault by logging in with an AppRole you create.
Secrets manager integrations are part of Astralis Enterprise. See the secrets managers overview for how managers and references fit together.
Prerequisites
- Permission:
secrets_manager:create_or_update, held by the Owner role. - Vault access: permission to write policies and create AppRoles, on self-hosted Vault or HCP Vault Dedicated.
- Secrets: each secret is a KV v1 or KV v2 object. Read an integration's credentials from a manager shows the keys each integration type needs.
Confirm Astralis can reach Vault
Astralis connects to Vault directly over the internet and enforces these rules on the address:
| Rule | Detail |
|---|---|
| HTTPS only | http:// addresses are refused. TLS certificate verification cannot be turned off. |
| Public addresses only | Every address the hostname resolves to must be publicly routable. Loopback, link-local, private (RFC 1918), and reserved ranges are refused, checked when you save and on every connection. |
| Hostname or IPv4 | IPv6 literals are refused. The default port is 443; include another port in the address, such as https://vault.example.com:8200. |
| No proxy, no redirects | Astralis ignores proxy settings and does not follow redirects, so point it at the active node or a load balancer. |
For HCP Vault Dedicated, enable public cluster access and add the Astralis egress addresses to the cluster's IP allow list: your own network's on a deployment you run, or the addresses Ethyca support gives you for an Ethyca-hosted one.
If Vault uses a certificate from a private certificate authority, have the CA certificate ready in PEM format.
Standby nodes and load balancers
Set the address to Vault's active node, or to a load balancer that forwards to it. Standby nodes normally forward requests to the active node, but answer with a redirect when request forwarding is off or fails, and a captive portal or load balancer can answer with its own page. Astralis follows neither, and reports them as NonJsonResponse.
Astralis treats NonJsonResponse as an outage: integrations keep using cached values for up to 30 minutes, and the manager's Test fails until Vault itself answers.
Create a read policy and an AppRole
Use a dedicated KV mount for the secrets Astralis reads, so its policy covers nothing else. Anyone who can write to that mount controls the credentials your integrations connect with, so limit write access to the people who manage those credentials.
-
Write a policy granting read on the mount. For KV v2, the data path includes
data/:# KV v2 mount named "astralis" path "astralis/data/*" { capabilities = ["read"] }For a KV v1 mount, grant
readonastralis/*instead. -
Enable AppRole if it is not already enabled, and create a role with the policy:
vault auth enable approle vault write auth/approle/role/astralis \ token_policies="astralis-read" \ token_ttl=1h \ token_max_ttl=4h \ secret_id_ttl=2160h \ secret_id_num_uses=0 \ token_num_uses=0 -
Read the role ID and generate a secret ID:
vault read auth/approle/role/astralis/role-id vault write -f auth/approle/role/astralis/secret-id
Settings that matter for Astralis:
| Setting | Recommendation | Why |
|---|---|---|
secret_id_num_uses | 0 (unlimited) | Every Astralis process logs in with the secret ID, and logs in again when its token expires. A small limit is used up quickly. |
token_num_uses | 0 (unlimited) | Every secret read and every check uses the token. |
secret_id_ttl | Finite, such as 90 days | Gives the secret ID an expiry you rotate on. Revoking it is your kill switch. |
| Token policies | Keep the default policy | Astralis checks its token with lookup-self, which the default policy allows. With token_no_default_policy=true, every test and every refused read causes a new login. |
If you restrict the role with secret_id_bound_cidrs or token_bound_cidrs, use your deployment's egress addresses, as for HCP Vault Dedicated above.
Astralis takes the secret ID as-is. Response-wrapped secret IDs are not supported.
Add the manager in Astralis
-
Navigate to Settings → Secrets managers.
-
Click Add secrets manager.
-
Enter a Name and choose HashiCorp Vault as the Provider. The provider cannot be changed later.
-
Fill in the connection fields:
Field Value Address The Vault URL, such as https://vault.example.comMount The KV mount, such as astralisKV version 2or1. Astralis does not detect it, and the two versions store secrets at different paths.Namespace Vault Enterprise and HCP Vault Dedicated only. HCP uses adminby default.CA certificate The PEM certificate, when Vault uses a private CA AppRole role ID The role ID from the previous step AppRole secret ID The secret ID from the previous step. Stored encrypted and never shown again. -
Click Add secrets manager.
Astralis logs in at the approle auth mount. If your AppRole is enabled at another path, set details.auth_mount through the API with PATCH /api/v1/plus/secrets-manager/{key}.
Verify the connection
Click Verify connection in the manager's form, or Test on the manager's row. A Healthy result means the AppRole login succeeded.
The test authenticates only; it does not read a secret. Your read policy is proven when you check an integration's reference.
Reference a secret
An integration's reference is the secret's path under the mount, without the mount and without data/. For a KV v2 secret written with vault kv put astralis/billing-postgres ..., the reference is billing-postgres.
Paths use letters, digits, and /_.+=@-, start with a letter or digit, and contain no empty, ., or .. segments.
Rotate the secret ID
- Generate a new secret ID:
vault write -f auth/approle/role/astralis/secret-id. - In Astralis, edit the manager, enter the new AppRole secret ID, and click Save changes.
- Click Verify connection.
- Revoke the old secret ID in Vault.
Changing the Address, Namespace, or CA certificate also requires entering the secret ID again in the same save, so a secret ID cannot be sent to a server you did not intend.
To cut Astralis off, remove the read grant first: Vault checks policies on every request, so this also stops tokens Astralis already holds. See revoke access for the full procedure.