summaryrefslogtreecommitdiff
path: root/Architecture_and_Design/en-US/Kolab_Daemon.xml
blob: 36b5a10b7c0a1de2a3a66b1d41b27bc84fca2406 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "Architecture_and_Design.ent">
%BOOK_ENTITIES;
]>
<chapter id="chap-Architecture_and_Design-Kolab_Daemon">
    <title>Kolab Daemon</title>
    <para>
        The Kolab daemon is a multi-threaded daemon that synchronizes mutations made in the authentication and authorization database(s) with other components of a Kolab Groupware deployment.
    </para>
    <para>
        This chapter describes how the Kolab daemon functions in detail, starting with <xref linkend="proc-Architecture_and_Design-Kolab_Daemon-Startup_amp_Continued_Operations_of_the_Kolab_Daemon" />.
    </para>
    <procedure id="proc-Architecture_and_Design-Kolab_Daemon-Startup_amp_Continued_Operations_of_the_Kolab_Daemon">
        <title>Startup &amp; Continued Operations of the Kolab Daemon</title>
        <step>
            <para>
                Upon starting the Kolab daemon, a process <application>kolabd</application> obtains the primary authentication mechanism using the [kolab]/auth_mechanism setting in /etc/kolab/kolab.conf
            </para>

        </step>
        <step>
            <para>
                Subsequently, using the primary section related to the authentication mechanism (i.e. [ldap] or [sql]), it determines the list of (parent) domain name spaces this environment services. The Kolab daemon does so in an endless loop in the master process, and refreshes this list every 10 minutes.
            </para>
            <para>
                Related settings for LDAP include domain_root_dn, (kolab_)domain_filter, domain_name_attribute, domain_scope and domain_rootdn_attribute. Of impact as well, are ldap_uri, bind_dn, bind_pw.
            </para>

        </step>
        <step>
            <para>
                For each (parent) domain name space it finds, a new process is created. For more details on process operations, please see <xref linkend="proc-Architecture_and_Design-Kolab_Daemon-Kolab_Daemon_Domain_Process_Operations" />.
            </para>

        </step>
        <step>
            <para>
                Processes are named after their parent domain name space's unique_attribute (entryUUID or nsuniqueid). Should a process die, it is removed from the pool of existing processes, and restarted on the next iteration of listing domains.
            </para>

        </step>

    </procedure>

    <procedure id="proc-Architecture_and_Design-Kolab_Daemon-Kolab_Daemon_Domain_Process_Operations">
        <title>Kolab Daemon Domain Process Operations</title>
        <step>
            <para>
                Get from configuration the filter settings for the following objects, whichever applicable, and compose a single filter of them.
            </para>
            <para>
                <itemizedlist id="item-Architecture_and_Design-Kolab_Daemon_Domain_Process_Operations-Object_Types">
                    <title>Object Types</title>
                    <listitem>
                        <para>
                            users,
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            groups,
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            shared folders,
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            roles,
                        </para>

                    </listitem>

                </itemizedlist>

            </para>
            <para>
                The configured filter is obtained by first attempting to get the 'kolab' type prefixed filter, i.e. 'kolab_user_filter', and falls back to the non-type specific filter, i.e. 'user_filter'.
            </para>
            <para>
                The composed search filter for users, groups and shared folders could look like:
            </para>
            <example id="exam-Architecture_and_Design-Kolab_Daemon_Domain_Process_Operations-Example_users_groups_and_shared_folders_search_filter">
                <title>Example users, groups and shared folders search filter</title>
                <para>

<screen>(|(objectclass=kolabinetorgperson)(|(objectclass=kolabgroupofuniquenames)(objectclass=kolabgroupofurls))(objectclass=kolabsharedfolder))</screen>

                </para>

            </example>

        </step>
        <step>
            <para>
                Create a search for object types relevant to domain. Here, the Kolab Daemon splits up depending on the supported controls on LDAP server technology, and the queries supported by SQL server technology.
            </para>

        </step>

    </procedure>

    <procedure id="proc-Architecture_and_Design-Kolab_Daemon-LDAP_amp_Persistent_Search">
        <title>LDAP &amp; Persistent Search</title>
        <step>
            <para>
                The search is created to return all entries with a modification timestamp equal to or greater than the last time the Kolab Daemon had successfully followed up on a controlled search EntryChangeNotification.
            </para>

        </step>
        <step>
            <para>
                For each entry returned follow up with the appropriate action using the client EntryChangeNotification control:
            </para>
            <formalpara id="form-Architecture_and_Design-LDAP_amp_Persistent_Search-None">
                <title><literal>None</literal></title>
                <para>
                    An EntryChangeNotification of type <literal>None</literal> (as in the original results set) looks as follows (markup for readibility):
                </para>

            </formalpara>
            <example id="exam-Architecture_and_Design-LDAP_amp_Persistent_Search-Example_Persistent_Search_result_no_EntryChangeNotification">
                <title>Example Persistent Search result (no EntryChangeNotification)</title>
                <para>

