1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE refentry PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
3 <refentry id="vfs_smb_traffic_analyzer.8">
6 <refentrytitle>smb_traffic_analyzer</refentrytitle>
7 <manvolnum>8</manvolnum>
8 <refmiscinfo class="source">Samba</refmiscinfo>
9 <refmiscinfo class="manual">System Administration tools</refmiscinfo>
10 <refmiscinfo class="version">3.6</refmiscinfo>
15 <refname>vfs_smb_traffic_analyzer</refname>
16 <refpurpose>log Samba VFS read and write operations through a socket
17 to a helper application</refpurpose>
22 <command>vfs objects = smb_traffic_analyzer</command>
27 <title>DESCRIPTION</title>
29 <para>This VFS module is part of the
30 <citerefentry><refentrytitle>samba</refentrytitle>
31 <manvolnum>7</manvolnum></citerefentry> suite.</para>
33 <para>The <command>vfs_smb_traffic_analyzer</command> VFS module logs
34 client file operations on a Samba server and sends this data
35 over a socket to a helper program (in the following the "Receiver"),
36 which feeds a SQL database. More
37 information on the helper programs can be obtained from the
38 homepage of the project at:
39 http://holger123.wordpress.com/smb-traffic-analyzer/
40 Since the VFS module depends on a receiver that is doing something with
41 the data, it is evolving in it's development. Therefore, the module
42 works with different protocol versions, and the receiver has to be able
43 to decode the protocol that is used. The protocol version 1 was
44 introduced to Samba at September 25, 2008. It was a very simple
45 protocol, supporting only a small list of VFS operations, and had
46 several drawbacks. The protocol version 2 is a try to solve the
47 problems version 1 had while at the same time adding new features.
52 <title>Protocol version 1 documentation</title>
53 <para><command>vfs_smb_traffic_analyzer</command> protocol version 1 is aware
54 of the following VFS operations:</para>
57 <member>write</member>
58 <member>pwrite</member>
60 <member>pread</member>
63 <para><command>vfs_smb_traffic_analyzer</command> sends the following data
64 in a fixed format seperated by a comma through either an internet or a
65 unix domain socket:</para>
67 BYTES|USER|DOMAIN|READ/WRITE|SHARE|FILENAME|TIMESTAMP
70 <para>Description of the records:
73 <listitem><para><command>BYTES</command> - the length in bytes of the VFS operation</para></listitem>
74 <listitem><para><command>USER</command> - the user who initiated the operation</para></listitem>
75 <listitem><para><command>DOMAIN</command> - the domain of the user</para></listitem>
76 <listitem><para><command>READ/WRITE</command> - either "W" for a write operation or "R" for read</para></listitem>
77 <listitem><para><command>SHARE</command> - the name of the share on which the VFS operation occured</para></listitem>
78 <listitem><para><command>FILENAME</command> - the name of the file that was used by the VFS operation</para></listitem>
79 <listitem><para><command>TIMESTAMP</command> - a timestamp, formatted as "yyyy-mm-dd hh-mm-ss.ms" indicating when the VFS operation occured</para></listitem>
84 <para>This module is stackable.</para>
89 <title>Drawbacks of protocol version 1</title>
90 <para>Several drawbacks have been seen with protocol version 1 over time.</para>
94 <command>Problematic parsing - </command>
95 Protocol version 1 uses hyphen and comma to seperate blocks of data. Once there is a
96 filename with a hyphen, you will run into problems because the receiver decodes the
102 <command>Insecure network transfer - </command>
103 Protocol version 1 sends all it's data as plaintext over the network.
108 <command>Limited set of supported VFS operations - </command>
109 Protocol version 1 supports only four VFS operations.
114 <command>No subreleases of the protocol - </command>
115 Protocol version 1 is fixed on it's version, making it unable to introduce new
116 features or bugfixes through compatible sub-releases.
122 <title>Version 2 of the protocol</title>
123 <para>Protocol version 2 is an approach to solve the problems introduced with protcol v1.
124 From the users perspective, the following changes are most prominent among other enhancements:
129 The data from the module may be send encrypted, with a key stored in secrets.tdb. The
130 Receiver then has to use the same key. The module does AES block encryption over the
136 The module now can identify itself against the receiver with a sub-release number, where
137 the receiver may run with a different sub-release number than the module. However, as
138 long as both run on the V2.x protocol, the receiver will not crash, even if the module
139 uses features only implemented in the newer subrelease. Ultimativly, if the module uses
140 a new feature from a newer subrelease, and the receiver runs an older protocol, it is just
141 ignoring the functionality. Of course it is best to have both the receiver and the module
142 running the same subrelease of the protocol.
147 The parsing problems of protocol V1 can no longer happen, because V2 is marshalling the
148 data packages in a proper way.
153 The module now potientially has the ability to create data on every VFS function. As of
154 protocol V2.0, there is support for 8 VFS functions, namely write,read,pread,pwrite,
155 rename,chdir,mkdir and rmdir. Supporting more VFS functions is one of the targets for the
156 upcoming sub-releases.
161 To enable protocol V2, the protocol_version vfs option has to be used (see OPTIONS).
167 <title>OPTIONS with protocol V1 and V2.x</title>
172 <term>smb_traffic_analyzer:mode = STRING</term>
174 <para>If STRING matches to "unix_domain_socket", the module will
175 use a unix domain socket located at /var/tmp/stadsocket, if
176 STRING contains an different string or is not defined, the module will
177 use an internet domain socket for data transfer.</para>
184 <term>smb_traffic_analyzer:host = STRING</term>
186 <para>The module will send the data to the system named with
187 the hostname STRING.</para>
193 <term>smb_traffic_analyzer:port = STRING</term>
195 <para>The module will send the data using the TCP port given
201 <term>smb_traffic_analyzer:anonymize_prefix = STRING</term>
203 <para>The module will replace the user names with a prefix
204 given by STRING and a simple hash number. In version 2.x
205 of the protocol, the users SID will also be anonymized.
212 <term>smb_traffic_analyzer:total_anonymization = STRING</term>
214 <para>If STRING matches to 'yes', the module will replace
215 any user name with the string given by the option
216 smb_traffic_analyzer:anonymize_prefix, without generating
217 an additional hash number. This means that any transfer data
218 will be mapped to a single user, leading to a total
219 anonymization of user related data. In version 2.x of the
220 protocol, the users SID will also be anonymized.</para>
225 <term>smb_traffic_analyzer:protocol_version = STRING</term>
227 <para>If STRING matches to V1 or is not given at all, the module
228 will use version 1 of the protocol. If STRING matches to "V2"
229 the module will use version 2 of the protocol.
238 <title>EXAMPLES</title>
239 <para>Running protocol V2 on share "example_share", using an internet socket.</para>
241 <smbconfsection name="[example_share]"/>
242 <smbconfoption name="path">/data/example</smbconfoption>
243 <smbconfoption name="vfs_objects">smb_traffic_analyzer</smbconfoption>
244 <smbconfoption name="smb_traffic_analyzer:protocol_version">V2</smbconfoption>
245 <smbconfoption name="smb_traffic_analyzer:host">examplehost</smbconfoption>
246 <smbconfoption name="smb_traffic_analyzer:port">3491</smbconfoption>
249 <para>The module running on share "example_share", using a unix domain socket</para>
251 <smbconfsection name="[example_share]"/>
252 <smbconfoption name="path">/data/example</smbconfoption>
253 <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
254 <smbconfoption name="smb_traffic_analyzer:mode">unix_domain_socket</smbconfoption>
257 <para>The module running on share "example_share", using an internet socket,
258 connecting to host "examplehost" on port 3491.</para>
260 <smbconfsection name="[example_share]"/>
261 <smbconfoption name="path">/data/example</smbconfoption>
262 <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
263 <smbconfoption name="smb_traffic_analyzer:host">examplehost</smbconfoption>
264 <smbconfoption name="smb_traffic_analyzer:port">3491</smbconfoption>
267 <para>The module running on share "example_share", using an internet socket,
268 connecting to host "examplehost" on port 3491, anonymizing user names with
269 the prefix "User".</para>
271 <smbconfsection name="[example_share]"/>
272 <smbconfoption name="path">/data/example</smbconfoption>
273 <smbconfoption name="vfs objects">smb_traffic_analyzer</smbconfoption>
274 <smbconfoption name="smb_traffic_analyzer:host">examplehost</smbconfoption>
275 <smbconfoption name="smb_traffic_analyzer:port">3491</smbconfoption>
276 <smbconfoption name="smb_traffic_analyzer:anonymize_prefix">User</smbconfoption>
281 <title>VERSION</title>
282 <para>This man page is correct for version 3.3 of the Samba suite.
287 <title>AUTHOR</title>
289 <para>The original Samba software and related utilities
290 were created by Andrew Tridgell. Samba is now developed
291 by the Samba Team as an Open Source project similar
292 to the way the Linux kernel is developed.</para>
294 <para>The original version of the VFS module and the
295 helper tools were created by Holger Hetterich.</para>