|
| 1 | +--- |
| 2 | +layout: docs |
| 3 | +page_title: Migration Guide - Active Directory - Secrets Engines |
| 4 | +description: >- |
| 5 | + The guide for migrating from the Active Directory secrets engine to the LDAP secrets engine. |
| 6 | +--- |
| 7 | + |
| 8 | +# Migration Guide - Active Directory Secrets Engine |
| 9 | + |
| 10 | +The Vault [Active Directory secrets engine](/vault/docs/secrets/ad) has been deprecated as |
| 11 | +of the Vault 1.13 release. This document provides guidance for migrating from the Active |
| 12 | +Directory secrets engine to the [LDAP secrets engine](/vault/docs/secrets/ldap) that was |
| 13 | +introduced in Vault 1.12. |
| 14 | + |
| 15 | +## Deprecation Timeline |
| 16 | + |
| 17 | +Beginning from the Vault 1.13 release, we will continue to support the Active Directory (AD) |
| 18 | +secrets engine in maintenance mode for six major Vault releases. Maintenance mode means that |
| 19 | +we will fix bugs and security issues, but no new features will be added. All new feature |
| 20 | +development efforts will go towards the unified LDAP secrets engine. At Vault 1.18, we will |
| 21 | +mark the AD secrets engine as [pending removal](/vault/docs/deprecation/faq#pending-removal). |
| 22 | +At this time, Vault will begin to strongly signal operators that they need to migrate off of |
| 23 | +the AD secrets engine. At Vault 1.19, we will mark the AD secrets engine as |
| 24 | +[removed](/vault/docs/deprecation/faq#removed). At this time, the AD secrets engine will be |
| 25 | +removed from Vault. Vault will not start up with the AD secrets engine mounts enabled. |
| 26 | + |
| 27 | +## Migration Steps |
| 28 | + |
| 29 | +The following sections detail how to migrate the AD secrets engine configuration and |
| 30 | +applications consuming secrets to the new LDAP secrets engine. |
| 31 | + |
| 32 | +### 1. Enable LDAP Secrets Engine |
| 33 | + |
| 34 | +The LDAP secrets engine needs to be enabled in order to have a target for migration of |
| 35 | +existing AD secrets engine mounts. AD secrets engine mounts should be mapped 1-to-1 with |
| 36 | +new LDAP secrets engine mounts. |
| 37 | + |
| 38 | +To enable the LDAP secrets engine: |
| 39 | + |
| 40 | +```shell-session |
| 41 | +$ vault secrets enable ldap |
| 42 | +``` |
| 43 | + |
| 44 | +To enable at a custom path: |
| 45 | + |
| 46 | +```shell-session |
| 47 | +$ vault secrets enable -path=<custom_path> ldap |
| 48 | +``` |
| 49 | + |
| 50 | +If enabled at a custom path, the `/ldap/` path segment in API paths must be replaced with |
| 51 | +the custom path value. |
| 52 | + |
| 53 | +### 2. Migrate Configuration |
| 54 | + |
| 55 | +The AD secrets engine [configuration](/vault/api-docs/secret/ad#configuration) |
| 56 | +will need to be migrated to an LDAP secrets engine [configuration](/vault/api-docs/secret/ldap#configuration-management). |
| 57 | +The API paths and parameters will need to be considered during the migration. |
| 58 | + |
| 59 | +#### API Path |
| 60 | + |
| 61 | +| AD Secrets Engine | LDAP Secrets Engine | |
| 62 | +| ----------------- |-------------------- | |
| 63 | +| [/ad/config](/vault/api-docs/secret/ad#configuration) | [/ldap/config](/vault/api-docs/secret/ad#configuration) | |
| 64 | + |
| 65 | +#### Parameters |
| 66 | + |
| 67 | +The parameters from existing AD secrets engine configurations can generally be mapped 1-to-1 |
| 68 | +to LDAP secrets engine configuration. The following LDAP secrets engine parameters are the |
| 69 | +exception and must be considered during the migration. |
| 70 | + |
| 71 | +| AD Secrets Engine | LDAP Secrets Engine | Details | |
| 72 | +| ----------------- | ------------------- | ------- | |
| 73 | +| N/A | [schema](/vault/api-docs/secret/ldap#schema) | Must be set to the `ad` option on the LDAP secrets engine configuration. | |
| 74 | +| [userdn](/vault/api-docs/secret/ad#userdn) | [userdn](/vault/api-docs/secret/ad#userdn) | Required to be set if using the [library sets](#4-migrate-library-sets) check-out feature. It can be optionally set if using the [static roles](#3-migrate-roles) feature without providing a distinguished name ([dn](/vault/api-docs/secret/ldap#dn)). | |
| 75 | +| [ttl](/vault/api-docs/secret/ad#ttl) | N/A | Replaced by static role [rotation_period](/vault/api-docs/secret/ldap#rotation_period). | |
| 76 | +| [max_ttl](/vault/api-docs/secret/ad#max_ttl) | N/A | Not supported for [static roles](#3-migrate-roles). Can be set using [max_ttl](/vault/api-docs/secret/ldap#max_ttl-1) for library sets. | |
| 77 | +| [last_rotation_tolerance](/vault/api-docs/secret/ad#last_rotation_tolerance) | N/A | Not supported by the LDAP secrets engine. Passwords will be rotated based on the static role [rotation_period](/vault/api-docs/secret/ldap#rotation_period). | |
| 78 | + |
| 79 | +### 3. Migrate Roles |
| 80 | + |
| 81 | +AD secrets engine [roles](/vault/api-docs/secret/ad#role-management) will need to be migrated |
| 82 | +to LDAP secrets engine [static roles](/vault/api-docs/secret/ldap#static-roles). The API paths, |
| 83 | +parameters, and rotation periods will need to be considered during the migration. |
| 84 | + |
| 85 | +#### API Path |
| 86 | + |
| 87 | +| AD Secrets Engine | LDAP Secrets Engine | |
| 88 | +| ----------------- | ------------------- | |
| 89 | +| [/ad/roles/:role_name](/vault/api-docs/secret/ad#role-management) | [/ldap/static-role/:role_name](/vault/api-docs/secret/ldap#static-roles) | |
| 90 | + |
| 91 | +#### Parameters |
| 92 | + |
| 93 | +The following parameters must be migrated. |
| 94 | + |
| 95 | +| AD Secrets Engine | LDAP Secrets Engine | Details | |
| 96 | +| ----------------- | ------------------- | ------- | |
| 97 | +| [ttl](/vault/api-docs/secret/ad#ttl-1) | [rotation_period](/vault/api-docs/secret/ldap#rotation_period) | N/A | |
| 98 | +| [service_account_name](/vault/api-docs/secret/ad#service_account_name) | [username](/vault/api-docs/secret/ldap#username) | If `username` is set without setting the [dn](/vault/api-docs/secret/ldap#dn) value, then the configuration [userdn](/vault/api-docs/secret/ldap#userdn) must also be set. | |
| 99 | + |
| 100 | +#### Rotation Periods |
| 101 | + |
| 102 | +Rotations that occur from AD secrets engine [roles](/vault/api-docs/secret/ad#role-management) |
| 103 | +may conflict with rotations performed by LDAP secrets engine [static roles](/vault/api-docs/secret/ldap#static-roles) |
| 104 | +during the migration process. This could cause applications consuming passwords to read a |
| 105 | +password that gets invalidated by a rotation shortly after. To mitigate this, it's recommended |
| 106 | +to set an initial [rotation_period](/vault/api-docs/secret/ldap#rotation_period) that provides |
| 107 | +a large enough window to complete [application migrations](#5-migrate-applications) to minimize |
| 108 | +the chance of this happening. Additionally, tuning the AD secrets engine [last_rotation_tolerance](/vault/api-docs/secret/ad#last_rotation_tolerance) |
| 109 | +parameter could help mitigate applications reading stale passwords, since the parameter allows |
| 110 | +rotation of the password if it's been rotated out-of-band within a given duration. |
| 111 | + |
| 112 | +### 4. Migrate Library Sets |
| 113 | + |
| 114 | +AD secrets engine [library sets](/vault/api-docs/secret/ad#library-management) will need to |
| 115 | +be migrated to LDAP secrets engine [library sets](/vault/api-docs/secret/ldap#library-set-management). |
| 116 | +The API paths and parameters will need to be considered during the migration. |
| 117 | + |
| 118 | +#### API Path |
| 119 | + |
| 120 | +| AD Secrets Engine | LDAP Secrets Engine | |
| 121 | +| ----------------- | ------------------- | |
| 122 | +| [/ad/library/:set_name](/vault/api-docs/secret/ad#library-management) | [/ldap/library/:set_name](/vault/api-docs/secret/ldap#library-set-management) | |
| 123 | + |
| 124 | +#### Parameters |
| 125 | + |
| 126 | +The parameters from existing AD secrets engine library sets can be exactly mapped 1-to-1 |
| 127 | +to LDAP secrets engine library sets. There are no exceptions to consider. |
| 128 | + |
| 129 | +### 5. Migrate Applications |
| 130 | + |
| 131 | +The AD secrets engine provides APIs to obtain credentials for AD users and service accounts. |
| 132 | +Applications, or Vault clients, are typically the consumer of these credentials. For applications |
| 133 | +to successfully migrate, they must begin using new API paths and response formats provided |
| 134 | +by the LDAP secrets engine. Additionally, they must obtain a Vault [token](/vault/docs/concepts/tokens) |
| 135 | +with an ACL [policy](/vault/docs/concepts/policies) that authorizes access to the new APIs. |
| 136 | +The following section details credential-providing APIs and how their response formats differ |
| 137 | +between the AD secrets engine and LDAP secrets engine. |
| 138 | + |
| 139 | +#### API Paths |
| 140 | + |
| 141 | +| AD Secrets Engine | LDAP Secrets Engine | Details | |
| 142 | +| ----------------- | ------------------- | ------- | |
| 143 | +| [/ad/creds/:role_name](/vault/api-docs/secret/ad#retrieving-passwords) | [/ldap/static-cred/:role_name](/vault/api-docs/secret/ldap#static-role-passwords) | Response formats differ. Namely, `current_password` is now `password`. See [AD response](/vault/api-docs/secret/ad#sample-get-response) and [LDAP response](/vault/api-docs/secret/ldap#sample-get-response-1) for the difference. | |
| 144 | +| [/ad/library/:set_name/check-out](/vault/api-docs/secret/ad#check-a-credential-out) | [/ldap/library/:set_name/check-out](/vault/api-docs/secret/ldap#check-out-management) | Response formats do not differ. | |
| 145 | +| [/ad/library/:set_name/check-in](/vault/api-docs/secret/ad#check-a-credential-in) | [/ldap/library/:set_name/check-in](/vault/api-docs/secret/ldap#check-in-management) | Response formats do not differ. | |
| 146 | + |
| 147 | +### 6. Disable AD Secrets Engines |
| 148 | + |
| 149 | +AD secrets engine mounts can be disabled after successful migration of configuration and |
| 150 | +applications to the LDAP secrets engine. Note that disabling the secrets engine will erase |
| 151 | +its configuration from storage. This cannot be reversed. |
| 152 | + |
| 153 | +To disable the AD secrets engine: |
| 154 | + |
| 155 | +```shell-session |
| 156 | +$ vault secrets disable ad |
| 157 | +``` |
| 158 | + |
| 159 | +To disable at a custom path: |
| 160 | + |
| 161 | +```shell-session |
| 162 | +$ vault secrets disable <custom_path> |
| 163 | +``` |
0 commit comments