This file is indexed.

/usr/share/doc/samhain/manual.html/trustedexample.html is in samhain 3.1.0-5ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Log file</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="The Samhain Host Integrity Monitoring System"
HREF="index.html"><LINK
REL="UP"
TITLE="Configuration of logging facilities"
HREF="basic-configuration.html"><LINK
REL="PREVIOUS"
TITLE="E-mail"
HREF="configuration-email.html"><LINK
REL="NEXT"
TITLE="Log server"
HREF="configuration-logserver.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="./docbook.css"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><!--#if expr="! ($HTTP_USER_AGENT = /MSIE/)"--><!--#include virtual="/resources/ssi/header.html"--><!--#endif --><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>The Samhain Host Integrity Monitoring System</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="configuration-email.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 4. Configuration of logging facilities</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="configuration-logserver.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="TRUSTEDEXAMPLE"
>4.5. Log file</A
></H1
><P
>  <P
></P
><DIV
CLASS="VARIABLELIST"
><DL
><DT
>Trusted users</DT
><DD
><P
>	<B
CLASS="COMMAND"
>TrustedUser=<TT
CLASS="REPLACEABLE"
><I
>username</I
></TT
></B
>
        </P
><P
>	If some element in the path to the log file is
	writeable by someone else than <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>root</I
></SPAN
> 
        or the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>effective user</I
></SPAN
> 
        of the process, you have to include
	that user in the list of <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>trusted users</I
></SPAN
> 
        (unless their UIDs 
        are already compiled in).
    </P
></DD
><DT
>Separate log files for clients</DT
><DD
><P
>	<B
CLASS="COMMAND"
>UseSeparateLogs=<TT
CLASS="REPLACEABLE"
><I
>yes/no</I
></TT
></B
>
        </P
><P
>	<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Only relevant on the server.</I
></SPAN
>
	Use a separate log file for (reports from) each client.
	The root name of these log files will be the same as the main
	log file, with the client name appended.
    </P
></DD
></DL
></DIV
>        </P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="LOGFILE"
>4.5.1. The log file and its integrity</A
></H2
><P
>  The log file is named <TT
CLASS="FILENAME"
>samhain_log</TT
> by default, 
  and placed into
  <TT
CLASS="FILENAME"
>/var/log</TT
> by default 
  (name and location can be configured
  at compile time). If <SPAN
CLASS="APPLICATION"
>samhain</SPAN
> has been 
  compiled with the
  <B
CLASS="COMMAND"
>./configure --enable-xml-log</B
> option, 
  it will be written in XML format.
  </P
