Register and enable external plugins
An external plugin is any authentication or secrets plugin build from external
code. Vault pre-registers commonly used external plugins (like kv), but you
must manually add other external plugins to the Vault plugin catalog before you
can use them with your Vault installation.
If you register an external plugin with the same name as a pre-registered plugin, Vault defaults to the manually registered plugin when you enable a new mount with that name.
Vault Enterprise v1.20.0 adds a download (BETA) parameter to the plugin
register API that lets Vault fetch the plugin binary directly from the
HashiCorp releases page. The steps below
cover the standard binary and .zip installation paths. For the download
parameter, refer to the
/sys/plugins/catalog API reference.
Before you start
To register official enterprise plugins, you must have Vault v1.16.21+, 1.17.17+, 1.18.10+, 1.19.4+, or 1.20.x+.
To register official community plugins with an extracted
.zipfile, you must have Vault v1.16.21+, 1.17.17+, 1.18.10+, 1.19.5+, or 1.20.x+.In HA or multi-node clusters, the plugin binary or
.zipartifact must exist inplugin_directoryon every Vault node before you register or reload the plugin. The catalog entry replicates across the cluster, but the on-disk artifact does not — each node must have the file locally.Plugin artifacts are not included in Raft snapshots. If you restore a Vault snapshot, you must manually copy the correct artifact to
plugin_directoryon every target node before starting Vault. See Restore a Vault snapshot for details.
You must have admin permissions for Vault. Specifically, you must be able to run
plugin registerand the appropriateenablecommand. At minimum, your token policy needs the following capabilities:# Register and list plugins in the catalog path "sys/plugins/catalog/*" { capabilities = ["create", "update", "list", "sudo"] } # Enable secrets engines path "sys/mounts/*" { capabilities = ["create", "update"] } # Enable auth methods path "sys/auth/*" { capabilities = ["create", "update", "sudo"] }You must have
plugin_directoryset in your Vault configuration file.You must have
api_addrset in your Vault configuration file.If you plan to use an extracted
.zipfile, the plugin artifacts must be compatible with the system running Vault. Vault verifies plugin integrity and checks system compatibility during the registration process for extracted artifacts.
Step 1: Prepare the plugin
You must have the plugin set up properly in your configured plugin directory. Vault expects specific path structures based on the integration, license, and file format.
If you plan to register an extracted .zip file, the extracted artifact
directory name must match the official file name. For example, to register
vault-plugin-database-oracle_0.11.0+ent_linux_amd64.zip, you must extract it
to the plugin directory as vault-plugin-database-oracle_0.11.0+ent_linux_amd64/.
You must register plugins with a version and we strongly recommend registering official plugins with a .zip file.
| Integration | License | Source | Path structure |
|---|---|---|---|
| Official | Enterprise | .zip | <plugin_directory>/<extracted-folder-name>/ |
| Official | Community | .zip | <plugin_directory>/<extracted-folder-name>/ |
| Community | N/A | .zip | Not supported |
| Official | Enterprise | binary | Not supported |
| Official | Community | binary | <plugin_directory>/<binary-name> |
| Community | N/A | binary | <plugin_directory>/<binary-name> |
Step 2: Update the plugin catalog
You must register your external plugin with the Vault catalog before enabling it. Registering plugins ensures the plugin invoked by Vault is authentic and maintains integrity.
Save the SHA for your plugin binary:
$ PLUGIN_SHA=$(sha256sum <path_to_plugin_binary> | awk '{print $1;}')Use
vault plugin registerto add your plugin to the catalog:$ vault plugin register \ -command <command_to_run_plugin_binary> \ -sha256 "${PLUGIN_SHA[0]}" \ -version "<semantic_version>" \ <plugin_type> \ <plugin_name> \For example, to register a secrets plugin called
mykvthat runs on the command line asmykvplugin:$ vault plugin register \ -command mykvplugin \ -sha256 ${PLUGIN_SHA} \ -version "v1.0.1" \ secret \ mykv Success! Registered plugin: mykv
Step 3: Enable the plugin
Enable the plugin to make it available to clients.
Use the appropriate enable command (vault secrets enable or vault auth enable)
and the registered name to mount the external plugin:
$ vault <secrets | auth> enable \
-path <mount_path> \
<plugin_name>
For example, to enable the mykv plugin on the path /custom/kv:
$ vault secrets enable \
-path custom/kv \
mykv
Success! Enabled the mykv secrets engine at: custom/kv/
Step 4: Verify the plugin status
Verify the plugin is ready for use and running the correct version.
Use the appropriate list command (vault secrets list or vault auth list)
to verify the version and mounted path for the registered plugin:
$ vault <secrets | auth> list
For example, to verify the mykv plugin:
$ vault secrets list
Path Type Accessor Description
---- ---- -------- -----------
cubbyhole/ ns_cubbyhole ns_cubbyhole_dd6729a7 per-token private secret storage
custom/mykv/ mykv mykv_7121a3d5 n/a
identity/ ns_identity ns_identity_f000c24d identity store
private/ kv kv_4a4118d8 n/a
shared/ kv kv_60208c6d n/a
sys/ ns_system ns_system_b9a3364f system endpoints used for control, policy and debugging
The list subcommand does not support filtering for specific fields in the
output, to confirm the version or running version, use the -detailed flag,
filter for the relevant plugin, and print the desired status column by index:
| Index | Detail column |
|---|---|
| 0 | Path |
| 1 | Plugin |
| 2 | Accessor |
| 3 | Default TTL |
| 4 | Max TTL |
| 5 | Force No Cache |
| 6 | Replication |
| 7 | Seal Wrap |
| 8 | External Entropy Access |
| 9 | Options |
| 10 | Description |
| 11 | UUID |
| 12 | Version |
| 13 | Running Version |
| 14 | Running SHA256 |
| 15 | Deprecation Status |
For example, to print the running version for mykv:
$ row=($(vault secrets list -detailed | grep mykv)) ; \
echo "${row[0]}: ${row[1]} (${row[13]})"
custom/mykv/: mykv (v1.0.1)
Troubleshooting
If registration or enabling fails, refer to the
Troubleshooting section
of the Plugin management page. Common issues include the
Unrecognized remote plugin message error caused by missing mlock
capabilities on the plugin binary.
Related
- Deregister a plugin — remove a plugin from the catalog when it is no longer needed.