Supported resources
Requirements
Before you begin, you must:- Be an Opal Admin
- Be on version
1.1263.0or later, if you self-host Opal - Have the AppRole auth method enabled at its default
approlepath in Vault - To grant access to secrets, have the OIDC auth method enabled at its default
oidcpath, with your identity provider as the OIDC provider
1. Create an AppRole for Opal
In Opal, go to Inventory > + App and select HashiCorp Vault. The form shows the Vault policy Opal needs. Copy it and create it in Vault as the AppRole’s policy, for exampleopal-approle:
- Replace
secret-kv2andsecret-kv1with the mount paths of the KV secret engines you want Opal to sync. - Replace
opal-approlewith the name of your policy. The policy gives the AppRole onlyreadon its own policy. If the AppRole can change its own policy, Opal flags it as a privilege escalation risk when you save the app.
2. Create the HashiCorp Vault app in Opal
Back in the Opal form, fill in the following fields:
Select Read-only (do not push membership or secret grants) to sync without changing anything in Vault. Opal then checks only the read capabilities it needs.
When you save the app, Opal checks the AppRole’s capabilities. A missing read capability is critical. A missing write capability only affects granting and revoking access.
3. Import assets
After you save the app, import the secrets and identity groups you want to manage from the app’s Assets tab by selecting Import assets, and turn on requests for them.How Opal matches users
Opal matches each Vault identity entity to an Opal user by email. It uses the first of these that is a valid email address:- The entity’s
emailmetadata - The entity’s name
- The name or
emailmetadata of one of the entity’s aliases
How secret access works
When Opal grants a user access to a secret, it creates anopal--prefixed policy for that user and secret path, and an opal--prefixed OIDC role bound to the user’s email addresses. The user signs in to Vault with OIDC using that role. When access ends, Opal deletes the policy, which also invalidates sessions that use it, and then deletes the role.