This benchmark will test the dynamic generation of LDAP credentials.
binddn(string: <required>)- Distinguished name (DN) of object to bind for managing user entries. For example,cn=vault,ou=Users,dc=hashicorp,dc=com.bindpass(string: <required>)- Password to use along withbinddnfor managing user entries. This can also be provided via theVAULT_BENCHMARK_LDAP_BIND_PASSenvironment variable.url(string: "ldap://127.0.0.1")- The LDAP server to connect to. Examples:ldaps://ldap.myorg.com,ldaps://ldap.myorg.com:636. This can also be a comma-delineated list of URLs, e.g.ldaps://ldap.myorg.com, ldaps://ldap.myorg.com:636, in which case the servers will be tried in-order if there are errors during the connection process.`.password_policy(string: <optional>)- The name of the password policy to use to generate passwords. Note that this accepts the name of the policy, not the policy itself.schema(string: "openldap")- The LDAP schema to use when storing entry passwords. Valid schemas includeopenldap,ad, andracf.userdn(string: <optional>)- The base DN under which to perform user search in library management and static roles. For example,ou=Users,dc=hashicorp,dc=com.userattr(string: <optional>)– The attribute field name used to perform user search in library management and static roles. Defaults tocnfor theopenldapschema,userPrincipalNamefor theadschema, andracfidfor theracfschema.upndomain(string:optional) - The domain (userPrincipalDomain) used to construct a UPN string for authentication. The constructed UPN will appear as[binddn]@[upndomain]. For example, ifupndomain=example.comandbinddn=admin, the UPN stringadmin@example.comwill be used to log in to Active Directory.connection_timeout(integer: 30)- Timeout, in seconds, when attempting to connect to the LDAP server before trying the next URL in the configuration.request_timeout(integer: 90)- Timeout, in seconds, for the connection when making requests against the server before returning back an error.starttls(bool: <optional>)- If true, issues aStartTLScommand after establishing an unencrypted connection. -insecure_tls(bool: <optional>)- If true, skips LDAP server SSL certificate verification - insecure, use with caution!certificate(string: <optional>)- CA certificate to use when verifying LDAP server certificate, must be x509 PEM encoded.client_tls_cert(string: <optional>)- Client certificate to provide to the LDAP server, must be x509 PEM encoded.client_tls_key(string: <optional>)- Client key to provide to the LDAP server, must be x509 PEM encoded.
role_name(string: "benchmark-role")- The name of the dynamic role.creation_ldif(string: <required>)- A templatized LDIF string used to create a user account. This may contain multiple LDIF entries. Thecreation_ldifcan also be used to add the user account to an existing group. All LDIF entries are performed in order. If Vault encounters an error while executing thecreation_ldifit will stop at the first error and not execute any remaining LDIF entries. If an error occurs androllback_ldifis specified, the LDIF entries inrollback_ldifwill be executed. Seerollback_ldiffor more details. This field may optionally be provided as a base64 encoded string.deletion_ldif(string: <required>)- A templatized LDIF string used to delete the user account once its TTL has expired. This may contain multiple LDIF entries. All LDIF entries are performed in order. If Vault encounters an error while executing an entry in thedeletion_ldifit will attempt to continue executing any remaining entries. This field may optionally be provided as a base64 encoded string.rollback_ldif(string: <not required but recommended>)- A templatized LDIF string used to attempt to rollback any changes in the event that execution of thecreation_ldifresults in an error. This may contain multiple LDIF entries. All LDIF entries are performed in order. If Vault encounters an error while executing an entry in therollback_ldifit will attempt to continue executing any remaining entries. This field may optionally be provided as a base64 encoded string.username_template(string: <optional>)- A template used to generate a dynamic username. This will be used to fill in the.Usernamefield within thecreation_ldifstring.default_ttl(int: <optional>)- Specifies the TTL for the leases associated with this role. Defaults to system/engine default TTL time.max_ttl(int: <optional>)- Specifies the maximum TTL for the leases associated with this role. Defaults to system/mount default TTL time; this value is allowed to be less than the mount max TTL (or, if not set, the system max TTL), but it is not allowed to be longer.
test "ldap_dynamic_secret" "ldap_secret_test1" {
weight = 100
config {
secret {
url = "ldap://localhost"
binddn = "cn=admin,dc=hashicorp,dc=com"
bindpass = "admin"
}
role {
creation_ldif = "ZG46IGNuPXt7LlVzZXJuYW1lfX0sb3U9dXNlcnMsZGM9aGFzaGljb3JwLGRjPWNvbQpvYmplY3RDbGFzczogcGVyc29uCm9iamVjdENsYXNzOiB0b3AKY246IGxlYXJuCnNuOiB7ey5QYXNzd29yZCB8IHV0ZjE2bGUgfCBiYXNlNjR9fQptZW1iZXJPZjogY249ZGV2LG91PWdyb3VwcyxkYz1oYXNoaWNvcnAsZGM9Y29tCnVzZXJQYXNzd29yZDoge3suUGFzc3dvcmR9fQo="
deletion_ldif = "ZG46IGNuPXt7LlVzZXJuYW1lfX0sb3U9dXNlcnMsZGM9aGFzaGljb3JwLGRjPWNvbQpjaGFuZ2V0eXBlOiBkZWxldGUK"
rollback_ldif = "ZG46IGNuPXt7LlVzZXJuYW1lfX0sb3U9dXNlcnMsZGM9aGFzaGljb3JwLGRjPWNvbQpjaGFuZ2V0eXBlOiBkZWxldGUK"
}
}
}