tsocket: fill in sa.sa_len if the system supports it
[Samba/gebeck_regimport.git] / docs-xml / manpages-3 / vfs_smb_traffic_analyzer.8.xml
blob882ee6af3f8d66f4381d0b985bf35f71aaa7a1fa
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">
5 <refmeta>
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>
11 </refmeta>
14 <refnamediv>
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>
18 </refnamediv>
20 <refsynopsisdiv>
21         <cmdsynopsis>
22                 <command>vfs objects = smb_traffic_analyzer</command>
23         </cmdsynopsis>
24 </refsynopsisdiv>
26 <refsect1>
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.
48         </para>
49 </refsect1>
51 <refsect1>
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>
56         <simplelist>
57         <member>write</member>
58         <member>pwrite</member>
59         <member>read</member>
60         <member>pread</member>
61         </simplelist>
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>
66         <programlisting>
67         BYTES|USER|DOMAIN|READ/WRITE|SHARE|FILENAME|TIMESTAMP
68         </programlisting>
70         <para>Description of the records:
72         <itemizedlist>
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>
80         </itemizedlist>
82         </para>
84         <para>This module is stackable.</para>
86 </refsect1>
88 <refsect1>
89         <title>Drawbacks of protocol version 1</title>
90         <para>Several drawbacks have been seen with protocol version 1 over time.</para>
91         <itemizedlist>
92         <listitem>
93                 <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
97                         data in a wrong way.
98                 </para>
99         </listitem>
100         <listitem>
101                 <para>
102                         <command>Insecure network transfer - </command>
103                         Protocol version 1 sends all it's data as plaintext over the network.
104                 </para>
105         </listitem>
106         <listitem>
107                 <para>
108                         <command>Limited set of supported VFS operations - </command>
109                         Protocol version 1 supports only four VFS operations.
110                 </para>
111         </listitem>
112         <listitem>
113                 <para>
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.
117                 </para>
118         </listitem>
119         </itemizedlist>
120 </refsect1>
121 <refsect1>
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:
125         </para>
126         <itemizedlist>
127                 <listitem>
128                 <para>
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
131                 data to send.
132                 </para>
133                 </listitem>
134                 <listitem>
135                 <para>
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.
143                 </para>
144                 </listitem>
145                 <listitem>
146                 <para>
147                 The parsing problems of protocol V1 can no longer happen, because V2 is marshalling the
148                 data packages in a proper way.
149                 </para>
150                 </listitem>
151                 <listitem>
152                 <para>
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.
157                 </para>
158                 </listitem>
159         </itemizedlist>
160         <para>
161                 To enable protocol V2, the protocol_version vfs option has to be used (see OPTIONS).
162         </para>
163                 
164 </refsect1>             
166 <refsect1>
167         <title>OPTIONS with protocol V1 and V2.x</title>
169         <variablelist>
171                 <varlistentry>
172                 <term>smb_traffic_analyzer:mode = STRING</term>
173                 <listitem>
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>
179                 </listitem>
180                 </varlistentry>
183                 <varlistentry>
184                 <term>smb_traffic_analyzer:host = STRING</term>
185                 <listitem>
186                 <para>The module will send the data to the system named with
187                 the hostname STRING.</para>
189                 </listitem>
190                 </varlistentry>
192                 <varlistentry>
193                 <term>smb_traffic_analyzer:port = STRING</term>
194                 <listitem>
195                 <para>The module will send the data using the TCP port given
196                 in STRING.
197                 </para>
198                 </listitem>
199                 </varlistentry>
200                 <varlistentry>
201                 <term>smb_traffic_analyzer:anonymize_prefix = STRING</term>
202                 <listitem>
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.
206                 </para>
208                 </listitem>
209                 </varlistentry>
211                 <varlistentry>
212                 <term>smb_traffic_analyzer:total_anonymization = STRING</term>
213                 <listitem>
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>
221                 </listitem>
222                 </varlistentry>
224                 <varlistentry>
225                 <term>smb_traffic_analyzer:protocol_version = STRING</term>
226                 <listitem>
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.
230                 </para>
231                 </listitem>
232                 </varlistentry>
234         </variablelist>
235 </refsect1>
237 <refsect1>
238         <title>EXAMPLES</title>
239         <para>Running protocol V2 on share "example_share", using an internet socket.</para>
240         <programlisting>
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>
247         </programlisting>
249         <para>The module running on share "example_share", using a unix domain socket</para>
250         <programlisting>
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>
255         </programlisting>
257         <para>The module running on share "example_share", using an internet socket,
258         connecting to host "examplehost" on port 3491.</para>
259         <programlisting>
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>
265         </programlisting>
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>
270         <programlisting>
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>
277         </programlisting>
278 </refsect1>
280 <refsect1>
281         <title>VERSION</title>
282         <para>This man page is correct for version 3.3 of the Samba suite.
283         </para>
284 </refsect1>
286 <refsect1>
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>
296 </refsect1>
297 </refentry>