Vault
Create static LDAP roles
Configure static roles to map names in Vault to LDAP entries and use the rotation settings to manage credentials automatically with the role.
Create a configuration file,
ldap-role.jsonwith your role settings:{ "role_name": "<vault_role_name>", "username": "<existing_ldap_username>", "dn": "<existing_ldap_dn>", "rotation_period": "<credential_rotation_frequency>" }For example:
{ "role_name": "hashicorp", "username": "vault", "dn": "uid=vault,ou=users,dc=hashicorp,dc=com", "rotation_period": "24h" }Save the new role.
Use
vault writewith the/{mount_path}/static-rolepath and your static role configuration,ldap-role.json, to create a new static role:$ vault write <mount_path>/static-role @ldap-role.jsonFor example:
$ vault write devcreds/static-role @ldap-role.jsonConfirm the role settings by requesting credentials from the plugin:
Use
vault readwith the/{mount_path}/static-cred/{role_name}path to fetch the credential information for the given role:$ vault read <mount_path>/static-role/<role_name>For example:
$ vault read devcreds/static-role/hashicorp