~ubuntu-branches/ubuntu/feisty/tcpspy/feisty

« back to all changes in this revision

Viewing changes to debian/tcpspy.rules.5

  • Committer: Bazaar Package Importer
  • Author(s): Pablo Lorenzzoni
  • Date: 2002-01-25 00:00:00 UTC
  • Revision ID: james.westby@ubuntu.com-20020125000000-acrs0yl4g2xchacd
Tags: 1.7d-1
* Fixes a crash with an empty ruleset.
* Fixes the split rule problem.
* Fixes the /proc/net/tcp incompatibility problem (Closes: #115613).
* The upstream said that he is out of time to release v2.0, so he'll
  get the 1.x series a little far than originally expected.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" This file is part of tcpspy Debian package, a TCP/IP connection monitor.
 
2
.\" In truth this is just an snipped version of tcpspy manpage, which is
 
3
.\" copyrighted by Tim J. Robbins under the same terms below.
 
4
.\"
 
5
.\" Copyright (c) 2001 Pablo Lorenzzoni. 
 
6
.\" All rights reserved.
 
7
.\" 
 
8
.\" Redistribution and use in source and binary forms, with or without
 
9
.\" modification, are permitted provided that the following conditions
 
10
.\" are met:
 
11
.\" 1. Redistributions of source code must retain the above copyright
 
12
.\"    notice, this list of conditions and the following disclaimer.
 
13
.\" 2. Redistributions in binary form must reproduce the above copyright
 
14
.\"    notice, this list of conditions and the following disclaimer in the
 
15
.\"    documentation and/or other materials provided with the distribution.
 
16
.\" 3. The name of the author may not be used to endorse or promote products
 
17
.\"    derived from this software without specific prior written permission.
 
18
.\" 
 
19
.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 
20
.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 
21
.\" AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
 
22
.\" THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
23
.\" EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
24
.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 
25
.\" OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
26
.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 
27
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
28
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
29
.\"
 
30
.\" $Id: tcpspy.rules.5,v 1.33 2001/01/28 13:09:12 fyre Exp $
 
31
.TH TCPSPY.RULES 5 "April 2001" Spectra "tcpspy.rules"
 
32
.SH NAME
 
33
tcpspy.rules \- configuration file for tcpspy
 
34
.SH DESCRIPTION
 
35
.LP
 
36
This file, by default
 
37
.IR /etc/tcpspy.rules ,
 
38
is read by the
 
39
.IR /etc/init.d/tcpspy 
 
40
script at init time in order to configure
 
41
tcpspy (see tcpspy(8)) logger filtering rules.
 
42
.LP
 
43
It might look like:
 
44
.IP
 
45
.nf
 
46
# /etc/tcpspt.rules example
 
47
user "joedoe" and rport 22 and raddr 192.168.1.10
 
48
user 1003
 
49
lport 22 or lport 21
 
50
(lport 23 and user "joedoe") or raddr 192.168.1.20
 
51
.fi
 
52
.LP
 
53
This rules file specifies that tcpspy logs tcp connections according
 
54
to 4 rules (line 1 to line 4 - one per each line) using the boolean
 
55
logic (see below) to evaluate each rule.
 
56
.LP
 
57
This particular example logs conections:
 
58
.TP
 
59
line 1 - for user "joedoe" connecting to 192.168.1.10:22 (remote)
 
60
.TP
 
61
line 2 - for user whose UID is 1003
 
62
.TP
 
63
line 3 - to localhost:22 or localhost:21
 
64
.TP
 
65
line 4 - for user "joedoe" to localhost:23 or to 192.168.1.20 (remote)
 
66
.LP
 
67
Everything from an "#" signal and the end of the line will not be evaluated.
 
68
.LP
 
69
.PP
 
70
.SS "Rule Syntax - just extracted from tcpspy(8)"
 
71
A rule may be specified with the following comparison operators:
 
72
.TP
 
73
.BI user " uid"
 
74
True if the local user initiating or accepting the connection has the
 
75
.B effective
 
76
user id
 
77
.IR uid .
 
78
.TP
 
79
.BI user " \N'34'username\N'34'"
 
80
Same as above, but using a username instead of a user id.
 
81
.TP
 
82
.BI lport " port"
 
83
True if the local end of the connection has port number
 
84
.IR port .
 
85
.TP
 
86
.BI lport " [low] - [high]"
 
87
True if the local end of the connection has a port number
 
88
greater than or equal to
 
89
.I low
 
90
and less than or equal to
 
91
.IR high .
 
92
If the form
 
93
.I low-
 
94
is used, high is assumed to be 65535.
 
95
If the form
 
96
.I -high
 
97
is used, low is assumed to be 0. It is an error to omit both
 
98
.IR low " and " high .
 
99
.TP
 
100
.BI lport " \N'34'service\N'34'"
 
101
Same as above, but using a service name from
 
102
.I /etc/services
 
103
instead of a port number.
 
104
.TP
 
105
.B rport
 
106
Same as
 
107
.B lport
 
108
but compares the port number of the remote end of the connection.
 
109
.TP
 
110
.BI laddr " n.n.n.n[/m.m.m.m]"
 
111
Interpreted as a "net/mask" expression; true if "net" is equal to the bitwise
 
112
AND of the local address of the connection and "mask". If no mask is specified,
 
113
a default mask with all bits set (255.255.255.255) is used.
 
114
.TP
 
115
.B raddr
 
116
Same as
 
117
.B laddr
 
118
but compares the remote address.
 
119
.TP
 
120
.BI exe " \N'34'pattern\N'34'"
 
121
True if the full filename (including directory) of the executable that 
 
122
created/accepted the connection matches
 
123
.IR pattern ,
 
124
a
 
125
.BR glob (7)-style
 
126
wildcard pattern.
 
127
.IP
 
128
The pattern "" (an empty string) matches connections created/accepted by 
 
129
processes whose executable filename is unknown.
 
130
.IP
 
131
If the
 
132
.B -p
 
133
option is not specified, a warning message will be printed, and the result of
 
134
this comparison will always be true.
 
135
.PP
 
136
Expressions (including the  comparisons listed above) may be joined together
 
137
with the following logical operations:
 
138
.TP
 
139
.IB expr1 " or " expr2
 
140
True if either of
 
141
.I expr1
 
142
or
 
143
.I expr2
 
144
are true (logical OR).
 
145
.TP
 
146
.IB expr1 " and " expr2
 
147
True if both
 
148
.I expr1
 
149
and
 
150
.I expr2
 
151
are true (logical AND).
 
152
.TP
 
153
.BI not " expr"
 
154
True if
 
155
.I expr
 
156
is false (logical NOT).
 
157
.PP
 
158
Rules are evaluated from left to right. Whitespace (space, tab and newline)
 
159
characters are ignored between "words". Rules consisting of only whitespace
 
160
match no connections, but do not cause an error.
 
161
Parentheses, '(' and ')' may be placed around expressions to affect the order
 
162
of evaluation.
 
163
.PP
 
164
.SS "Examples"
 
165
.TP
 
166
These are some sample rules which further demonstrate how they are constructed:
 
167
.TP
 
168
.nf
 
169
user "joe" and rport "ssh"
 
170
.fi
 
171
Log connections made by user "joe" for the service "ssh".
 
172
 
 
173
.TP
 
174
.nf
 
175
not raddr 10.0.0.0/255.0.0.0 and rport 25 and (user "bob" or user "joe")
 
176
.fi
 
177
Log connections made by users "bob" and "joe" to remote port 25 on machines
 
178
not on a fictional "intranet".
 
179
 
 
180
.SH AUTHOR
 
181
Tim J. Robbins (tcpspy),
 
182
Pablo Lorenzzoni (this manpage)
 
183
 
 
184
.SH SEE ALSO
 
185
.BR glob (7),
 
186
.BR proc (5),
 
187
.BR services (5),
 
188
.BR signal (7),
 
189
.BR syslog (3),
 
190
.BR tcpspy (8)