Custom Key Vaults¶
Shared services can provision extra Key Vaults alongside the organization saifcorp vault.
Declare them in
infra/shared-services/keyvaults.yml.
A missing or empty file creates none.
Declaring a Vault¶
keyvaults:
- name: claims # becomes saifcorp-claims
admin_groups: # Key Vault Administrator
- "<group-display-name>"
reader_groups: # Key Vault Reader
- "<group-display-name>"
secrets_user_groups: # Key Vault Secrets User (read secrets)
- "<group-display-name>"
| Field | Required | Description |
|---|---|---|
name |
yes | Suffix only; saifcorp- is always prepended. Max 15 chars, lowercase alphanumerics and single hyphens, must not start or end with a hyphen or repeat the saifcorp- prefix, and must be unique in the list. |
admin_groups |
no | Entra ID group display names granted Key Vault Administrator. |
reader_groups |
no | Entra ID group display names granted Key Vault Reader. |
secrets_user_groups |
no | Entra ID group display names granted Key Vault Secrets User (read secrets). |
Rules¶
- Each vault gets three Entra security groups created by Terraform, named
Azure-KeyVault-<Name>-<Role>(Nameis the vault name with each hyphen-separated part capitalized, for exampleshared-docsbecomesShared-Docs):Admin(Key Vault Administrator),Reader(Key Vault Reader), andSecretsUser(Key Vault Secrets User). Add members to these groups; the*_groupsfields above grant the same roles to additional, existing groups. - The full vault name must be globally unique. Soft-deleted vaults keep their name reserved.
- Groups are resolved by display name at plan time; an unknown group fails the plan.
- Vaults use Azure RBAC authorization. Only the three roles above are supported.
- The per-environment Terraform Cloud service principals (
terraformcloud-azure-<environment>-corporate) are always granted Key Vault Administrator on every custom vault, matching their access to the organizationsaifcorpvault.
Granting an App Access¶
Forge apps get read access to a custom vault by joining its SecretsUser group. Apps never get
write or admin access this way.
- Declare the vault in
keyvaults.ymland deploy it, so theAzure-KeyVault-<Name>-SecretsUsergroup exists. The group name omits thesaifcorp-prefix: the vaultsaifcorp-claimshas the groupAzure-KeyVault-Claims-SecretsUser. -
List the vault in the app's
key_vault_accessinput by its full name, including thesaifcorp-prefix (keyvaults.ymlstill takes the suffix only): -
Deploy the app. Its workspace adds the app registration to the group. Existing members are not touched, and RBAC and group changes can take several minutes to propagate.
System Connector APIs (created from the saif-api-connector template, which sets app_proxy) skip
this step for the saifcorp-connector vault: it is added to their key_vault_access
automatically, so they are placed in Azure-KeyVault-Connector-SecretsUser without listing it.
Requesting Access for People and Groups¶
Terraform creates the role groups but does not manage their membership. Membership for people and other groups is requested separately:
- Submit a ServiceNow request to add the people, or an existing group, to the role group
(
Azure-KeyVault-<Name>-Admin,-Readeror-SecretsUser). Request the lowest role that covers the need. - Ask in the same request for the group that holds the people to be made PIM-eligible for the role group, so access is activated just in time instead of being permanent.
- Members activate their PIM assignment before reading or writing secrets, and access ends when the activation expires.
App registrations are added by Forge as described above and do not need a request.
Where It Lives¶
keyvault-custom.tfparses the YAML, resolves groups, and enforces the naming preconditions.permissions.tfgrants the Terraform Cloud service principals Administrator on each vault.