><DIV
CLASS="NOTE"
><P
></P
><TABLE
CLASS="NOTE"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="./stylesheet-images/note.gif"
HSPACE="5"
ALT="Note"></TD
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
><B
>Note</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>  If you have compiled for stealth (<A
HREF="stealthmode.html"
>Chapter 9</A
>&#62;),
  you won't see much, because if obfuscated, then both a 'normal' and an 
  XML logfile look, well ... obfuscated. Use 
  <B
CLASS="COMMAND"
>samhain -jL <TT
CLASS="REPLACEABLE"
><I
>/path/to/logfile</I
></TT
></B
>
  to view the logfile.
  </P
></TD
></TR
></TABLE
></DIV
><P
>  The log file is created if it does not exist, and locked by creating
  a <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>lock file</I
></SPAN
>, which has the same path as the logfile,
  with a &quot;.lock&quot; appended. The lock file holds the PID of 
  the process, which allows <SPAN
CLASS="APPLICATION"
>samhain</SPAN
> to recognize
  and remove a stale lock if there is no process with that PID.
  </P
><P
>  On the log server, it is possible to use separate log files for 
  individual clients. This can be enabled with 
  <B
CLASS="COMMAND"
>UseSeparateLogs=<TT
CLASS="REPLACEABLE"
><I
>yes/no</I
></TT
></B
>
  in the Misc section of the server configuration file. No locking will
  be performed for client files (only one instance of the server can
  listen on the TCP port, thus there will be no concurrent access).
  </P
><P
>  The directory where the logfile and its lock file are located 
  must be writeable
  only by trusted users (see <A
HREF="layout.html#DEFTRUST"
>Section 2.10.1</A
>&#62;). This requirement
  refers to the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>complete</I
></SPAN
> path, i.e. all directories 
  therein. By default,
  only <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>root</I
></SPAN
> and the <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>effective user</I
></SPAN
>
  of 
  the process are trusted.
  </P
><P
>  Audit trails (sequences of messages from individual runs of 
  <SPAN
CLASS="APPLICATION"
>samhain</SPAN
>) 
  in the log file start with a <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>[SOF]</I
></SPAN
> marker. 
  Each message is followed
  by a signature, that is formed by hashing the message with a key.
  </P
><P
>  The first key is generated at random, and sent by e-mail, encrypted with a 
  one-time pad as described in the previous section on e-mail.
  Further keys are generated by a hash chain (i.e. the key is hashed to
  generate the next key). Thus, only by knowing the initial key the
  integrity of the log file can be assured.
  </P
><P
>  The mail with the key looks like:
  </P
><PRE
CLASS="PROGRAMLISTING"
>  -----BEGIN MESSAGE-----  
  message    
  -----BEGIN LOGKEY----- 
  Key(48 chars)[timestamp]     
  -----BEGIN SIGNATURE----- 
  signature
  ID TRAIL_ID:hostname 
  -----END MESSAGE-----  </PRE
><DIV
CLASS="TIP"
><P
></P
><TABLE
CLASS="TIP"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="./stylesheet-images/tip.gif"
HSPACE="5"
ALT="Tip"></TD
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
><B
>Integrity verification</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>  <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>To verify the log file's integrity</I
></SPAN
>, 
  a convenience function is
  provided:
  </P
><P
>  <B
CLASS="COMMAND"
>samhain -L <TT
CLASS="REPLACEABLE"
><I
>/log/file/path</I
></TT
></B
>
  </P
><P
>  When encountering the start of an audit trail, you will then be asked
  for the key (as sent to you by e-mail). You can then: 
  (i) hit <B
CLASS="COMMAND"
>return</B
> to skip signature verification,
  (ii) enter the key (without the appended timestamp), or
  (iii) enter the path to a file that contains the key (e.g. the mail box).
  </P
><P
>  If you use option (iii), the path must be an absolute path (starting
  with a '/', not longer than 48 chars. For each audit trail, the file
  must contain a two-line block with the 
  <SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>-----BEGIN LOGKEY-----</I
></SPAN
> line 
  followed by the
  line (<SPAN
CLASS="emphasis"
><I
CLASS="EMPHASIS"
>Key(48 chars)[timestamp]</I
></SPAN
>) from the mail. 
  Additional lines
  before/after any such two-line block are ignored (in particular, if you 
  collect all e-mails from <SPAN
CLASS="APPLICATION"
>samhain</SPAN
> in 
  a mailbox file, you can simply
  specify the path to that mailbox file).
  </P
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="WARNING"
><P
></P
><TABLE
CLASS="WARNING"
WIDTH="100%"
BORDER="0"
><TR
><TD
WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
><IMG
SRC="./stylesheet-images/warning.gif"
HSPACE="5"
ALT="Warning"></TD
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
><B
>CAVEATS</B
></TH
></TR
><TR
><TD
>&nbsp;</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
><P
>  Verification will fail, if the compiled-in key of the verifying executable
  is different from the one that generated the message(s) 
  (see <A
HREF="keypad.html"
>Section 11.2</A
>&#62;).
  </P
><P
>  If you use a pre-compiled executable from some binary
  distribution, be sure to read <A
HREF="keypad.html"
>Section 11.2</A
>&#62; carefully.
  </P
></TD
></TR
></TABLE
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="configuration-email.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="configuration-logserver.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>E-mail</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="basic-configuration.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Log server</TD
></TR
></TABLE
></DIV
><!--#if expr="! ($HTTP_USER_AGENT = /MSIE/)"--><!--#include virtual="/resources/ssi/footer.html"--><!--#endif --></BODY
></HTML
>