Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ././../../../../../../usr/man/man8/pflogd.8
Real path: /usr/share/man/man8/pflogd.8
Zurück
'\" te .\" $OpenBSD: pflogd.8,v 1.46 2014/01/21 03:15:45 schwarze Exp $ .\" .\" Copyright (c) 2001 Can Erkin Acar. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd $Mdocdate: January 21 2014 $ .Dt PFLOGD 8 .Os .Sh NAME .Nm pflogd .Nd packet filter logging daemon .Sh SYNOPSIS .Nm pflogd .Bk -words .Op Fl C Ar new-pflog-instance-name | Fl c Ar pflog-instance-name .Op Fl d Ar delay .Op Fl f Ar filename .Op Fl i Ar interface .Op Fl s Ar snaplen .Op Ar expression .Ek .Sh DESCRIPTION .Nm is a background daemon which reads packets logged by .Xr pf 4 to a dedicated capture link interface (see .Xr dladm 1M for details), normally .Pa pflog0 , and writes the packets to a logfile (normally .Pa /var/log/firewall/pflog/pflog0.pkt ) in libpcap format (see .Xr PCAP 3pcap for details). These logs can be reviewed later using the .Fl r option of .Xr tcpdump 8 , hopefully offline in case there are bugs in the packet parsing code of .Xr tcpdump 8 . .Pp .Nm closes and then re-opens the log file when it receives .Dv SIGHUP , permitting convenient log rotation. .Dv SIGALRM causes .Nm to flush the current logfile buffers to the disk, thus making the most recent logs available. The buffers are also flushed every .Ar delay seconds. .Pp If the log file contains data after a restart or a .Dv SIGHUP , new logs are appended to the existing file. If the existing log file was created with a different snaplen, .Nm temporarily uses the old snaplen to keep the log file consistent. .Pp .Nm tries to preserve the integrity of the log file against I/O errors. Furthermore, integrity of an existing log file is verified before appending. If there is an invalid log file or an I/O error, the log file is moved out of the way and a new one is created. If a new file cannot be created, logging is suspended until a .Dv SIGHUP or a .Dv SIGALRM is received. .Pp .Nm will also log the pcap statistics for the capture link interface to syslog when a .Dv SIGUSR1 is received. .Pp The options are as follows: .Bl -tag -width Ds .It Fl C Ar new-pflog-instance-name Creates a new .Nm instance with the specified name. If additional options are used to specify configuration, it is stored into the .Xr smf 7 repository. Default values are used for .Xr smf 7 properties unless overriden by a command-line option. The exception is pflog/interface (set to equal the instance name) and pflog/logfile (set to a file with name equal to the instance name followed by the .Pa .pkt extension located inside the .Pa /var/log/firewall/pflog/ directory) if the service instance name forms a valid linkname. If the service instance name is not a valid linkname, the values must be given explicitly. .It Fl c Ar pflog-instance-name Shows/changes the configuration of the given .Nm instance in .Xr smf 7 repository. Attributes specified by additional options are placed into the .Xr smf 7 repository. .It Fl d Ar delay Time in seconds to delay between automatic flushes of the file. This may be specified with a value between 5 and 3600 seconds. If not specified, the default is 60 seconds. .It Fl f Ar filename Log output filename. When neither .Fl C nor .Fl c is used, the default value .Pa pflog.pkt is used. .It Fl i Ar interface Specifies the capture link interface to use. When neither .Fl C nor .Fl c is used, the default value .Pa pflog0 is assumed. .It Fl s Ar snaplen Analyze at most the first .Ar snaplen bytes of data from each packet rather than the default of 160. The default of 160 is adequate for IP, ICMP, TCP, and UDP headers but may truncate protocol information for other protocols. Other file parsers may desire a higher snaplen. .It Ar expression Selects which packets will be dumped, using the regular language of .Xr tcpdump 8 . Tcpdump has been extended to be able to filter on the pfloghdr structure defined in .Aq Ar net/if_pflog.h . It can restrict the output to packets logged on a specified interface, a rule number, a reason, a direction, an IP family or an action. .Pp .Bl -tag -width "ruleset authpfXXX" -offset 3n -compact .It ip Address family equals IPv4. .It ip6 Address family equals IPv6. .It ifname kue0 Interface name equals "kue0". .It on kue0 Interface name equals "kue0". .It ruleset authpf Ruleset name equals "authpf". .It rulenum 10 Rule number equals 10. .It reason match Reason equals match. Also accepts "bad-offset", "fragment", "short", "normalize", "memory", "bad-timestamp", "congestion", "ip-option", "proto-cksum", "state-mismatch", "state-insert", "state-limit", "src-limit", and "synproxy". .It action pass Action equals pass. Also accepts "block" and "match". .It inbound The direction was inbound. .It outbound The direction was outbound. .El .El .Sh SOLARIS The .Nm daemon must be started as an .Xr smf 7 service with the following FMRI: .Bd -literal -offset indent svc:/network/firewall/pflog .Ed .Pp Command line options described above are set via the following .Xr smf 7 properties. .Bl -tag -width "pflog/interface" -offset 3n -compact .It pflog/delay Automatic flush interval. The default value is 60. Used as the argument for the .Fl d option. .It pflog/filter Packet filter expression in .Xr tcpdump 8 format. No expression is defined by default. .It pflog/interface The capture link name from which to read packets. Used as the argument for the .Fl i option. .It pflog/logfile Path to the logfile (for security reasons, only paths starting by the .Pa /var/log/firewall/ directory are allowed. Used as the argument for the .Fl f option. .It pflog/snaplen An upper bound on how many bytes from each packet to analyze. The default value is 160. Used as the argument for the .Fl s option. .El .Pp The start method creates a (temporal) capture link the particular instance is using. .Pp The refresh method sends .Dv SIGHUP to .Nm owned by particular service instance. .Sh EXAMPLES Log specific TCP packets to a different log file with a large snaplen (useful with a .Qq log all rule to dump complete sessions): .Bd -literal -offset indent # pflogd -s 1600 -f suspicious.log port 80 and host evilhost .Ed .Pp Log from another capture link interface, excluding specific packets: .Bd -literal -offset indent # pflogd -i pflog3 -f network3.log "not (tcp and port 23)" .Ed .Pp Display binary logs: .Bd -literal -offset indent # tcpdump -n -e -ttt -r /var/log/firewall/pflog/pflog3.pkt .Ed .Pp Display the logs in real time (this does not interfere with the operation of .Nm ) : .Bd -literal -offset indent # tcpdump -n -e -ttt -i pflog0 .Ed .Pp Display the logs in real time of inbound packets that were blocked on the wi0 interface: .Bd -literal -offset indent # tcpdump -n -e -ttt -i pflog0 inbound and action block and on wi0 .Ed .Sh SECURITY The .Nm daemon is a privilege-aware application which runs as the .Dq daemon user possessing .Sy PRIV_NET_OBSERVABILITY privilege that is required for using .Xr bpf 7d to read packets. See .Xr privileges 7 for details. The service start method uses .Xr dladm 8 to create capture link if it does not exist already. .Pp To configure the .Nm service one has to obtain the .Sy solaris.smf.value.network.firewall authorization. To manage the service (disable/enable/refresh) one must have the .Sy solaris.smf.manage.network.firewall authorization. Both authorizations are granted through the Network Firewall Management profile. To create new service instances, you need the solaris.smf.modify authorization. .\" Oracle has added the ARC stability level to this manual page .Sh ATTRIBUTES See .Xr attributes 7 for descriptions of the following attributes: .sp .TS box; cbp-1 | cbp-1 l | l . ATTRIBUTE TYPE ATTRIBUTE VALUE = Availability network/firewall/firewall-pflog = Stability Volatile .TE .Pp .Sh SEE ALSO .Xr pcap 3 , .Xr pf.conf 5 , .Xr privileges 7 , .Xr smf 7 , .Xr tcpdump 8 .Sh HISTORY The .Nm command appeared in .Ox 3.0 . The Solaris version is based on .Nm found in OpenBSD 5.5. .Sh AUTHORS .Nm was written by .An Can Erkin Acar Aq Mt canacar@openbsd.org . .Sh NOTES .\" Oracle has added source availability information to this manual page Source code for open source software components in Oracle Solaris can be found at https://www.oracle.com/downloads/opensource/solaris-source-code-downloads.html. This software was built from source available at https://github.com/oracle/solaris-userland. The original community source was downloaded from http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/pflogd/. Further information about this software can be found on the open source community website at http://www.openbsd.org.