<screen>DEBUG [18116]: LDAP Search Result Data Entry:
DEBUG [18116]:    DN: 'uid=doe,ou=People,dc=example,dc=org'
DEBUG [18116]:    Entry: {
        'displayName': ['Doe, John'],
        'cn': ['John Doe'],
        'preferredLanguage': ['en_US'],
        'userPassword': ['{SSHA}SomethingSomething=='],
        'mailAlternateAddress': ['j.doe@example.org', 'doe@example.org'],
        'objectClass': [
                'top',
                'inetorgperson',
                'kolabinetorgperson',
                'mailrecipient',
                'organizationalperson',
                'person'
            ],
        'sn': ['Doe'],
        'mail': ['john.doe@example.org'],
        'ou': ['ou=people,dc=example,dc=org'],
        'givenName': ['John'],
        'uid': ['doe']
    }
</screen>

                </para>

            </example>
            <formalpara id="form-Architecture_and_Design-LDAP_amp_Persistent_Search-add">
                <title><literal>add</literal></title>
                <para>
                    An EntryChangeNotification of type <literal>add</literal> looks as follows (markup for readibility):
                </para>

            </formalpara>
            <example id="exam-Architecture_and_Design-LDAP_amp_Persistent_Search-Example_Persistent_Search_result_EntryChangeNotification_of_type_add">
                <title>Example Persistent Search result (EntryChangeNotification of type <literal>add</literal>)</title>
                <para>

<screen>DEBUG [4595]: LDAP Search Result Data Entry:
DEBUG [4595]:    DN: 'uid=doe,ou=People,dc=example,dc=org'
DEBUG [4595]:    Entry: {
        'displayName': ['Doe, John'],
        'cn': ['John Doe'],
        'preferredLanguage': ['en_US'],
        'userPassword': ['{SSHA}SomethingSomething=='],
        'nsuniqueid': ['afda3481-83c311e1-9bbdc2f1-b2ae40b4'],
        'mailAlternateAddress': ['j.doe@example.org', 'doe@example.org'],
        'objectClass': [
                'top',
                'inetorgperson',
                'kolabinetorgperson',
                'mailrecipient',
                'organizationalperson',
                'person'
            ],
        'sn': ['Doe'],
        'mail': ['john.doe@example.org'],
        'ou': ['ou=people,dc=example,dc=org'],
        'givenName': ['John'],
        'uid': ['doe']
    }
DEBUG [4595]: Entry Change Notification attributes:
DEBUG [4595]:    Change Type: 1 ('add')
DEBUG [4595]:    Previous DN: None
</screen>

                </para>

            </example>

        </step>
        <step>
            <para>
                The Kolab Daemon determines the type of object having been added, modified, deleted or moved by matching the object against any of the object type specific search filters.
            </para>

        </step>
        <step>
            <para>
                Subsequently, it calls either one of the functions;
            </para>
            <para>
                <itemizedlist>
                    <listitem>
                        <para>
                            _change_group_none(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_user_none(entry, change)
                        </para>
                        <procedure>
                            <step>
                                <para>
                                    Check if a result attribute exists with a valid value
                                </para>
                                <substeps>
                                    <step>
                                        <para>
                                            if not, see if recipient policy exists
                                        </para>
                                        <substeps>
                                            <step>
                                                <para>
                                                    if yes, populate result attribute and continue as if result attribute always existed
                                                </para>

                                            </step>
                                            <step>
                                                <para>
                                                    if not, ignore the entry
                                                </para>

                                            </step>

                                        </substeps>

                                    </step>
                                    <step>
                                        <para>
                                            if yes, check if mailbox exists
                                        </para>
                                        <substeps>
                                            <step>
                                                <para>
                                                    if not, create mailbox
                                                </para>

                                            </step>
                                            <step>
                                                <para>
                                                    if yes, continue
                                                </para>

                                            </step>

                                        </substeps>

                                    </step>

                                </substeps>

                            </step>

                        </procedure>


                    </listitem>
                    <listitem>
                        <para>
                            _change_role_none(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_sharedfolder_none(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_group_add(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_user_add(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_role_add(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_sharedfolder_add(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_group_delete(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_user_delete(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_role_delete(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_sharedfolder_delete(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_group_modify(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_user_modify(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_role_modify(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_sharedfolder_modify(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_group_modrdn(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_user_modrdn(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_role_modrdn(entry, change)
                        </para>

                    </listitem>
                    <listitem>
                        <para>
                            _change_sharedfolder_modrdn(entry, change)
                        </para>

                    </listitem>

                </itemizedlist>

            </para>

        </step>

    </procedure>

    <para>
        Using the <literal>[ldap]</literal> <literal>domain_*</literal> settings, (domain_base_dn, domain_search_filter, domain_search_scope, domain_name_attribute, ...), the Kolab daemon determines the number of authentication databases for which to render service, as each domain name space may require either a switch in authn/authz technology, or different bind credentials.
    </para>
    <note>
        <para>
            This functionality is currently limited to LDAP only.
        </para>

    </note>
    <para>
        To illustrate, one of its responsibilities is to make sure adding a new user is propagated in the form of a new mailbox.
    </para>
    <para>
        The master process determines the number of domain name spaces served from different authentication and authorization sources.
    </para>
    <para>
        For LDAP based deployments, this includes multiple domain name spaces served with different root dns.
    </para>
    <para>
        It uses /etc/kolab/kolab.conf, section ldap, keys domain_base_dn, domain_rootdn_attribute, domain_filter, domain_name_attribute.
    </para>
</chapter>