Couchbase Database Secrets Engine
Couchbase is one of the supported plugins for the database secrets engine. This plugin generates database credentials dynamically based on configured roles for the Couchbase database.
See the database secrets engine docs for more information about setting up the database secrets engine.
Capabilities
Plugin Name | Root Credential Rotation | Dynamic Roles | Static Roles | Username Customization |
---|---|---|---|---|
couchbase-database-plugin | Yes | Yes | Yes | Yes (1.7+) |
Setup
Enable the database secrets engine if it is not already enabled:
By default, the secrets engine will enable at the name of the engine. To enable the secrets engine at a different path, use the
-path
argument.Configure Vault with the proper plugin and connection configuration:
Where
${BASE64PEM}
is the server's root certificate authority in PEM format, encoded as a base64 string with no new lines.To connect to clusters prior to version 6.5.0, a
bucket_name
must also be configured:You should consider rotating the admin password. Note that if you do, the new password will never be made available through Vault, so you should create a Vault-specific database admin user for this.
Usage
After the secrets engine is configured, configure dynamic and static roles to enable generating credentials.
Dynamic roles
Configure a dynamic role that maps a name in Vault to a JSON string specifying a Couchbase RBAC role. The default value for
creation_statements
is a read-only admin role:{"Roles": [{"role":"ro_admin"}]}
.Note that any groups specified in the creation statement must already exist.
Generate a new credential by reading from the
/creds
endpoint with the name of the role:
Static roles
Configure a static role that maps a name in Vault to an existing couchbase user.
Retrieve the credentials from the
/static-creds
endpoint:
API
The full list of configurable options can be seen in the Couchbase database plugin API page.
For more information on the database secrets engine's HTTP API please see the Database secret secrets engine API page.