Redis database secrets engine
Redis is one of the supported plugins for the database secrets engine. This plugin generates database credentials dynamically based on configured roles for the Redis 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 |
---|---|---|---|---|
redis-database-plugin | Yes | Yes | Yes | No |
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:
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, write dynamic and static roles to Vault to enable generating credentials.
Dynamic roles
Configure a dynamic role that maps a name in Vault to a JSON string containing the Redis ACL rules, which are either documented here or in the output of the
ACL CAT
Redis command.Note that if a creation_statement is not provided the user account will default to a read only user,
'["~*", "+@read"]'
that can read any key.Generate a new set of credentials 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 Redis user.
Retrieve the credentials from the
/static-creds
endpoint:
API
The full list of configurable options can be seen in the Redis Database Plugin API page.
For more information on the database secrets engine's HTTP API please see the Database Secrets Engine API page.