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