-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path6_enable_ldap_auth.sh
executable file
·60 lines (55 loc) · 1.42 KB
/
6_enable_ldap_auth.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
. env.sh
echo
cyan "Running: $0: Enable and Configure the LDAP Auth Method"
pe "vault auth enable -path=ldap-um ldap"
pe "vault auth enable -path=ldap-mo ldap"
green "Configure Unique Member group lookups"
# Using group of unique names lookups
cat << EOF
vault write auth/ldap-um/config
url="${LDAP_URL}"
binddn="${BIND_DN}"
bindpass="${BIND_PW}"
userdn="${USER_DN}"
userattr="${USER_ATTR}"
groupdn="${GROUP_DN}"
groupfilter="${UM_GROUP_FILTER}"
groupattr="${UM_GROUP_ATTR}"
insecure_tls=true
EOF
p
vault write auth/ldap-um/config \
url="${LDAP_URL}" \
binddn="${BIND_DN}" \
bindpass="${BIND_PW}" \
userdn="${USER_DN}" \
userattr="${USER_ATTR}" \
groupdn="${GROUP_DN}" \
groupfilter="${UM_GROUP_FILTER}" \
groupattr="${UM_GROUP_ATTR}" \
insecure_tls=true
echo
green "Configure MemberOf group lookups"
cat << EOF
vault write auth/ldap-mo/config
url="${LDAP_URL}"
binddn="${BIND_DN}"
bindpass="${BIND_PW}"
userdn="${USER_DN}"
userattr="${USER_ATTR}"
groupdn="${USER_DN}"
groupfilter="${MO_GROUP_FILTER}"
groupattr="${MO_GROUP_ATTR}"
insecure_tls=true
EOF
p
vault write auth/ldap-mo/config \
url="${LDAP_URL}" \
binddn="${BIND_DN}" \
bindpass="${BIND_PW}" \
userdn="${USER_DN}" \
userattr="${USER_ATTR}" \
groupdn="${USER_DN}" \
groupfilter="${MO_GROUP_FILTER}" \
groupattr="${MO_GROUP_ATTR}" \
insecure_tls=true