| 1 | '\" t
|
|---|
| 2 | .\" Title: smb_traffic_analyzer
|
|---|
| 3 | .\" Author: [see the "AUTHOR" section]
|
|---|
| 4 | .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
|
|---|
| 5 | .\" Date: 10/29/2012
|
|---|
| 6 | .\" Manual: System Administration tools
|
|---|
| 7 | .\" Source: Samba 3.6
|
|---|
| 8 | .\" Language: English
|
|---|
| 9 | .\"
|
|---|
| 10 | .TH "SMB_TRAFFIC_ANALYZER" "8" "10/29/2012" "Samba 3\&.6" "System Administration tools"
|
|---|
| 11 | .\" -----------------------------------------------------------------
|
|---|
| 12 | .\" * set default formatting
|
|---|
| 13 | .\" -----------------------------------------------------------------
|
|---|
| 14 | .\" disable hyphenation
|
|---|
| 15 | .nh
|
|---|
| 16 | .\" disable justification (adjust text to left margin only)
|
|---|
| 17 | .ad l
|
|---|
| 18 | .\" -----------------------------------------------------------------
|
|---|
| 19 | .\" * MAIN CONTENT STARTS HERE *
|
|---|
| 20 | .\" -----------------------------------------------------------------
|
|---|
| 21 | .SH "NAME"
|
|---|
| 22 | vfs_smb_traffic_analyzer \- log Samba VFS read and write operations through a socket to a helper application
|
|---|
| 23 | .SH "SYNOPSIS"
|
|---|
| 24 | .HP \w'\ 'u
|
|---|
| 25 | vfs objects = smb_traffic_analyzer
|
|---|
| 26 | .SH "DESCRIPTION"
|
|---|
| 27 | .PP
|
|---|
| 28 | This VFS module is part of the
|
|---|
| 29 | \fBsamba\fR(7)
|
|---|
| 30 | suite\&.
|
|---|
| 31 | .PP
|
|---|
| 32 | The
|
|---|
| 33 | vfs_smb_traffic_analyzer
|
|---|
| 34 | VFS module logs client file operations on a Samba server and sends this data over a socket to a helper program (in the following the "Receiver"), which feeds a SQL database\&. More information on the helper programs can be obtained from the homepage of the project at: http://holger123\&.wordpress\&.com/smb\-traffic\-analyzer/ Since the VFS module depends on a receiver that is doing something with the data, it is evolving in it\'s development\&. Therefore, the module works with different protocol versions, and the receiver has to be able to decode the protocol that is used\&. The protocol version 1 was introduced to Samba at September 25, 2008\&. It was a very simple protocol, supporting only a small list of VFS operations, and had several drawbacks\&. The protocol version 2 is a try to solve the problems version 1 had while at the same time adding new features\&. With the release of Samba 3\&.6\&.0, the module will run protocol version 2 by default\&.
|
|---|
| 35 | .SH "PROTOCOL VERSION 1 DOCUMENTATION"
|
|---|
| 36 | .PP
|
|---|
| 37 | vfs_smb_traffic_analyzer
|
|---|
| 38 | protocol version 1 is aware of the following VFS operations:
|
|---|
| 39 | .RS 4
|
|---|
| 40 | write
|
|---|
| 41 | .RE
|
|---|
| 42 | .RS 4
|
|---|
| 43 | pwrite
|
|---|
| 44 | .RE
|
|---|
| 45 | .RS 4
|
|---|
| 46 | read
|
|---|
| 47 | .RE
|
|---|
| 48 | .RS 4
|
|---|
| 49 | pread
|
|---|
| 50 | .RE
|
|---|
| 51 | .PP
|
|---|
| 52 | vfs_smb_traffic_analyzer
|
|---|
| 53 | sends the following data in a fixed format separated by a comma through either an internet or a unix domain socket:
|
|---|
| 54 | .sp
|
|---|
| 55 | .if n \{\
|
|---|
| 56 | .RS 4
|
|---|
| 57 | .\}
|
|---|
| 58 | .nf
|
|---|
| 59 | BYTES|USER|DOMAIN|READ/WRITE|SHARE|FILENAME|TIMESTAMP
|
|---|
| 60 |
|
|---|
| 61 | .fi
|
|---|
| 62 | .if n \{\
|
|---|
| 63 | .RE
|
|---|
| 64 | .\}
|
|---|
| 65 | .PP
|
|---|
| 66 | Description of the records:
|
|---|
| 67 | .sp
|
|---|
| 68 | .RS 4
|
|---|
| 69 | .ie n \{\
|
|---|
| 70 | \h'-04'\(bu\h'+03'\c
|
|---|
| 71 | .\}
|
|---|
| 72 | .el \{\
|
|---|
| 73 | .sp -1
|
|---|
| 74 | .IP \(bu 2.3
|
|---|
| 75 | .\}
|
|---|
| 76 | BYTES
|
|---|
| 77 | \- the length in bytes of the VFS operation
|
|---|
| 78 | .RE
|
|---|
| 79 | .sp
|
|---|
| 80 | .RS 4
|
|---|
| 81 | .ie n \{\
|
|---|
| 82 | \h'-04'\(bu\h'+03'\c
|
|---|
| 83 | .\}
|
|---|
| 84 | .el \{\
|
|---|
| 85 | .sp -1
|
|---|
| 86 | .IP \(bu 2.3
|
|---|
| 87 | .\}
|
|---|
| 88 | USER
|
|---|
| 89 | \- the user who initiated the operation
|
|---|
| 90 | .RE
|
|---|
| 91 | .sp
|
|---|
| 92 | .RS 4
|
|---|
| 93 | .ie n \{\
|
|---|
| 94 | \h'-04'\(bu\h'+03'\c
|
|---|
| 95 | .\}
|
|---|
| 96 | .el \{\
|
|---|
| 97 | .sp -1
|
|---|
| 98 | .IP \(bu 2.3
|
|---|
| 99 | .\}
|
|---|
| 100 | DOMAIN
|
|---|
| 101 | \- the domain of the user
|
|---|
| 102 | .RE
|
|---|
| 103 | .sp
|
|---|
| 104 | .RS 4
|
|---|
| 105 | .ie n \{\
|
|---|
| 106 | \h'-04'\(bu\h'+03'\c
|
|---|
| 107 | .\}
|
|---|
| 108 | .el \{\
|
|---|
| 109 | .sp -1
|
|---|
| 110 | .IP \(bu 2.3
|
|---|
| 111 | .\}
|
|---|
| 112 | READ/WRITE
|
|---|
| 113 | \- either "W" for a write operation or "R" for read
|
|---|
| 114 | .RE
|
|---|
| 115 | .sp
|
|---|
| 116 | .RS 4
|
|---|
| 117 | .ie n \{\
|
|---|
| 118 | \h'-04'\(bu\h'+03'\c
|
|---|
| 119 | .\}
|
|---|
| 120 | .el \{\
|
|---|
| 121 | .sp -1
|
|---|
| 122 | .IP \(bu 2.3
|
|---|
| 123 | .\}
|
|---|
| 124 | SHARE
|
|---|
| 125 | \- the name of the share on which the VFS operation occurred
|
|---|
| 126 | .RE
|
|---|
| 127 | .sp
|
|---|
| 128 | .RS 4
|
|---|
| 129 | .ie n \{\
|
|---|
| 130 | \h'-04'\(bu\h'+03'\c
|
|---|
| 131 | .\}
|
|---|
| 132 | .el \{\
|
|---|
| 133 | .sp -1
|
|---|
| 134 | .IP \(bu 2.3
|
|---|
| 135 | .\}
|
|---|
| 136 | FILENAME
|
|---|
| 137 | \- the name of the file that was used by the VFS operation
|
|---|
| 138 | .RE
|
|---|
| 139 | .sp
|
|---|
| 140 | .RS 4
|
|---|
| 141 | .ie n \{\
|
|---|
| 142 | \h'-04'\(bu\h'+03'\c
|
|---|
| 143 | .\}
|
|---|
| 144 | .el \{\
|
|---|
| 145 | .sp -1
|
|---|
| 146 | .IP \(bu 2.3
|
|---|
| 147 | .\}
|
|---|
| 148 | TIMESTAMP
|
|---|
| 149 | \- a timestamp, formatted as "yyyy\-mm\-dd hh\-mm\-ss\&.ms" indicating when the VFS operation occurred
|
|---|
| 150 | .RE
|
|---|
| 151 | .sp
|
|---|
| 152 | .RS 4
|
|---|
| 153 | .ie n \{\
|
|---|
| 154 | \h'-04'\(bu\h'+03'\c
|
|---|
| 155 | .\}
|
|---|
| 156 | .el \{\
|
|---|
| 157 | .sp -1
|
|---|
| 158 | .IP \(bu 2.3
|
|---|
| 159 | .\}
|
|---|
| 160 | IP
|
|---|
| 161 | \- The IP Address (v4 or v6) of the client machine that initiated the VFS operation\&.
|
|---|
| 162 | .RE
|
|---|
| 163 | .sp
|
|---|
| 164 | .RE
|
|---|
| 165 | .PP
|
|---|
| 166 | This module is stackable\&.
|
|---|
| 167 | .SH "DRAWBACKS OF PROTOCOL VERSION 1"
|
|---|
| 168 | .PP
|
|---|
| 169 | Several drawbacks have been seen with protocol version 1 over time\&.
|
|---|
| 170 | .sp
|
|---|
| 171 | .RS 4
|
|---|
| 172 | .ie n \{\
|
|---|
| 173 | \h'-04'\(bu\h'+03'\c
|
|---|
| 174 | .\}
|
|---|
| 175 | .el \{\
|
|---|
| 176 | .sp -1
|
|---|
| 177 | .IP \(bu 2.3
|
|---|
| 178 | .\}
|
|---|
| 179 |
|
|---|
| 180 | Problematic parsing \-
|
|---|
| 181 | Protocol version 1 uses hyphen and comma to seperate blocks of data\&. Once there is a filename with a hyphen, you will run into problems because the receiver decodes the data in a wrong way\&.
|
|---|
| 182 | .RE
|
|---|
| 183 | .sp
|
|---|
| 184 | .RS 4
|
|---|
| 185 | .ie n \{\
|
|---|
| 186 | \h'-04'\(bu\h'+03'\c
|
|---|
| 187 | .\}
|
|---|
| 188 | .el \{\
|
|---|
| 189 | .sp -1
|
|---|
| 190 | .IP \(bu 2.3
|
|---|
| 191 | .\}
|
|---|
| 192 |
|
|---|
| 193 | Insecure network transfer \-
|
|---|
| 194 | Protocol version 1 sends all it\'s data as plaintext over the network\&.
|
|---|
| 195 | .RE
|
|---|
| 196 | .sp
|
|---|
| 197 | .RS 4
|
|---|
| 198 | .ie n \{\
|
|---|
| 199 | \h'-04'\(bu\h'+03'\c
|
|---|
| 200 | .\}
|
|---|
| 201 | .el \{\
|
|---|
| 202 | .sp -1
|
|---|
| 203 | .IP \(bu 2.3
|
|---|
| 204 | .\}
|
|---|
| 205 |
|
|---|
| 206 | Limited set of supported VFS operations \-
|
|---|
| 207 | Protocol version 1 supports only four VFS operations\&.
|
|---|
| 208 | .RE
|
|---|
| 209 | .sp
|
|---|
| 210 | .RS 4
|
|---|
| 211 | .ie n \{\
|
|---|
| 212 | \h'-04'\(bu\h'+03'\c
|
|---|
| 213 | .\}
|
|---|
| 214 | .el \{\
|
|---|
| 215 | .sp -1
|
|---|
| 216 | .IP \(bu 2.3
|
|---|
| 217 | .\}
|
|---|
| 218 |
|
|---|
| 219 | No subreleases of the protocol \-
|
|---|
| 220 | Protocol version 1 is fixed on it\'s version, making it unable to introduce new features or bugfixes through compatible sub\-releases\&.
|
|---|
| 221 | .RE
|
|---|
| 222 | .SH "VERSION 2 OF THE PROTOCOL"
|
|---|
| 223 | .PP
|
|---|
| 224 | Protocol version 2 is an approach to solve the problems introduced with protcol v1\&. From the users perspective, the following changes are most prominent among other enhancements:
|
|---|
| 225 | .sp
|
|---|
| 226 | .RS 4
|
|---|
| 227 | .ie n \{\
|
|---|
| 228 | \h'-04'\(bu\h'+03'\c
|
|---|
| 229 | .\}
|
|---|
| 230 | .el \{\
|
|---|
| 231 | .sp -1
|
|---|
| 232 | .IP \(bu 2.3
|
|---|
| 233 | .\}
|
|---|
| 234 | The data from the module may be send encrypted, with a key stored in secrets\&.tdb\&. The Receiver then has to use the same key\&. The module does AES block encryption over the data to send\&.
|
|---|
| 235 | .RE
|
|---|
| 236 | .sp
|
|---|
| 237 | .RS 4
|
|---|
| 238 | .ie n \{\
|
|---|
| 239 | \h'-04'\(bu\h'+03'\c
|
|---|
| 240 | .\}
|
|---|
| 241 | .el \{\
|
|---|
| 242 | .sp -1
|
|---|
| 243 | .IP \(bu 2.3
|
|---|
| 244 | .\}
|
|---|
| 245 | The module now can identify itself against the receiver with a sub\-release number, where the receiver may run with a different sub\-release number than the module\&. However, as long as both run on the V2\&.x protocol, the receiver will not crash, even if the module uses features only implemented in the newer subrelease\&. If the module uses a new feature from a newer subrelease, and the receiver runs an older protocol, it is just ignoring the functionality\&. Of course it is best to have both the receiver and the module running the same subrelease of the protocol\&.
|
|---|
| 246 | .RE
|
|---|
| 247 | .sp
|
|---|
| 248 | .RS 4
|
|---|
| 249 | .ie n \{\
|
|---|
| 250 | \h'-04'\(bu\h'+03'\c
|
|---|
| 251 | .\}
|
|---|
| 252 | .el \{\
|
|---|
| 253 | .sp -1
|
|---|
| 254 | .IP \(bu 2.3
|
|---|
| 255 | .\}
|
|---|
| 256 | The parsing problems of protocol V1 can no longer happen, because V2 is marshalling the data packages in a proper way\&.
|
|---|
| 257 | .RE
|
|---|
| 258 | .sp
|
|---|
| 259 | .RS 4
|
|---|
| 260 | .ie n \{\
|
|---|
| 261 | \h'-04'\(bu\h'+03'\c
|
|---|
| 262 | .\}
|
|---|
| 263 | .el \{\
|
|---|
| 264 | .sp -1
|
|---|
| 265 | .IP \(bu 2.3
|
|---|
| 266 | .\}
|
|---|
| 267 | The module now potientially has the ability to create data on every VFS function\&. As of protocol V2\&.0, there is support for 8 VFS functions, namely write,read,pread,pwrite, rename,chdir,mkdir and rmdir\&. Supporting more VFS functions is one of the targets for the upcoming sub\-releases\&.
|
|---|
| 268 | .RE
|
|---|
| 269 | .sp
|
|---|
| 270 | .RE
|
|---|
| 271 | .PP
|
|---|
| 272 | To enable protocol V2, the protocol_version vfs option has to be used (see OPTIONS)\&.
|
|---|
| 273 | .SH "OPTIONS WITH PROTOCOL V1 AND V2.X"
|
|---|
| 274 | .PP
|
|---|
| 275 | smb_traffic_analyzer:mode = STRING
|
|---|
| 276 | .RS 4
|
|---|
| 277 | If STRING matches to "unix_domain_socket", the module will use a unix domain socket located at /var/tmp/stadsocket, if STRING contains an different string or is not defined, the module will use an internet domain socket for data transfer\&.
|
|---|
| 278 | .RE
|
|---|
| 279 | .PP
|
|---|
| 280 | smb_traffic_analyzer:host = STRING
|
|---|
| 281 | .RS 4
|
|---|
| 282 | The module will send the data to the system named with the hostname STRING\&.
|
|---|
| 283 | .RE
|
|---|
| 284 | .PP
|
|---|
| 285 | smb_traffic_analyzer:port = STRING
|
|---|
| 286 | .RS 4
|
|---|
| 287 | The module will send the data using the TCP port given in STRING\&.
|
|---|
| 288 | .RE
|
|---|
| 289 | .PP
|
|---|
| 290 | smb_traffic_analyzer:anonymize_prefix = STRING
|
|---|
| 291 | .RS 4
|
|---|
| 292 | The module will replace the user names with a prefix given by STRING and a simple hash number\&. In version 2\&.x of the protocol, the users SID will also be anonymized\&.
|
|---|
| 293 | .RE
|
|---|
| 294 | .PP
|
|---|
| 295 | smb_traffic_analyzer:total_anonymization = STRING
|
|---|
| 296 | .RS 4
|
|---|
| 297 | If STRING matches to \'yes\', the module will replace any user name with the string given by the option smb_traffic_analyzer:anonymize_prefix, without generating an additional hash number\&. This means that any transfer data will be mapped to a single user, leading to a total anonymization of user related data\&. In version 2\&.x of the protocol, the users SID will also be anonymized\&.
|
|---|
| 298 | .RE
|
|---|
| 299 | .PP
|
|---|
| 300 | smb_traffic_analyzer:protocol_version = STRING
|
|---|
| 301 | .RS 4
|
|---|
| 302 | If STRING matches to V1, the module will use version 1 of the protocol\&. If STRING is not given, the module will use version 2 of the protocol, which is the default\&.
|
|---|
| 303 | .RE
|
|---|
| 304 | .SH "EXAMPLES"
|
|---|
| 305 | .PP
|
|---|
| 306 | Running protocol V2 on share "example_share", using an internet socket\&.
|
|---|
| 307 | .sp
|
|---|
| 308 | .if n \{\
|
|---|
| 309 | .RS 4
|
|---|
| 310 | .\}
|
|---|
| 311 | .nf
|
|---|
| 312 | \fI[example_share]\fR
|
|---|
| 313 | \m[blue]\fBpath = /data/example\fR\m[]
|
|---|
| 314 | \m[blue]\fBvfs_objects = smb_traffic_analyzer\fR\m[]
|
|---|
| 315 | \m[blue]\fBsmb_traffic_analyzer:host = examplehost\fR\m[]
|
|---|
| 316 | \m[blue]\fBsmb_traffic_analyzer:port = 3491\fR\m[]
|
|---|
| 317 |
|
|---|
| 318 | .fi
|
|---|
| 319 | .if n \{\
|
|---|
| 320 | .RE
|
|---|
| 321 | .\}
|
|---|
| 322 | .PP
|
|---|
| 323 | The module running on share "example_share", using a unix domain socket
|
|---|
| 324 | .sp
|
|---|
| 325 | .if n \{\
|
|---|
| 326 | .RS 4
|
|---|
| 327 | .\}
|
|---|
| 328 | .nf
|
|---|
| 329 | \fI[example_share]\fR
|
|---|
| 330 | \m[blue]\fBpath = /data/example\fR\m[]
|
|---|
| 331 | \m[blue]\fBvfs objects = smb_traffic_analyzer\fR\m[]
|
|---|
| 332 | \m[blue]\fBsmb_traffic_analyzer:mode = unix_domain_socket\fR\m[]
|
|---|
| 333 |
|
|---|
| 334 | .fi
|
|---|
| 335 | .if n \{\
|
|---|
| 336 | .RE
|
|---|
| 337 | .\}
|
|---|
| 338 | .PP
|
|---|
| 339 | The module running on share "example_share", using an internet socket, connecting to host "examplehost" on port 3491\&.
|
|---|
| 340 | .sp
|
|---|
| 341 | .if n \{\
|
|---|
| 342 | .RS 4
|
|---|
| 343 | .\}
|
|---|
| 344 | .nf
|
|---|
| 345 | \fI[example_share]\fR
|
|---|
| 346 | \m[blue]\fBpath = /data/example\fR\m[]
|
|---|
| 347 | \m[blue]\fBvfs objects = smb_traffic_analyzer\fR\m[]
|
|---|
| 348 | \m[blue]\fBsmb_traffic_analyzer:host = examplehost\fR\m[]
|
|---|
| 349 | \m[blue]\fBsmb_traffic_analyzer:port = 3491\fR\m[]
|
|---|
| 350 |
|
|---|
| 351 | .fi
|
|---|
| 352 | .if n \{\
|
|---|
| 353 | .RE
|
|---|
| 354 | .\}
|
|---|
| 355 | .PP
|
|---|
| 356 | The module running on share "example_share", using an internet socket, connecting to host "examplehost" on port 3491, anonymizing user names with the prefix "User"\&.
|
|---|
| 357 | .sp
|
|---|
| 358 | .if n \{\
|
|---|
| 359 | .RS 4
|
|---|
| 360 | .\}
|
|---|
| 361 | .nf
|
|---|
| 362 | \fI[example_share]\fR
|
|---|
| 363 | \m[blue]\fBpath = /data/example\fR\m[]
|
|---|
| 364 | \m[blue]\fBvfs objects = smb_traffic_analyzer\fR\m[]
|
|---|
| 365 | \m[blue]\fBsmb_traffic_analyzer:host = examplehost\fR\m[]
|
|---|
| 366 | \m[blue]\fBsmb_traffic_analyzer:port = 3491\fR\m[]
|
|---|
| 367 | \m[blue]\fBsmb_traffic_analyzer:anonymize_prefix = User\fR\m[]
|
|---|
| 368 |
|
|---|
| 369 | .fi
|
|---|
| 370 | .if n \{\
|
|---|
| 371 | .RE
|
|---|
| 372 | .\}
|
|---|
| 373 | .SH "VERSION"
|
|---|
| 374 | .PP
|
|---|
| 375 | This man page is correct for version 3\&.3 of the Samba suite\&.
|
|---|
| 376 | .SH "AUTHOR"
|
|---|
| 377 | .PP
|
|---|
| 378 | The original Samba software and related utilities were created by Andrew Tridgell\&. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed\&.
|
|---|
| 379 | .PP
|
|---|
| 380 | The original version of the VFS module and the helper tools were created by Holger Hetterich\&.
|
|---|