-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathnsscache.conf.5
436 lines (360 loc) · 11.1 KB
/
nsscache.conf.5
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
.TH NSSCACHE.CONF 5 2023-06-03 "nsscache 0.49" "File formats"
.SH NAME
nsscache.conf - NSS local cache synchroniser configuration file
.SH SYNOPSIS
.B /etc/nsscache.conf
.SH DESCRIPTION
.B nsscache
synchronises a local NSS cache, and other databases, against a remote
data source. This approach allows the administrator to separate the
network from the NSS lookup codepath, improving speed and reliability
of name services.
The nsscache configuration file comprises of one DEFAULT section,
followed by zero or more map-specific configuration sections. The
file format is similar to that of ".ini" files.
The DEFAULT section must provide at least one
\fBsource\fP
keyword, specifying the data source to use, one
\fBcache\fP
keyword, specifying the means in which the cache data will be stored
locally, one
\fBmaps\fP
keyword, specifying which NSS maps should be cached, and one
\fBtimestamp_dir\fP
keyword, specifying the location of the timestamps used for
incremental updates.
Additional global defaults, such as LDAP search parameters, or the
filesystem location of the cache, may also be included in the DEFAULT
section.
Additional sections may be included that allow per-map overrides to
configuration options. For example, one might specify their global
LDAP search base as
\fBou=People\fP
but want to override that for the
\fIgroup\fP
mapping as
\fBou=Groups\fP
Apart from the \fIsource\fP, \fIcache\fP, and \fImaps\fP configuration
options, all options are prefixed by the name of the module that they
configure.
A complete list of configuration options follows.
.SH DEFAULT-only OPTIONS
.TP
\fBsource\fP
Specifies the source to use to retrieve NSS data from.
Valid Options:
.I ldap, s3, http, gcs
.TP
.B cache
Specifies the cache method to use to store the data, which will be
queried by the NSS itself.
Valid options:
.I files
Store in a plain text file, similar in format to
.I /etc/passwd.
If the files-module option
.I files_cache_filename_suffix
is also set to
.B cache
then not only will the files be created with a \fB.cache\fP suffix, but also an index file will be written alongside, for use with the
.I nss-cache
NSS module. (See https://github.com/google/libnss-cache.)
.TP
.B maps
Specifies the names of the maps that will be queried and cached by
.I nsscache
Valid options:
.I passwd
.I group
.I shadow
.I netgroup
.I automount
.I sshkey
.TP
.B timestamp_dir
Specifies the directory where update and modify timestamps are stored.
.SH ldap SOURCE OPTIONS
These options configure the behaviour of the
.I ldap
source.
.TP
.B ldap_ad
Set to 1 if connecting to Active Directory. If enabled, default Active Directory
attributes will be used for mapping. Leave disabled if connecting to
.I openldap.
.TP
.B ldap_uri
The LDAP URI to connect to.
.TP
.B ldap_base
The base to perform LDAP searches under.
.TP
.B ldap_filter
The search filter to use when querying.
.TP
.B ldap_scope
The search scope to use. Defaults to
.I one
Valid options:
.I sub[tree]
.I one[level]
.I base
.TP
.B ldap_bind_dn
The bind DN to use when connecting to LDAP. Empty string is an
anonymous bind. Defaults to the empty string.
.TP
.B ldap_bind_password
The bind password to use when connecting to LDAP. Empty string is
used for anonymous binds. Defaults to the empty string.
.TP
.B ldap_timelimit
Timelimit in seconds for search results to return. \-1 means no limit.
Defaults to \-1.
.TP
.B ldap_retry_max
Number of retries on soft failures before giving up. Defaults to 3.
.TP
.B ldap_retry_delay
Delay in seconds between retries. Defaults to 5.
.TP
.B ldap_tls_require_cert
Sets expectations for SSL certificates, using TLS. One
of 'never', 'hard', 'demand', 'allow', or 'try' ('demand'
is the default). See \fBldap.conf\fP(5) for more information.
.TP
.B ldap_tls_cacertdir
Directory for trusted CA certificates. By default, the system's
default CA certificate directory will be used.
.TP
.B ldap_tls_cacertfile
Filename containing trusted CA certificates.
.TP
.B ldap_tls_certfile
Filename of an optional LDAP client certificate. If specified,
\fBldap_tls_keyfile\fP must also be specified.
.TP
.B ldap_tls_keyfile
Filename of an optional LDAP client key. Only plaintext (unencrypted) keys are
currently supported. If specified, \fBldap_tls_certfile\fP must also be
specified.
.TP
.B ldap_tls_starttls
Set to 1 to enable STARTTLS. Leave absent to disable.
.TP
.B ldap_uidattr
The uid-like attribute in your directory. Defaults to uid.
.TP
.B ldap_use_rid
If enabled (set to 1) the relative identifier (RID) wll be used for mapping.
By default \fBuidNumber\fP and \fBgidNumber\fP will be mapped when connecting to OpenLDAP with a POSIX-like schema.
When using Samba4 AD, these attributes won't exist.
Leave disabled for default.
It has no effect if the option \fBldap_ad\fP is enabled.
.TP
.B ldap_offset
Default Offset option to map uidNumber and gidNumber to higher number.
This can be useful to avoid conflict with already existing uidNumber and gidNumber.
.TP
.B ldap_uidregex
A Python regex to extract uid components from the uid-like attribute.
All matching groups are concatenated without spaces.
For example: '(.*)@example.com' would return a uid to the left of
the @example.com domain. Default is no regex.
.TP
.B ldap_groupregex
A Python regex to extract group member components from the member or
memberOf attributes. All matching groups are concatenated without spaces.
For example: '(.*)@example.com' would return a member without the
the @example.com domain. Default is no regex.
.TP
.B ldap_nested_groups
To enable expansion of nested groups, set this to 1. Note that this only
applies during a full sync, and incremental synchronization should not be used
if this is set.
.TP
.B ldap_override_shell
If specified, set every user's login shell to the given one. May be
useful on bastion hosts or to ensure uniformity. Enable for
Active Directory since the attribute (loginShell) is not default.
.TP
.B ldap_home_dir
Set a home directory for all users in passwd. If enabled (set to 1),
all users will have their home directory in
.I /home.
.TP
.B ldap_rfc2307bis
Default uses rfc2307 schema. If rfc2307bis (groups stored as a list of DNs
in 'member' attr), set this to 1.
.TP
.B ldap_debug
Sets the debug level for the underlying C library. Defaults to no logging.
.SH s3 SOURCE OPTIONS
These options configure the behaviour of the
.I s3
source.
.TP
.B s3_bucket
AWS S3 bucket containing
.I passwd, group, shadow
objects.
.B boto3
python package should be installed to use this type of source.
It is highly recommended to use s3 source only with AWS IAM role
attached to the ec2 instance configured for read-only access to the bucket.
So no extra configuration options like access_key and secret provided in config.
Though they may be used via ~/.aws/config and ~/.aws/credentials because python
boto3 library used in implementation is capable to read them by itself.
.TP
.B s3_passwd_object
Object containing
.B passwd
array of records in json format. E.g.
.I [{"Value": {"gid": 10000, "uid": 10000}, "Key": "user1"}].
Valid attributes:
.I "comment", "home", "shell", "passwd", "gid", "uid"
.TP
.B s3_group_object
Object containing
.B group
array of records in json format. E.g.
.I [{"Value": {"gid": 20000, "members": "user1\\nuser2\\nuser3"}, "Key": "group1"}].
Valid attributes:
.I "gid", "members"
Members should be sequence of usernames split by \\n (see example above)
.TP
.B s3_shadow_object
Object containing
.B shadow
array of records in json format. E.g.
.I [{"Value": {"passwd": "*"}, "Key": "user1"}].
Valid attributes:
.I "passwd", "lstchg", "min", "max", "warn", "inact", "expire"
.TP
.B s3_sshkey_object
Object containing
.B sshkey
array of records in json format. E.g.
.I [{"Value": {"sshPublicKey": "ssh-rsa ..."}, "Key": "user1"}].
Valid attributes:
.I "sshPublicKey"
.SH http SOURCE OPTIONS
These options configure the behaviour of the
.I http
source.
.TP
.B http_passwd_url
URL for an HTTP endpoint that returns a file containing
.B passwd
records in the standard format. E.g.
.I root:*:0:0:System Administrator:/var/root:/bin/sh
.TP
.B http_group_url
URL for an HTTP endpoint that returns a file containing
.B group
records in the standard format. E.g.
.I users:x:100:memberships....
.TP
.B http_shadow_url
URL for an HTTP endpoint that returns a file containing
.B shadow
records in the standard format. E.g.
.I root:*:18866:0:99999:7:::
.TP
.B http_sshkey_url
URL for an HTTP endpoint that returns a file containing
.B sshkey
records in the standard format. E.g.
.I root:ssh-rsa ...
.SH files CACHE OPTIONS
These options configure the behaviour of the
.I files
cache.
.TP
.B files_dir
Directory location to store the plain text files in. Defaults to the
current directory.
.TP
.B files_cache_filename_suffix
A suffix appended to the cache filename to differentiate it from, say,
system NSS databases. Defaults to '.cache'.
.TP
.B files_local_automount_master
A yes/no field only used for automount maps. A 'yes' value will cause nsscache
to update the auto.master file with the master map from the source. A 'no'
value will cause nsscache to leave auto.master alone, allowing the system to
manage this file in other ways. When set to 'no', nsscache will only update
other automount maps defined both locally and in the source. Defaults to 'yes'.
.TP
.B prefix
A regular expression to capture a prefix, or mount point.
.TP
.B suffix
A regular expression to modify the prefix.
.SH EXAMPLE
A typical example might look like this:
[DEFAULT]
source = ldap
cache = files
maps = passwd, group, shadow
ldap_uri = ldap://ldap.example.com
ldap_base = ou=People,dc=example,dc=com
ldap_filter = (objectclass=posixAccount)
files_dir = /etc
files_cache_filename_suffix = cache
[group]
ldap_base = ou=Group,dc=example,dc=com
ldap_filter = (objectclass=posixGroup)
ldap_nested_groups = 1
[shadow]
ldap_filter = (objectclass=posixAccount)
And a complementary \fI\|/etc/nsswitch.conf\|\fP might look like this:
passwd: files cache
group: files cache
shadow: files cache
.SH gcs SOURCE OPTIONS
These options configure the behaviour of the
.I gcs
source.
.TP
.B gcs_bucket
Google Cloud Storage bucket containing
.I passwd, group, shadow
blobs.
.B gcs_passwd_object
Name for a object containing
.B passwd
records in the standard format. E.g.
.I root:*:0:0:System Administrator:/var/root:/bin/sh
.B gcs_group_object
Name for a object containing
.B group
records in the standard format E.g.
.I users:x:100:memberships....
.B gcs_shadow_object
Name of the object containing
.B shadow
records in the standard format. E.g.
.I root:*:18866:0:99999:7:::
.SH FILES
.TP
\fI\|/etc/nsscache.conf\|\fP
The system-wide nsscache configuration file
.SH "SEE ALSO"
.TP
\fInsscache\fP(1)
.TP
\fInsswitch.conf\fP(5)
The system name service switch configuration file
.TP
\fIldap.conf\fP(5)
Details on LDAP configuration options exposed by the LDAP client libraries.
.SH AUTHOR
Written by Jamie Wilkinson (jaq@google.com) and Vasilios Hoffman (vasilios@google.com).
.TP
The source code lives at https://github.com/google/nsscache
.SH COPYRIGHT
Copyright \(co 2007 Google, Inc.
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.