homelab/terraform/vault/ldap.tf
vincent 2f1de5dcd5
Some checks failed
continuous-integration/drone/push Build is failing
fix vault dn
Signed-off-by: vincent <vincent@ducamps.win>
2024-05-08 21:38:10 +02:00

21 lines
701 B
HCL

resource "vault_ldap_auth_backend" "ldap" {
path = "ldap"
url = "ldaps://ldaps.service.consul"
userdn = "ou=users,dc=ducamps,dc=eu"
userattr = "uid"
discoverdn = false
insecure_tls = true
groupdn = "ou=groups,dc=ducamps,dc=eu"
groupfilter = "(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.UserDN}}))"
binddn = "uid=vaultServiceAccount,ou=serviceAccount,ou=users,dc=ducamps,dc=eu"
groupattr = "cn"
bindpass = var.ldap_bindpass
}
resource "vault_ldap_auth_backend_group" "vault_admin" {
groupname = "vault_admin"
policies = ["admin_policy"]
backend = vault_ldap_auth_backend.ldap.path
}