source: branches/samhain_3_1/docs/FAQ.html@ 568

Last change on this file since 568 was 462, checked in by katerina, 10 years ago

Fix for ticket #362 (Buffer for getgrnam_r too small).

File size: 39.2 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<html><head>
3<title>Frequently Asked Questions for Samhain</title>
4<meta name="author" content="Rainer Wichmann">
5
6<style type="text/css">
7<!--
8
9html { background: #eee; color: #000; }
10
11body { background: #eee; color: #000; margin: 0; padding: 0;}
12
13div.body {
14 background: #fff; color: #000;
15 margin: 0 1em 0 1em; padding: 1em;
16 font-family: serif;
17 font-size: 1em; line-height: 1.2em;
18 border-width: 0 1px 0 1px;
19 border-style: solid;
20 border-color: #aaa;
21}
22
23div.block {
24 background: #b6c5f2; color: #000;
25 margin: 1em; padding: 0 1em 0 1em;
26 border-width: 1px;
27 border-style: solid;
28 border-color: #2d4488;
29}
30
31div.warnblock {
32 background: #b6c5f2; color: #000;
33 background: #ffffcc; color: #000;
34 margin: 1em; padding: 0 1em 0 1em;
35 border-width: 1px;
36 border-style: solid;
37 border-color: #FF9900;
38}
39
40table {
41 background: #F8F8F8; color: #000;
42 margin: 1em;
43 border-width: 0 0 0 1px;
44 border-style: solid;
45 border-color: #C0C0C0;
46}
47
48td {
49 border-width: 0 1px 1px 0;
50 border-style: solid;
51 border-color: #C0C0C0;
52}
53
54th {
55 background: #F8F8FF;
56 border-width: 1px 1px 2px 0;
57 border-style: solid;
58 border-color: #C0C0C0;
59}
60
61
62/* body text, headings, and rules */
63
64p { margin: 0; text-indent: 0em; margin: 0 0 0.5em 0 }
65
66h1, h2, h3, h4, h5, h6 {
67 color: #206020; background: transparent;
68 font-family: Optima, Arial, Helvetica, sans-serif;
69 font-weight: normal;
70}
71
72h1 { font-size: 1.69em; margin: 1.4em 0 0.4em 0; }
73h2 { font-size: 1.44em; margin: 1.4em 0 0.4em 0; }
74h3 { font-size: 1.21em; margin: 1.4em 0 0.4em 0; }
75h4 { font-size: 1.00em; margin: 1.4em 0 0.4em 0; }
76h5 { font-size: 0.81em; margin: 1.4em 0 0.4em 0; }
77h6 { font-size: 0.64em; margin: 1.4em 0 0.4em 0; }
78
79hr {
80 color: transparent; background: transparent;
81 height: 0px; margin: 0.6em 0;
82 border-width: 1px ;
83 border-style: solid;
84 border-color: #999;
85}
86
87/* bulleted lists and definition lists */
88
89ul { margin: 0 1em 0.6em 2em; padding: 0; }
90li { margin: 0.4em 0 0 0; }
91
92dl { margin: 0.6em 1em 0.6em 2em; }
93dt { color: #285577; }
94
95tt { color: #602020; }
96
97/* links */
98
99a.link {
100 color: #33c; background: transparent;
101 text-decoration: none;
102}
103
104a:hover {
105 color: #000; background: transparent;
106}
107
108body > a {
109 font-family: Optima, Arial, Helvetica, sans-serif;
110 font-size: 0.81em;
111}
112
113h1, h2, h3, h4, h5, h6 {
114 color: #2d5588; background: transparent;
115 font-family: Optima, Arial, Helvetica, sans-serif;
116 font-weight: normal;
117}
118
119 -->
120</style></head>
121<body>
122<div class="body">
123<p style="text-align: center; background: #ccc; border: 1px solid #2d5588;"><a
124 style="text-decoration: none;"
125 href="http://www.la-samhna.de/samhain/">samhain file integrity
126 scanner</a>&nbsp;|&nbsp;<a style="text-decoration: none;"
127 href="http://www.la-samhna.de/samhain/s_documentation.html">online
128 documentation</a></p>
129<br><center><h1><a name="FAQ-top">Frequently Asked Questions for Samhain</a></h1></center>
130<br><center><h2>Rainer Wichmann</h2></center>
131<hr>
132<div class="warnblock">
133<ul>
134 <li>If you encounter problems after installing samhain, disable daemon
135 mode and run it in the foreground with
136 <tt>samhain --foreground [more options]</tt> for debugging.</li>
137 <li>If you have problems getting client/server mode to work, please check
138 the <a href="http://www.la-samhna.de/samhain/HOWTO-client+server-troubleshooting.html">HOWTO client+server troubleshooting</a> document.</li>
139</ul>
140</div>
141<p><i>FAQ Revised: Wednesday 14 January 2015 20:41:15</i></p>
142<hr><h2>Table of Contents</h2>
143<dl>
144<dt><b>1. Most frequently</b></dt>
145<dd><ul>
146<li><a href="#Most frequently0">1.1. Owner not trustworthy / Group writeable and member not trustworthy</a></li>
147<li><a href="#Most frequently1">1.2. samhain exits with the message &quot;Untrusted path&quot; for config/log/pid/database files</a></li>
148<li><a href="#Most frequently2">1.3. It does not log anything / Can't stop logging to console</a></li>
149<li><a href="#Most frequently3">1.4. Client cannot self-resolve, but nslookup works fine</a></li>
150<li><a href="#Most frequently4">1.5. Server logs hostname instead of FQDN (or vice versa)</a></li>
151</ul></dd>
152<dt><b>2. Build and install</b></dt>
153<dd><ul>
154<li><a href="#Build and install0">2.1. [Fedora Core] Cannot compile with --enable-khide</a></li>
155<li><a href="#Build and install1">2.2. [Fedora Core] Cannot compile with --with-kcheck</a></li>
156<li><a href="#Build and install2">2.3. &quot;make&quot; loops infinitely !</a></li>
157<li><a href="#Build and install3">2.4. Why does static compiling (<code>--enable-static</code>) on Solaris fail ?</a></li>
158<li><a href="#Build and install4">2.5. Compilation fails with '/usr/bin/ld: cannot find -lnss_files'</a></li>
159<li><a href="#Build and install5">2.6. The executable is corrupted after installation</a></li>
160<li><a href="#Build and install6">2.7. --enable-xml-log has no effect</a></li>
161<li><a href="#Build and install7">2.8. ./install-sh: strip: not found (Solaris)</a></li>
162<li><a href="#Build and install8">2.9. What is sh_tiger1.s?</a></li>
163<li><a href="#Build and install9">2.10. Why does static compiling (<code>--enable-static</code>) on MaxOS X fail ?</a></li>
164<li><a href="#Build and install10">2.11. Why does compiling with MySQL fail on Solaris ?</a></li>
165</ul></dd>
166<dt><b>3. File checking</b></dt>
167<dd><ul>
168<li><a href="#File checking0">3.1. How can I exclude a (sub-)directory ?</a></li>
169<li><a href="#File checking1">3.2. In messages about policy violations, what does the code after POLICY [XYZ]
170mean ?</a></li>
171<li><a href="#File checking2">3.3. Does samhain support prelink ?</a></li>
172<li><a href="#File checking3">3.4. I get error messages about 'subdirectory count != hardlinks'</a></li>
173</ul></dd>
174<dt><b>4. Client/Server</b></dt>
175<dd><ul>
176<li><a href="#Client/Server0">4.1. I don't want to poke a hole into my firewall to let the client connect to the server !</a></li>
177<li><a href="#Client/Server1">4.2. The client sends 127.0.0.1 (or some other numerical address) as its name to the log server</a></li>
178<li><a href="#Client/Server2">4.3. The server wants to send rc.ip-adress rather than rc.fqdn to the client</a></li>
179<li><a href="#Client/Server3">4.4. Cannot resolve client name host=XXX</a></li>
180<li><a href="#Client/Server4">4.5. Cannot resolve socket peer IP for client host=XXX peer=YYY</a></li>
181<li><a href="#Client/Server5">4.6. Reverse lookup of socket peer failed host=XXX peer=YYY obj=ZZZ</a></li>
182<li><a href="#Client/Server6">4.7. No socket peer alias matches client name host=XXX peer=YYY</a></li>
183<li><a href="#Client/Server7">4.8. Session key negotiation failed</a></li>
184<li><a href="#Client/Server8">4.9. Invalid connection attempt: Not in client list</a></li>
185<li><a href="#Client/Server9">4.10. Invalid connection attempt: Session key mismatch</a></li>
186<li><a href="#Client/Server10">4.11. How do I update the file signature database ?</a></li>
187<li><a href="#Client/Server11">4.12. Time limit exceeded</a></li>
188<li><a href="#Client/Server12">4.13. Invalid connection attempt: Signature mismatch</a></li>
189<li><a href="#Client/Server13">4.14. [Server] PANIC .. Address already in use&nbsp; &nbsp;subroutine=bind</a></li>
190</ul></dd>
191<dt><b>5. Email</b></dt>
192<dd><ul>
193<li><a href="#Email0">5.1. Reverse lookup failed</a></li>
194<li><a href="#Email1">5.2. From daemon@example.com</a></li>
195<li><a href="#Email2">5.3. How do I define more than one email addresses ?</a></li>
196</ul></dd>
197<dt><b>6. Misc</b></dt>
198<dd><ul>
199<li><a href="#Misc0">6.1. Error message: &quot;Invalid line XYZ in configuration file&quot;</a></li>
200<li><a href="#Misc1">6.2. Why do I get a local logfile if I log to the server ?</a></li>
201<li><a href="#Misc2">6.3. Why is there no NIS support with a static samhain executable on Linux ?</a></li>
202<li><a href="#Misc3">6.4. Why do I get hundreds of messages about modified CTIME ?</a></li>
203<li><a href="#Misc4">6.5. PANIC &mdash; File not accessible</a></li>
204<li><a href="#Misc5">6.6. How can I avoid error messages for invalid UIDs (no such user) ?</a></li>
205<li><a href="#Misc6">6.7. [Redhat] The /etc/init.d/(samhain|yule) init script hangs</a></li>
206<li><a href="#Misc7">6.8. The /etc/init.d/(samhain|yule) init script exits with: execvp: No such file or directory</a></li>
207<li><a href="#Misc8">6.9. Why am I not receiving the &quot;BEGIN LOGKEY&quot; message by email ?</a></li>
208<li><a href="#Misc9">6.10. Why does console logging fail if I compile with
209 <code>--enable-(micro-)stealth</code> ?</a></li>
210<li><a href="#Misc10">6.11. I need a list for my schedule !</a></li>
211<li><a href="#Misc11">6.12. The hiding kernel module has no effect !</a></li>
212<li><a href="#Misc12">6.13. What does the message &quot;Large lstat/open overhead&quot; mean ?</a></li>
213<li><a href="#Misc13">6.14. What does the message &quot;Device not available path=/dev/random&quot; mean ? I have /dev/random !</a></li>
214<li><a href="#Misc14">6.15. Logging to an external program fails; the program receives no data
215 on stdin !</a></li>
216<li><a href="#Misc15">6.16. SIGILL on AIX</a></li>
217</ul></dd>
218<dt><b>7. Database</b></dt>
219<dd><ul>
220<li><a href="#Database0">7.1. Why are client messages corrupted / incompletely stored in the DB ?</a></li>
221<li><a href="#Database1">7.2. I want / don't want the server timestamps (for client messages) in the SQL database</a></li>
222<li><a href="#Database2">7.3. I don't want the client TIMESTAMP messages in the SQL database</a></li>
223<li><a href="#Database3">7.4. What does the log_ref field mean ?</a></li>
224<li><a href="#Database4">7.5. How can I check what is in the database ?</a></li>
225</ul></dd>
226</dl>
227<hr><h2>1. Most frequently</h2>
228<dl>
229<dt><b><a name="Most frequently0">1.1. Owner not trustworthy / Group writeable and member not trustworthy</a></b></dt>
230<dd>An untrusted user (might be an untrusted group member
231 for group writeable files/directories) owns or can write to an
232 element in the path listed in the error message. This concerns
233 the configuration file, the log file, and the database file.
234 The offending element in the path is identified as obj=/xxx in the
235 error message.
236 To fix the problem, see next entry.<br><br></dd>
237<dt><b><a name="Most frequently1">1.2. samhain exits with the message &quot;Untrusted path&quot; for config/log/pid/database files</a></b></dt>
238<dd>Paths to critical
239 files (e.g. the configuration file) must be writeable by trusted users
240 only.
241 If a path element is group writeable, all group members must be trusted.
242 By default, only <i>root</i> and the (effective) <i>user</i> of
243 the program are trusted. To add trusted users, use the compile time
244 option
245<div class="block"><pre>
246$ ./configure --with-trusted=0,...
247</pre></div>
248 or the configure file option:
249<div class="block"><pre>
250[Misc]
251TrustedUser=username
252</pre></div>
253If the path to the configuration file itself is writeable
254 by other users than <i>root</i> and the
255 <i>effective user</i>
256 these must be defined as trusted already
257 at compile time.<br><br></dd>
258<dt><b><a name="Most frequently2">1.3. It does not log anything / Can't stop logging to console</a></b></dt>
259<dd>(1) There is a section in the manual dealing with
260logging and filtering.<br />
261
262(2) To log to the console:
263<div class="block"><pre>
264$ samhain -p info ...
265</pre></div>
266or in the configuration file:
267<div class="block"><pre>
268[Log]
269PrintSeverity=info
270</pre></div>
271
272To <i>stop</i> logging to the console:
273<div class="block"><pre>
274$ samhain -p none ...
275</pre></div>
276or in the configuration file:
277<div class="block"><pre>
278[Log]
279PrintSeverity=none
280</pre></div>
281Defining <tt>/dev/null</tt> as console device works as well, but
282is a bad idea, because samhain will open the device and write (i.e. it is
283a very inefficient method).<br><br></dd>
284<dt><b><a name="Most frequently3">1.4. Client cannot self-resolve, but nslookup works fine</a></b></dt>
285<dd><ul>
286<li>Nslookup is a program to query Internet domain name servers.
287</li>
288<li>Applications (like samhain) are not supposed to query DNS servers
289 directly. Rather, they are supposed to query the resolver library that:
290 <ul>
291 <li>is provided by the operating system,</li>
292 <li>configured by the system administrator,</li>
293 <li>may use several different method to determine host names, as
294 configured in <tt>/etc/nsswitch.conf</tt>, and</li>
295 <li>usually is configured to give precedence to
296 the <tt>/etc/hosts</tt> file.</li>
297 </ul>
298</li>
299<li>Therefore, whether nslookup gives correct answers may be completely
300 irrelevant. For self-resolving the own hostname, the resolver
301 library probably will use <tt>/etc/hosts</tt>, rather than
302 querying a DNS server.
303</li>
304</ul>
305<p>
306Below you can find some examples of good and bad <tt>/etc/hosts</tt> files:
307</p>
308<div class="block"><pre>
309 # CORRECT
310 #
311 127.0.0.1 localhost
312 xxx.xxx.xxx.xxx myhost.mydomain.tld myhost
313</pre></div>
314
315<div class="block"><pre>
316 # CORRECT
317 #
318 127.0.0.1 localhost.localdomain localhost
319 xxx.xxx.xxx.xxx myhost.mydomain.tld myhost
320</pre></div>
321
322<div class="block"><pre>
323 # BAD
324 #
325 127.0.0.1 myhost.mydomain.tld localhost
326 xxx.xxx.xxx.xxx myhost.mydomain.tld myhost
327</pre></div>
328
329<div class="block"><pre>
330 # BAD
331 #
332 127.0.0.1 localhost myhost
333 xxx.xxx.xxx.xxx myhost.mydomain.tld myhost
334</pre></div><br><br></dd>
335<dt><b><a name="Most frequently4">1.5. Server logs hostname instead of FQDN (or vice versa)</a></b></dt>
336<dd>The default is to log the hostname only, if you want the FQDN
337then there is an option for the server configuration:
338<div class="block"><pre>
339 [Misc]
340 SetStripDomain = true / false
341</pre></div><br><br></dd>
342</dl>
343<hr><h2>2. Build and install</h2>
344<dl>
345<dt><b><a name="Build and install0">2.1. [Fedora Core] Cannot compile with --enable-khide</a></b></dt>
346<dd>The Fedora Core kernel is patched to unconditionally deny reading
347from /dev/kmem. Compiling the stealth kernel modules is not possible
348under these circumstances.<br><br></dd>
349<dt><b><a name="Build and install1">2.2. [Fedora Core] Cannot compile with --with-kcheck</a></b></dt>
350<dd>The Fedora Core kernel is patched to unconditionally deny reading
351from /dev/kmem. Checking the kernel for the presence of rootkits is
352not possible under these circumstances.<br><br></dd>
353<dt><b><a name="Build and install2">2.3. &quot;make&quot; loops infinitely !</a></b></dt>
354<dd>This may happen (e.g. when building via NFS for multiple architectures)
355 if the relative timestamps in the source directory are
356 wrong (time not in sync on different machines) or some intermediate
357 target is unusable (up-to-date, but built for a different OS). Use
358 &quot;touch * &amp;&amp; make distclean&quot; in the source directory
359 to recover.<br><br></dd>
360<dt><b><a name="Build and install3">2.4. Why does static compiling (<code>--enable-static</code>) on Solaris fail ?</a></b></dt>
361<dd>Ingo Rogalsky has provided the following information: It isn't possible
362 to link Samhain statically with Solaris. This
363 is a Solaris issue (see Sun Infodoc ID12624) and not a samhain problem.<br><br></dd>
364<dt><b><a name="Build and install4">2.5. Compilation fails with '/usr/bin/ld: cannot find -lnss_files'</a></b></dt>
365<dd>For Linux, this is a known problem with --enable-static if you compile
366 in MySQL support. The problem is that the
367 <tt>mysql_config</tt> that comes as part of the MySQL
368 distribution script incorrectly lists dependencies on
369 the libnss_files and libnss_dns libraries which are only available as
370 shared libraries, so the linker cannot find the static libraries.
371
372 You can check this by inspecting the output of
373 <code>mysql_config --libs</code>. The version of
374 <tt>mysql_config</tt> that comes with the RedHat mysql
375 RPM (RedHat 9) does not have this bug; the one distributed by the MySQL
376 people has. You can fix the problem by editing
377 <tt>mysql_config</tt>: search for the
378 <i>client_libs</i> variable, and remove all instances
379 of <i>-lnss_files</i> and <i>-lnss_dns</i>.<br><br></dd>
380<dt><b><a name="Build and install5">2.6. The executable is corrupted after installation</a></b></dt>
381<dd>The executable will get stripped during the installation. On
382 suitable systems (i386 Linux/FreeBSD currently), additionally
383 the &quot;sstrip&quot;
384 utility (copyright 1999 by Brian Raiter, under the GNU GPL)
385 will be used to strip the executable even more, to prevent
386 debugging with the GNU &quot;gdb&quot; debugger.
387 The &quot;strip&quot; utility cannot handle the resulting
388 executable, therefore trying to strip manually after installation
389 will corrupt the executable.<br><br></dd>
390<dt><b><a name="Build and install6">2.7. --enable-xml-log has no effect</a></b></dt>
391<dd>If you have compiled for stealth, you won't see much, because if
392 obfuscated, then both a 'normal' and an XML logfile look,
393 well ... obfuscated. Use <code>samhain -jL /path/to/logfile</code>
394 to view the logfile.<br><br></dd>
395<dt><b><a name="Build and install7">2.8. ./install-sh: strip: not found (Solaris)</a></b></dt>
396<dd>Install the SUNWbtool package.<br><br></dd>
397<dt><b><a name="Build and install8">2.9. What is sh_tiger1.s?</a></b></dt>
398<dd>This is a precompiled assembly file for the i386 architecture
399generated from sh_tiger1.c using gcc 3.4.0 with the following options,
400that were found to generate the fastest code:
401<pre>
402 -O1 -fno-delayed-branch -fexpensive-optimizations -fstrength-reduce
403 -fpeephole2 -fschedule-insns2 -fregmove -frename-registers -fweb
404 -momit-leaf-frame-pointer -funroll-loops
405</pre>
406These options were determined using
407<a href="http://www.coyotegulch.com/products/acovea/">acovea</a> 5.1.1
408by Scott Robert Ladd. The file is provided as precompiled assembly
409because different versions of gcc can have very different performance,
410require different options to compile optimal code, and
411it would be impossible to maintain a library of optimal compile options
412for every version of gcc.<br><br></dd>
413<dt><b><a name="Build and install9">2.10. Why does static compiling (<code>--enable-static</code>) on MaxOS X fail ?</a></b></dt>
414<dd>Static linking is not supported on MacOS X, see
415<a href="http://developer.apple.com/qa/qa2001/qa1118.html">Technical Q&A QA1118</a>.
416This is a MacOS X issue and not a bug in samhain.<br><br></dd>
417<dt><b><a name="Build and install10">2.11. Why does compiling with MySQL fail on Solaris ?</a></b></dt>
418<dd>The reason is often the shell script 'mysql_config' that comes as part
419of MySQL. This script is intended to print appropriate compiler flags for
420compiling applications that use MySQL. Unfortunately, since Sun compiles
421MySQL with the Solaris compiler, this script outputs options for the Solaris
422compiler (i.e. unsuitable for gcc). To solve this problem, you need to move
423this script (i.e. 'mysql_config') out of your PATH before running
424<tt>./configure</tt> (unless of course you are using the Solaris compiler
425rather than gcc).<br><br></dd>
426</dl>
427<hr><h2>3. File checking</h2>
428<dl>
429<dt><b><a name="File checking0">3.1. How can I exclude a (sub-)directory ?</a></b></dt>
430<dd><div class="block"><pre>
431[IgnoreAll]
432dir=-1/ignore/this/subdirectory
433</pre></div><br><br></dd>
434<dt><b><a name="File checking1">3.2. In messages about policy violations, what does the code after POLICY [XYZ]
435mean ?</a></b></dt>
436<dd>This code indicates which items are modified (e.g. C = checksum). You can
437find a description in section 5.4.9 in the user manual. It is there because
438then you can see in the message list of the Beltane web console what has been
439modified, without the need to look at the message in detail.<br><br></dd>
440<dt><b><a name="File checking2">3.3. Does samhain support prelink ?</a></b></dt>
441<dd>Yes. There is a special checking policy [Prelink]. Directories with
442prelinked executables / shared libraries (see /etc/prelink.conf) should be
443placed under this policy, rather than under the [ReadOnly] policy.<br><br></dd>
444<dt><b><a name="File checking3">3.4. I get error messages about 'subdirectory count != hardlinks'</a></b></dt>
445<dd>Some filesystems do not always follow the rule that the number
446of directory
447hardlinks equals the number of subdirectories. E.g. the root directory of
448reiserfs partitions generally seems to have two additional hardlinks.
449To account for such exceptions, you can either switch off the
450hardlink check globally, or specify exceptions:
451<div class="block"><pre>
452[Misc]
453# Switch off hardlink check
454#
455UseHardlinkCheck=no
456</pre></div>
457<div class="block"><pre>
458[Misc]
459# Specify exceptions for the hardlink check
460#
461HardlinkOffset=N:/path
462</pre></div>
463Here, N is the numerical offset (actual - expected hardlinks) for
464'/path'. For multiple exceptions, use
465this options multiple times (note that '/path N:/path2' would itself be a valid
466path, so using the option only once with multiple exceptions on the same line
467would be ambiguous).<br><br></dd>
468</dl>
469<hr><h2>4. Client/Server</h2>
470<dl>
471<dt><b><a name="Client/Server0">4.1. I don't want to poke a hole into my firewall to let the client connect to the server !</a></b></dt>
472<dd>Pat Smith has posted the following solution. On the client, create
473an iptable rule as follows (<i>note: you probably don't need this if you
474configure / compile in 127.0.0.1 as the server address</i>):
475<div class="block"><pre>
476iptables -t nat -A OUTPUT -p tcp -m tcp --dport 49777 -d <i>server-ip</i> -j REDIRECT
477</pre></div>
478
479On the server, create an ssh tunnel for each client outside the firewall:
480
481<div class="block"><pre>
482ssh -f -C -R 49777:localhost:49777 -N <i>client-ip</i>
483</pre></div>
484
485It is necessary that each client has a distinct name, and that the server
486knows the name of the client. With the setup above, each client will appear
487as &quot;localhost&quot; to the server, thus the server
488needs to trust the client name
489as reported by the client itself, and suppress all errors on resolving
490this name to the apparent address. In the server configuration:
491
492<div class="block"><pre>
493[Misc]
494SetClientFromAccept = false
495SeverityLookup = debug
496</pre></div>
497
498Obviously, self-resolving must work on the client machine, otherwise
499you are in trouble (see next issue).<br><br></dd>
500<dt><b><a name="Client/Server1">4.2. The client sends 127.0.0.1 (or some other numerical address) as its name to the log server</a></b></dt>
501<dd>See 'Client cannot self-resolve' in the 'Most frequently' section<br><br></dd>
502<dt><b><a name="Client/Server2">4.3. The server wants to send rc.ip-adress rather than rc.fqdn to the client</a></b></dt>
503<dd>The client self-resolves to its ip address.
504See 'Client cannot self-resolve' in the 'Most frequently' section<br><br></dd>
505<dt><b><a name="Client/Server3">4.4. Cannot resolve client name host=XXX</a></b></dt>
506<dd><div class="block"><pre>
507The server must be able to determine the client name.
508This is because only authenticated connections from registered
509clients are allowed, and
510the server must be able to check the client hostname against the list of
511allowed hosts, and look up the password verifier for that
512host.
513</pre></div>
514There are two different ways to accomplish this. Unfortunately, judging
515from customer feedback as well from common sense, both do not work very well
516with a messed up local DNS (including /etc/hosts files) and/or
517&uuml;berparanoid or misconfigured firewalls (in case of connections
518across one).
519<ul>
520 <li>
521 <p>
522 <i>First method: Determine client name on client, and
523 try to cross-check on server</i>
524 <p>
525 <p>
526 This does not work for a number of people because (1) the
527 <tt>/etc/hosts</tt> file on the client machine has errors
528 (yes, there are plenty machines with a completely
529 messed up <tt>/etc/hosts</tt> file), (2) the
530 server cannot resolve the client address because the local DNS is
531 f***ed up, or (3) the client machine has multiple network interfaces, and
532 the interface used is not the one the client name resolves to.
533 </p>
534 <p>
535 If the client uses the wrong interface on a multi-interface machine,
536 there is a config file option
537 <tt>SetBindAddress=</tt><i>IP address</i>
538 that allows to choose the interface the client will use for
539 outgoing connections.
540 </p>
541 <p>
542 If you want to download the config file from the server, you
543 should instead use the corresponding command line
544 <tt>--bind-address=</tt><i>IP address</i>
545 to select the interface.
546 </p>
547
548 <p>
549 If you encounter problems, you may (1) fix your
550 <tt>/etc/hosts</tt> file(s), (2) fix your local DNS, or
551 (3) switch to the second method.
552 </p>
553 <p>
554 Errors in name resolving/cross-checking can be avoided by setting a
555 very low severity (lower than the logging threshold), e.g.
556 </p>
557 <p>
558 <tt>SeverityLookup=</tt><i>debug</i>
559 </p>
560 <p>
561 in the <i>Misc</i> section of the server configuration,
562 if you prefer running <i>unsafe</i> at any speed
563 instead of fixing the problem (you have been warned). Doing so will
564 allow an attacker to pose as the client.
565 </p>
566 </li>
567 <li>
568 <p><i>Second method: Use address of connecting entity as
569 known to the communication layer</i></p>
570 <p>
571 This has been dropped as default
572 long ago because it may not always be the
573 address of the client machine.
574 To enable this method, use
575 </p>
576 <p>
577 <tt>SetClientFromAccept=</tt><i>true</i>
578 </p>
579 <p>
580 in the <i>Misc</i> section of the server configuration
581 file. If the address cannot be resolved, or reverse lookup of the
582 resolved name fails, <i>no</i> error message will be issued,
583 but the numerical address will be used.
584 </p>
585 </li>
586</ul><br><br></dd>
587<dt><b><a name="Client/Server4">4.5. Cannot resolve socket peer IP for client host=XXX peer=YYY</a></b></dt>
588<dd>See above<br><br></dd>
589<dt><b><a name="Client/Server5">4.6. Reverse lookup of socket peer failed host=XXX peer=YYY obj=ZZZ</a></b></dt>
590<dd>See above<br><br></dd>
591<dt><b><a name="Client/Server6">4.7. No socket peer alias matches client name host=XXX peer=YYY</a></b></dt>
592<dd>See above<br><br></dd>
593<dt><b><a name="Client/Server7">4.8. Session key negotiation failed</a></b></dt>
594<dd>See the document <a href="HOWTO-client+server-troubleshooting.html">HOWTO client+server troubleshooting</a><br><br></dd>
595<dt><b><a name="Client/Server8">4.9. Invalid connection attempt: Not in client list</a></b></dt>
596<dd>See the document <a href="HOWTO-client+server-troubleshooting.html">HOWTO client+server troubleshooting</a><br><br></dd>
597<dt><b><a name="Client/Server9">4.10. Invalid connection attempt: Session key mismatch</a></b></dt>
598<dd>See the document <a href="HOWTO-client+server-troubleshooting.html">HOWTO client+server troubleshooting</a><br><br></dd>
599<dt><b><a name="Client/Server10">4.11. How do I update the file signature database ?</a></b></dt>
600<dd>If you keep the file signature database on the server,
601 the database is supposed to be updated on the server, using the
602 <a href="http://www.la-samhna.de/beltane/">beltane</a>
603 web-based console (currently in beta) and the
604 log messages from the client.
605 <p>
606 Alternatively, you can <code>scp</code> the database
607 to the client, run <code>samhain -t update -l none --foreground</code>
608 (you
609 need to avoid logging because otherwise you will get in conflict with
610 the running samhain daemon), and then <code>scp</code> the
611 database back to the server. Actually, with a properly set up
612 &quot;ssh&quot;, using RSA/DSA authentication
613 and ssh-agent you could write a script to automate this.<br><br></dd>
614<dt><b><a name="Client/Server11">4.12. Time limit exceeded</a></b></dt>
615<dd>The respective client for that this message is generated has not
616 sent anything for some interval of time (default 84600 sec = 1 day).
617 The interval can be set as follows:
618<div class="block"><pre>
619 [Misc]
620 # unit is seconds
621 SetClientTimeLimit=NNN
622</pre></div>
623
624 This feature has the purpose to detect if a client is dead. You
625 might want to ensure that timestamps are sent to the server:
626<div class="block"><pre>
627 [Log]
628 ExportSeverity=mark
629</pre></div>
630 If you don't want to use this feature, set the time limit to some
631 very large value.<br><br></dd>
632<dt><b><a name="Client/Server12">4.13. Invalid connection attempt: Signature mismatch</a></b></dt>
633<dd>Clients sign their messages using a session key negotiated
634 with the server. The message indicates that the server could
635 not verify the signature. This may be caused by a running two
636 instances of samhain on the same client machine, both of them
637 accessing the server (and negotiating different session keys
638 ...). The system will recover automatically from the problem
639 by forcing the failed client to negotiate a fresh session key.<br><br></dd>
640<dt><b><a name="Client/Server13">4.14. [Server] PANIC .. Address already in use&nbsp; &nbsp;subroutine=bind</a></b></dt>
641<dd>The server cannot bind to its port because the port is already used.
642 Maybe you have accidentially already an instance of the
643 server running.<br><br></dd>
644</dl>
645<hr><h2>5. Email</h2>
646<dl>
647<dt><b><a name="Email0">5.1. Reverse lookup failed</a></b></dt>
648<dd>Fix your DNS (reverse lookup: numerical IP address to FQDN, to verify
649 FQDN to numerical IP address).
650<div class="block"><pre>
651Whether &quot;nslookup&quot; works is not very informative, because
652&quot;nslookup&quot; does not use the resolver library of the operating
653system. Therefore,
654it is not exactly the
655best tool for debugging name resolving problems (see the book
656&quot;DNS and bind&quot;).
657</pre></div><br><br></dd>
658<dt><b><a name="Email1">5.2. From daemon@example.com</a></b></dt>
659<dd>samhain fails to resolve the
660 self-address of the host.
661See 'Client cannot self-resolve' in the 'Most frequently' section.<br><br></dd>
662<dt><b><a name="Email2">5.3. How do I define more than one email addresses ?</a></b></dt>
663<dd>Use <tt>SetMailAddress=...</tt> multiple times (upt to eight addresses
664are possible, with at most 63 characters per address):
665<div class="block"><pre>
666[Misc]
667SetMailAddress=aaa@foo.com
668SetMailAddress=bbb@foo.com
669</pre></div><br><br></dd>
670</dl>
671<hr><h2>6. Misc</h2>
672<dl>
673<dt><b><a name="Misc0">6.1. Error message: &quot;Invalid line XYZ in configuration file&quot;</a></b></dt>
674<dd>This message indicates that line XYZ in the configuration file contains
675an unrecognized directive. The primary reasons are:<br />
676
677(a) The directive should be placed into a particular section of the
678configuration file, but the section header is not present (or you forgot
679to uncomment it).<br />
680
681(b) Samhain is compiled without support for this directive.<br />
682
683(c) You have a typo in the directive.<br /><br><br></dd>
684<dt><b><a name="Misc1">6.2. Why do I get a local logfile if I log to the server ?</a></b></dt>
685<dd>Because you can use all log facilities in parallel. You should
686 switch off in the config file what you don't want/need:
687<div class="block"><pre>
688 [Log]
689 # local log file
690 LogSeverity=none
691</pre></div><br><br></dd>
692<dt><b><a name="Misc2">6.3. Why is there no NIS support with a static samhain executable on Linux ?</a></b></dt>
693<dd>Some functions (including NIS) require
694 libraries that are only available as shared libraries
695 with modern GLIBC versions. While you can always compile a static
696 executable, normally it would still open the shared library at runtime.
697 As of version 1.8.11, samhain avoids this by providing replacement
698 functions from uClibc. However, these do not include NIS support.<br><br></dd>
699<dt><b><a name="Misc3">6.4. Why do I get hundreds of messages about modified CTIME ?</a></b></dt>
700<dd>This happens because some
701 backup applications reset the atime/mtime timestamps, which causes
702 the ctime timestamp to be modified (rootkits avoid this by
703 temporarily resetting the system clock to the original ctime ...).
704 <p>
705 To fix this problem, read the manual of your backup application, or
706 redefine the ReadOnly policy to <i>not</i> check
707 the ctime timestamp:
708<div class="block"><pre>
709 [Misc]
710 RedefReadOnly=-CTM
711</pre></div>
712<div class="warnblock"><pre>
713 Order matters - you must <i>first</i> redefine
714 ReadOnly <i>before</i> you use it
715</pre></div><br><br></dd>
716<dt><b><a name="Misc4">6.5. PANIC &mdash; File not accessible</a></b></dt>
717<dd>Most likely permission denied because of unsufficient privileges.<br><br></dd>
718<dt><b><a name="Misc5">6.6. How can I avoid error messages for invalid UIDs (no such user) ?</a></b></dt>
719<dd>Set SeverityNames to a low value
720<div class="block"><pre>
721[EventSeverity]
722SeverityNames=debug
723</pre></div><br><br></dd>
724<dt><b><a name="Misc6">6.7. [Redhat] The /etc/init.d/(samhain|yule) init script hangs</a></b></dt>
725<dd>Redhat uses &quot;initlog&quot; (see
726 <code>man initlog</code>) in initscripts. If it hangs, most probably
727 samhain/yule runs in the foreground rather than as daemon. Set
728 daemon mode in the configuration file:
729<div class="block"><pre>
730[Misc]
731Daemon=yes
732</pre></div><br><br></dd>
733<dt><b><a name="Misc7">6.8. The /etc/init.d/(samhain|yule) init script exits with: execvp: No such file or directory</a></b></dt>
734<dd>Either the program is not installed, or it is not in the PATH (the one
735 used by the init script, which may be different from your PATH).<br><br></dd>
736<dt><b><a name="Misc8">6.9. Why am I not receiving the &quot;BEGIN LOGKEY&quot; message by email ?</a></b></dt>
737<dd>This message (which contains the key to verify the log file) is generated
738 when logging to the log file starts. It has the severity &quot;ALRT&quot;,
739 thus you should make sure that you have set the logging threshold for
740 email correctly to receive it.<br><br></dd>
741<dt><b><a name="Misc9">6.10. Why does console logging fail if I compile with
742 <code>--enable-(micro-)stealth</code> ?</a></b></dt>
743<dd>The default logging options are more &quot;stealthy&quot;. Set the
744 threshold explicitely rather than relying on the default.<br><br></dd>
745<dt><b><a name="Misc10">6.11. I need a list for my schedule !</a></b></dt>
746<dd>You can have the same effect with a list of schedules. See the section
747&quot;Timing file checks&quot; in the manual.<br><br></dd>
748<dt><b><a name="Misc11">6.12. The hiding kernel module has no effect !</a></b></dt>
749<dd>Most probably you compiled using the wrong &quot;System.map&quot; file.<br><br></dd>
750<dt><b><a name="Misc12">6.13. What does the message &quot;Large lstat/open overhead&quot; mean ?</a></b></dt>
751<dd>Your system needs several seconds to proceed from an lstat() system call
752 to an open() system call. This is a tremenduous overhead, and
753 indicates that either your system has a really severe performance problem,
754 or someone tries to slow down samhain.<br><br></dd>
755<dt><b><a name="Misc13">6.14. What does the message &quot;Device not available path=/dev/random&quot; mean ? I have /dev/random !</a></b></dt>
756<dd>/dev/random blocks unless there is some entropy it can deliver. Samhain
757 will time out and fall back on /dev/urandom after some seconds to avoid
758 hanging for a potentially long time. It will try /dev/random again next
759 time it needs entropy.<br><br></dd>
760<dt><b><a name="Misc14">6.15. Logging to an external program fails; the program receives no data
761 on stdin !</a></b></dt>
762<dd>Probably your program is not designed to <i>wait for input</i>, but exits
763 if reading fails (because there is no data <i>yet</i>). You may want to
764 let your program wait for the terminating &quot;[EOF]&quot; line.<br><br></dd>
765<dt><b><a name="Misc15">6.16. SIGILL on AIX</a></b></dt>
766<dd>For each scanned file, samhain needs to
767 store some information in memory (e.g. to recognize changes that have
768 already been reported, and avoid duplicate reports). On AIX, if you are
769 checking a <i>really huge</i> number of files,
770 memory usage may exceed the default limit of 256 MB, and the process may
771 terminate with SIGILL.
772 <p>
773 The problem can be solved by linking with the flag
774 <code>-bmaxdata:0x80000000</code>. This allows the application to
775 access up to 8 segments (where each segment is 256MB).
776 <p>
777 If you are using gcc, you need to use instead
778 the flag <code>-Wl,bmaxdata:0x80000000</code>, which tells
779 gcc to pass on the
780 <i>bmaxdata</i>
781 flag to the AIX linker. You can use the LDFLAGS environment variable to
782 pass linker flags to the configure script:
783<div class="block"><pre>
784 export LDFLAGS="-Wl,bmaxdata:0x80000000"
785</pre></div><br><br></dd>
786</dl>
787<hr><h2>7. Database</h2>
788<dl>
789<dt><b><a name="Database0">7.1. Why are client messages corrupted / incompletely stored in the DB ?</a></b></dt>
790<dd>Because the messages are not in XML format, and therefore incorrectly
791 parsed. The most frequent reasons are:
792<div class="block"><pre>
793 1.) Your server is compiled with --enable-xml-log, but your client(s)
794 is/are not.
795
796 2.) In your client or server configuration file, you are using
797 the option for a custom message header, but without paying attention
798 to preserving the XML format.
799</pre></div><br><br></dd>
800<dt><b><a name="Database1">7.2. I want / don't want the server timestamps (for client messages) in the SQL database</a></b></dt>
801<dd><div class="block"><pre>
802[Database]
803SetDBServerTstamp = true/false
804</pre></div>
805
806 This will enable/disable logging of the server timestamp for client
807 messages. The server timestamp will be written to a seperate record,
808 with <i>log_ref</i> set to the value of
809 <i>log_index</i> of the corresponding client message.<br><br></dd>
810<dt><b><a name="Database2">7.3. I don't want the client TIMESTAMP messages in the SQL database</a></b></dt>
811<dd><div class="block"><pre>
812 Sending timestamps from the client allows the server to detect if
813 a client is not running anymore (use SetClientTimeLimit=NNN in the
814 [Misc] section of the server config file to set the number of seconds
815 after which the server will issue an error message if no timestamp has
816 been received).
817</pre></div>
818
819 However, you might not want to log these timestamps to the database
820 (or other log facilities). To filter them, you can use two methods
821 (examples are for the SQL database).
822 The first
823 one has the disadvantage that only messages of
824 severity <i>err</i> or higher will be logged:
825<div class="block"><pre>
826 [Misc]
827 UseClientSeverity=yes
828
829 [Log]
830 DatabaseSeverity=err
831</pre></div>
832
833 The second method is more specific &mdash; log everything not
834 belonging to the STAMP class of messages:
835<div class="block"><pre>
836 [Misc]
837 UseClientClass=yes
838
839 [Log]
840 DatabaseClass=PANIC RUN FIL TCP ERR ENET EINPUT
841</pre></div><br><br></dd>
842<dt><b><a name="Database3">7.4. What does the log_ref field mean ?</a></b></dt>
843<dd>NULL are client messages. Nonzero integer is a server timestamp
844 for a client message (where log_ref indicates the log_index entry
845 number of the corresponding client message). Zero indicates a message
846 by the server itself (e.g. the server's start message).<br><br></dd>
847<dt><b><a name="Database4">7.5. How can I check what is in the database ?</a></b></dt>
848<dd>Use a command line client to login to the database and query it:
849<div class="block"><pre>
850 sh$ mysql -u &lt;user_name&gt; -p &lt;database_name&gt;
851 Enter password: ****
852 mysql&gt; SELECT log_index,log_ref,log_host,log_sev,log_msg,path FROM &lt;table_name&gt; WHERE entry_status = 'NEW' ORDER BY log_index;
853 ....
854 mysql&gt; \q
855</pre></div><br><br></dd>
856</dl>
857<hr>
858
859<p>Copyright (c) 2004 Rainer Wichmann</p>
860
861<p><i>This list of questions and answers was generated by
862<a href="http://www.makefaq.org/">makefaq</a>.</i>
863
864</div>
865</body>
866</html>
Note: See TracBrowser for help on using the repository browser.