source: trunk/docs/FAQ.html@ 284

Last change on this file since 284 was 101, checked in by rainer, 17 years ago

Fix compile bug with --with-kcheck

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