Debian Codegraph @

src/modules/db2_ldap/README

raw
1 db2_ldap module
2
3 Jan Janak
4
5 Iptel.org
6
7 Copyright © 2008 Iptel.org GmBH
8 __________________________________________________________________
9
10 Table of Contents
11
12 1. Admin Guide
13
14 1. Overview
15 2. Dependencies
16 3. Parameters
17
18 3.1. config (string)
19 3.2. reconnect_attempt (integer)
20
21 4. Functions
22
23 List of Examples
24
25 1.1. URI example
26 1.2. Example config
27 1.3. Configuration file example
28 1.4. Example reconnect_attempt
29
30 Chapter 1. Admin Guide
31
32 Table of Contents
33
34 1. Overview
35 2. Dependencies
36 3. Parameters
37
38 3.1. config (string)
39 3.2. reconnect_attempt (integer)
40
41 4. Functions
42
43 1. Overview
44
45 The LDAP module is database driver, i.e. it implements DBv2 API
46 functions. The goal is map database query defined by table, matching
47 fields and result fields to LDAP search in sub-tree defined by root,
48 object class, attributes and pass it to the OpenLDAP which communicates
49 with the LDAP server.
50
51 This procedure is sometimes tricky because the LDAP does not support
52 all database features or supports them in different manner. Here we
53 must express especially filtering and multi-values. The multi-value is
54 de facto array of single values. If the LDAP module gets a multi-value
55 field then it generates record for every single value, respectively for
56 every combination in case the more fields contain multi-value.
57
58 The LDAP supports natively "AND", "OR", "NOT" logical operators and
59 "equal", "non-equal", "less-or-equal" and "greater-or-equal" comparison
60 operators. Therefore "less" and "greater" operators are mapped as
61 "less/greater-or-equal-AND-not-equal". It's important realize it when
62 the attribute which will be used for filtering may contain multi-value.
63 The LDAP server evaluates comparison operator on multi-value so that
64 the result for record is true if the condition is satisfied for any
65 single value. The single values not satisfying condition are not
66 truncated. It implies two cases for positive comparison, e.g. "equal",
67 the result contains values not satisfying the condition, the case may
68 be handled by additional filter in the LDAP module, the negative
69 comparison, e.g. "non-equal", does not return record at all. Because
70 the LDAP module cannot know if the LDAP attribute may logically contain
71 multi-value so there is introduced DB API option client_side_filtering
72 which forces filtering such fields in the LDAP module, i.e. the LDAP
73 server returns larger result set because the filtering condition is not
74 passed there.
75
76 The syntax of client_side_filtering value is comma delimited of field
77 names which won't be used for server-side filter if such a field
78 appears in a match condition. Instead records will be filtered out in
79 module. It implies such fields MUST exist in result field list.
80
81 The necessary condition of successful filtering of particular attribute
82 at the LDAP server is correct attribute definition. The
83 "equal"/"non-equal" operator requires equality matching rule, the
84 "greater"/"less" operator requires ordering matching rule. If required
85 matching rule is missing the LDAP server silently returns empty result
86 set. In case of double filtering both at the LDAP server and the LDAP
87 module, e.g. multi-value and equal comparison, check the LDAP server
88 matching rule satisfies your needs or use client_side_filtering
89 feature.
90
91 The LDAP server may be identified either complete specification of
92 host, user, password in URI or is specification reference to connection
93 section of config file. Note in the second case there is only one
94 slash.
95
96 Example 1.1. URI example
97 ...
98 modparam("auth", "db_url", "ldap://admin:[email protected]");
99
100 modparam("auth", "db_url", "ldap:/ldap_server1");
101
102 ...
103
104 Features:
105 * simple, SASL authentication, TLS
106 * server and client side filtering
107 * read-only queries
108 * optional referral chasing by OpenLDAP
109 * optional reference chasing by OpenLDAP
110
111 2. Dependencies
112
113 none
114
115 3. Parameters
116
117 3.1. config (string)
118 3.2. reconnect_attempt (integer)
119
120 3.1. config (string)
121
122 Default value is ldap.cfg.
123
124 The filename (relatively to ser config file) of mapping database to
125 LDAP definition. It is the main configuration file for the LDAP module
126 in SER. The configuration file maps database table names used in SER to
127 LDAP directory sub-trees to be searched. In addition to that the
128 configuration file also allows to configure the LDAP search filter and
129 maps database field names to LDAP attribute names and vice versa.
130
131 Example 1.2. Example config
132 ...
133 modparam("ldap", "config", "my-ldap.cfg");
134 ...
135
136 Example 1.3. Configuration file example
137 # Supported Attribute Type Names:
138 # * GeneralizedTime
139 # * Integer
140 # * BitString
141 # * Boolean
142 # * String
143 # * Binary
144 # * Float
145 #
146
147 [connection:ldap_server1]
148 host=127.0.0.1
149 port=389
150 username=ser
151 password=heslo
152 # LDAP or LDAP SASL authentication mechanism.
153 # Allowed values: none (default), simple, digest-md5, external
154 authtype=simple
155
156 # tls encryption
157 tls=off
158
159 # Specifies the file that contains certificates for all of the Certificate
160 # Authorities the ldap module will recognize.
161 ca_list=/home/kg/work/openssl/demoCA/cacert.pem
162
163 # Specifies what checks to perform on server certificates in a TLS session
164 # allowed values are never/allow/try/demand
165 # see the TLS_REQCERT tls option part of ldap.conf(8) man page for more details
166 require_certificate=demand
167
168 #
169 # Table credentials contains SIP digest authentication credentials.
170 #
171 [table:credentials]
172
173 # In our LDAP directory we store SIP digest credentials under
174 # "Digest Credentials" organization unit so this is where searches for digest
175 # credentials should start.
176 base = "ou=Digest Credentials,dc=iptel,dc=org"
177
178 # We search the whole subtree.
179 scope = subtree
180
181 # For digest credentials we are only interested in objects with objectClass
182 # 'digestAuthCredentials', objects of all other types are ignored.
183 filter = "(objectClass=digestAuthCredentials)"
184
185 # Mapping of field names to LDAP attribute names and vice versa. Names are
186 # delimited using ':', the first name is database field name as used in SER
187 # modules, the second name (after :) is corresponding LDAP attribute name,
188 # optionally preceded with LDAP attribute syntax name in parentheses.
189 field_map = password : (Binary) digestPassword
190 field_map = realm : digestRealm
191 field_map = auth_username : digestUsername
192 field_map = uid : serUID
193 field_map = flags : (BitString) serFlags
194
195 # retrieve at most sizelimit entries for a search
196 #sizelimit = 2147483647
197
198 # wait at most timelimit seconds for a search to complete
199 #timelimit = 120
200
201 # chase references automatically by OpenLDAP. Default is "never"
202 # chase_references = never | searching | finding | always
203
204 # chase referrals automatically by OpenLDAP. Default is "no"
205 # chase_referrals = yes | no
206
207 #
208 # Domain table stores information about virtual domains
209 #
210 [table:domain]
211
212 # Objects mapping domain IDs to domain names and vice versa are stored
213 # in the subtree with the following root:
214 base = "ou=Domains,dc=iptel,dc=org"
215
216 scope = subtree
217
218 # We are only interested in serDomain objects when looking up information
219 # about virtual domains.
220 filter = "(objectClass=serDomain)"
221
222 field_map = did : (String) serDID
223 field_map = domain : (String) serDomain
224 field_map = flags : (BitString) serFlags
225
226 #
227 # Table domain_attrs contains domain attributes, domain attributes store
228 # extra information about virtual domains.
229 #
230 [table:domain_attrs]
231 base = "ou=Domains, dc=iptel,dc=org"
232 scope = subtree
233
234 filter = "(objectClass=serDomainAttr)"
235
236 field_map = did : serDID
237 field_map = name : serAttrName
238 field_map = type : (Integer) serAttrType
239 field_map = value : serAttrValue
240 field_map = flags : (BitString) serFlags
241
242 3.2. reconnect_attempt (integer)
243
244 Default value is 3.
245
246 Number of reconnect attempts when connection to the LDAP server is
247 lost.
248
249 Example 1.4. Example reconnect_attempt
250 ...
251 modparam("ldap", "reconnect_attempt", "5");
252 ...
253
254 4. Functions
255
256 none