1 .\" $NetBSD: syslog.conf.5,v 1.17 2010/01/01 21:26:18 mbalmer Exp $
3 .\" Copyright (c) 1990, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" from: @(#)syslog.conf.5 8.1 (Berkeley) 6/9/93
43 file is the configuration file for the
46 It consists of extended options (lines with one key="value" assignment)
47 and blocks of lines separated by
51 specifications, with each line containing two fields: the
53 field which specifies the types of messages and priorities to which the
56 field which specifies the action to be taken if a message
58 receives matches the selection criteria.
61 field is separated from the
63 field by one or more tab characters.
72 an optional set of comparison flags
73 .Pq Bo ! Bc Bq \*[Lt]=\*[Gt] ,
76 with no intervening white-space.
85 describes the part of the system generating the message, and is one of
86 the following keywords: auth, authpriv, cron, ftp, daemon, kern, lpr,
87 mail, mark, news, syslog, user, uucp and local0 through local7.
88 These keywords (with the exception of mark) correspond to the
91 values specified to the
99 may be used to specify exactly what levels are logged.
100 If unspecified, the default comparison is
102 .Pq greater than or equal to ,
109 Comparison flags beginning with
111 will have their logical sense inverted.
114 means all levels except info and
116 has the same meaning as
121 describes the severity of the message, and is a keyword from the
122 following ordered list (higher to lower): emerg, alert, crit, err,
123 warning, notice, info and debug.
124 These keywords correspond to the
127 values specified to the
131 Each block of lines is separated from the previous block by a
136 A block will only log messages corresponding to the most recent
140 specifications given.
141 Consider the case of a block that selects
145 directly followed by a block that selects messages from the
148 The second block will log only messages from the
150 program from the host
155 specification of the form
159 will cause subsequent blocks to be applied to messages logged by the
163 specification of the form
167 will cause subsequent blocks to be applied to messages logged by programs
168 other than the ones specified.
171 specification of the form
177 Program selectors may also match kernel-generated messages.
178 For example, a program specification of
180 will match kernel-generated messages of the form
181 .Ql subsys: here is a message .
182 The special specification
184 will cause subsequent blocks to apply to all programs.
188 specification of the form
192 will cause subsequent blocks to be applied to messages received from
196 specification of the form
200 will cause subsequent blocks to be applied to messages from hosts other
201 than the ones specified.
202 If the hostname is given as
204 the local hostname will be used.
205 The special specification
207 will cause subsequent blocks to apply to all hosts.
211 for a further descriptions of both the
215 keywords and their significance.
216 It is preferred that selections be made based on
220 since the latter can vary in a networked environment.
221 However, there are cases where a
223 may be too broadly defined.
225 If a received message matches the specified
230 and the first word in the message after the date matches the
232 the action specified in the
238 may be specified for a single
240 by separating them with semicolon
243 It is important to note, however, that each
245 can modify the ones preceding it.
249 may be specified for a single
251 by separating them with comma
257 can be used to specify all
265 receives a message at priority
270 This is not enabled by a
272 field containing an asterisk.
277 disables a particular
282 field of each line specifies the action to be taken when the
284 field selects a message.
285 There are five forms:
288 A pathname (beginning with a leading slash).
289 Selected messages are appended to the file.
291 To ensure that kernel messages are written to disk promptly,
295 after writing messages from the kernel.
296 Other messages are not synced explcitly.
297 You may disable syncing of files specified to receive kernel messages
298 by prefixing the pathname with a minus sign
300 Note that use of this option may cause the loss of log information in
301 the event of a system crash immediately following the write attempt.
302 However, using this option may prove to be useful if your system's
303 kernel is logging many messages.
305 Normally the priority and version is not written to file.
306 In order to use syslog-sign you may prefix a pathname with the plus sign
308 If both switches are used the order has to be
311 A hostname (preceded by an at
314 Selected messages are forwarded to the
316 program on the named host with UDP.
318 A hostname preceded by an at
320 sign and enclosed in brackets
323 Selected messages are forwarded with TLS to the
325 program on the named host.
326 After the closing bracket a colon
328 and a port or service name may be appended.
329 Additional options are configured in parantheses in the form of key="value".
330 Recognized keywords are
337 A comma separated list of users.
338 Selected messages are written to those users
339 if they are logged in.
342 Selected messages are written to all logged-in users.
346 followed by a command to which to pipe the selected messages.
347 The command string is passed to
349 for evaluation, so the usual shell metacharacters or input/output
350 redirection can occur.
351 (Note that redirecting
353 buffered output from the invoked command can cause additional delays,
354 or even lost output data in case a logging subprocess exits with a
356 The command itself runs with
365 will close the pipe to the process.
366 If the process does not exit voluntarily, it will be sent a
368 signal after a grace period of up to 60 seconds.
370 The command will only be started once data arrives that should be
372 If the command exits, it will be restarted as necessary.
374 If it is desired that the subprocess should receive exactly one line of
375 input, this can be achieved by exiting after reading and processing the
377 A wrapper script can be used to achieve this effect, if necessary.
378 Note that this method can be very resource-intensive if many log messages
379 are being piped through the filter.
381 Unless the command is a full pipeline, it may be useful to
382 start the command with
384 so that the invoking shell process does not wait for the command to
386 Note that the command is started with the UID of the
388 process, normally the superuser.
390 Just like with files a plus sign
392 will leave the priority and version information intact.
395 Blank lines and lines whose first non-blank character is a hash
397 character are ignored.
399 Additional options are used for TLS configuration:
402 Enables TLS server mode.
404 Service name or port number to bind to.
407 .Em As long as no official port is assigned this option is required
410 Hostname or IP to bind to.
412 Automatically generate a private key and certificate.
414 File with private key.
416 .Sq /etc/openssl/default.key
418 File with certificate to use.
420 .Sq /etc/openssl/default.crt
422 File with CA certificate to use.
424 Directory containing CA certificates.
428 then certificate authentication is skipped.
429 .It Em tls_allow_fingerprints
430 List of fingerprints of trusted client certificates.
431 .It Em tls_allow_clientcerts
432 List of filenames with trusted client certificates.
434 .Sh "TLS AUTHENTICATION"
435 One function of TLS is mutual authentication of client and server.
436 Unless authentication is disabled by setting
438 the following rules are used:
440 A client can be configured not to check a server's certificate by setting the
445 If the server's certificate is signed by a trusted CA then it is checked
446 if its hostname or IP is given in its certificate (as a CommonName, as a
447 DNS SubjectAltName, or as an IP SubjectAltName).
448 If any match is found then the server is authenticated.
451 parameter is given then it is can satisfy this test as well.
452 This allows DNS-independent configurations using the server's IP address in the
453 destination and adding its hostname as
455 to authenticate the TLS connection without having to add the IP to the X.509
458 If no CA is used or no trust path between CA and server certificate exists, then
459 hash value of the server's certificate is compared with the hash given in
461 and the hash of the certificate in
463 If the hashes are equal then the server is authenticated.
465 If using a CA and the client's certificate is signed by it then the client is
467 Otherwise the hash of the client's certificate is compared with the hashes given
469 .Ar tls_allow_fingerprints
470 and the hashes of the certificates given in
471 .Ar tls_allow_clientcerts .
472 On any match the client is authenticated.
475 is able to buffer temporary not writeable messages in memory.
476 To limit the memory consumed for this buffering the following optons may be
479 .It Em file_queue_length
480 .It Em pipe_queue_length
481 .It Em tls_queue_length
482 The maximum number of messages buffered for one destination of type tls, file,
483 or pipe respectively.
490 .It Em file_queue_size
491 .It Em pipe_queue_size
492 .It Em tls_queue_size
493 The maximum memory usage in bytes of messages buffered for one destination.
502 is able to digitally sign all processed messages.
503 The used protocol is defined by RFC nnnn (syslog-sign):
504 at the start of a session the signing sender sends so called certificate
505 blocks containing its public key; after that it periodically sends a signed
506 message containing hashes of previous messages.
508 To detect later manipulation one has to keep a copy of the key used for
509 signing (otherwise an attacker could alter the logs and sign them with his
511 If TLS is used with a DSA key then the same key will be used for signing.
512 This is the recommended setup because it makes it easy to have copies of
513 the certificate (with the public key) in backups.
514 Otherwise new keys are generated on every restart and for certain verification
515 it is necessary to have copies of all used keys.
516 So logging only to a local file is not secure; at least the used keys should
517 be logged to another host.
521 Set this option to enable syslog-sign and select how to assign
522 messages to signature groups (subsets of messages that are signed together).
523 To enable later signature verification and detection of lost messages the
524 assignment should be chosen such that all messages of one signature group
525 are written to the same file.
526 Four possible values for this option are:
527 .Bl -hang -offset indent
529 Use one global signature group for all messages.
531 Use one signature group per priority.
533 Use signature groups for ranges of priorities.
535 Use one signature group per destination.
536 This is a custom strategy not defined by the standard.
537 With this setting one signature group is set up for
538 every file and network action.
540 .It Em sign_delim_sg2
541 This option is only evaluated with
543 and allows to configure the priority ranges for signature groups.
544 The parameters are numerical values used as the maximum priority for one group.
545 The default is to use one signature groups per facility, which is equal to
547 .Sq sign_delim_sg2=7 15 23 31 39 ... .
550 .Bl -tag -width /etc/syslog.conf -compact
551 .It Pa /etc/syslog.conf
555 .It Pa /usr/share/examples/syslogd/verify.pl
556 Example script to verify message signatures.
557 (Requires Perl and modules not part of NetBSD.)
560 A configuration file might appear as follows:
562 # Log all kernel messages, authentication messages of
563 # level notice or higher and anything of level err or
564 # higher to the console.
565 # Don't log private authentication messages!
566 *.err;kern.*;auth.notice;authpriv.none /dev/console
568 # Log anything (except mail) of level info or higher.
569 # Don't log private authentication messages!
570 *.info;mail.none;authpriv.none /var/log/messages
572 # Log daemon messages at debug level only
573 daemon.=debug /var/log/daemon.debug
575 # The authpriv file has restricted access.
576 # Write logs with priority for later verification with syslog-sign.
577 authpriv.* +/var/log/secure
579 # Log all the mail messages in one place.
580 mail.* /var/log/maillog
582 # Everybody gets emergency messages, plus log them on another
585 *.emerg @arpa.berkeley.edu
587 # Log all messages of level info or higher to another
588 # machine using TLS with an alternative portname and a
589 # fingerprint for athentication
590 *.info @[logserver]:1234(fingerprint="SHA1:01:02:...")
592 # Root and Eric get alert and higher messages.
595 # Save mail and news errors of level err and higher in a
597 mail,news.err /var/log/spoolerr
599 # Pipe all authentication messages to a filter.
600 auth.* |exec /usr/local/sbin/authfilter
602 # Log kernel messages to a separate file without syncing each message.
603 kern.* -/var/log/kernlog
605 # Save ftpd transactions along with mail and news.
607 *.* /var/log/spoolerr
609 # Send all error messages from a RAID array through a filter.
611 kern.err |exec /usr/local/sbin/raidfilter
613 # Save pppd messages from dialhost to a separate file.
616 *.* /var/log/dialhost-pppd
618 # Save non-local log messages from all programs to a separate file.
623 # Generate digital signatures for all messages
624 # to each file or network destination.
638 The effects of multiple selectors are sometimes not intuitive.
646 or higher, not at the level of