Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > df754e4e6f7f5fc8ab9d6ed8559f3e3d > files > 183

bacula-docs-5.0.3-19.fc16.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<!--Converted with LaTeX2HTML 2008 (1.71)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Using Bacula to Improve Computer Security</TITLE>
<META NAME="description" CONTENT="Using Bacula to Improve Computer Security">
<META NAME="keywords" CONTENT="main">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">

<META NAME="Generator" CONTENT="LaTeX2HTML v2008">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">

<LINK REL="STYLESHEET" HREF="main.css">

<LINK REL="next" HREF="Installing_Configuring_MySQ.html">
<LINK REL="previous" HREF="Data_Encryption.html">
<LINK REL="up" HREF="Bacula_Main_Reference.html">
<LINK REL="next" HREF="Installing_Configuring_MySQ.html">
</HEAD>

<BODY >
<!--Navigation Panel-->
<A NAME="tex2html1928"
  HREF="Installing_Configuring_MySQ.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1922"
  HREF="Bacula_Main_Reference.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1916"
  HREF="Data_Encryption.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1924"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1926"
  HREF="Thanks.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1929"
  HREF="Installing_Configuring_MySQ.html">Installing and Configuring MySQL</A>
<B> Up:</B> <A NAME="tex2html1923"
  HREF="Bacula_Main_Reference.html">Bacula Main Reference</A>
<B> Previous:</B> <A NAME="tex2html1917"
  HREF="Data_Encryption.html">Data Encryption</A>
 &nbsp; <B>  <A NAME="tex2html1925"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1927"
  HREF="Thanks.html">Index</A></B> 
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>

<UL>
<LI><A NAME="tex2html1930"
  HREF="Using_Bacula_Improve_Comput.html#SECTION004110000000000000000">The Details</A>
<LI><A NAME="tex2html1931"
  HREF="Using_Bacula_Improve_Comput.html#SECTION004120000000000000000">Running the Verify</A>
<LI><A NAME="tex2html1932"
  HREF="Using_Bacula_Improve_Comput.html#SECTION004130000000000000000">What To Do When Differences Are Found</A>
<LI><A NAME="tex2html1933"
  HREF="Using_Bacula_Improve_Comput.html#SECTION004140000000000000000">A Verify Configuration Example</A>
</UL>
<!--End of Table of Child-Links-->
<HR>

<H1><A NAME="SECTION004100000000000000000"></A>
<A NAME="VerifyChapter"></A>
<BR>
Using Bacula to Improve Computer Security
</H1>
<A NAME="20102"></A>
<A NAME="20103"></A>

<P>
Since Bacula maintains a catalog of files, their attributes, and either SHA1
or MD5 signatures, it can be an ideal tool for improving computer security.
This is done by making a snapshot of your system files with a <B>Verify</B> Job
and then checking the current state of your system against the snapshot, on a
regular basis (e.g. nightly). 

<P>
The first step is to set up a <B>Verify</B> Job and to run it with: 

<P>
<PRE>
Level = InitCatalog
</PRE>
<P>
The <B>InitCatalog</B> level tells <B>Bacula</B> simply to get the information on
the specified files and to put it into the catalog. That is your database is
initialized and no comparison is done. The <B>InitCatalog</B> is normally run
one time manually. 

<P>
Thereafter, you will run a Verify Job on a daily (or whatever) basis with: 

<P>
<PRE>
Level = Catalog
</PRE>
<P>
The <B>Level = Catalog</B> level tells Bacula to compare the current state of
the files on the Client to the last <B>InitCatalog</B> that is stored in the
catalog and to report any differences. See the example below for the format of
the output. 

<P>
You decide what files you want to form your "snapshot" by specifying them in
a <B>FileSet</B> resource, and normally, they will be system files that do not
change, or that only certain features change. 

<P>
Then you decide what attributes of each file you want compared by specifying
comparison options on the <B>Include</B> statements that you use in the <B>FileSet</B> resource of your <B>Catalog</B> Jobs. 

<P>

<H1><A NAME="SECTION004110000000000000000">
The Details</A>
</H1>
<A NAME="20120"></A>

<P>
In the discussion that follows, we will make reference to the Verify
Configuration Example that is included below in the <B>A Verify
Configuration Example</B> section. You might want to look it over now to get an
idea of what it does. 

<P>
The main elements consist of adding a schedule, which will normally be run
daily, or perhaps more often. This is provided by the <B>VerifyCycle</B>
Schedule, which runs at 5:05 in the morning every day. 

<P>
Then you must define a Job, much as is done below. We recommend that the Job
name contain the name of your machine as well as the word <B>Verify</B> or <B>Check</B>. In our example, we named it <B>MatouVerify</B>. This will permit you to
easily identify your job when running it from the Console. 

<P>
You will notice that most records of the Job are quite standard, but that the
<B>FileSet</B> resource contains <B>verify=pins1</B> option in addition to the
standard <B>signature=SHA1</B> option. If you don't want SHA1 signature
comparison, and we cannot imagine why not, you can drop the <B>signature=SHA1</B> and none will be computed nor stored in the catalog. Or
alternatively, you can use <B>verify=pins5</B> and <B>signature=MD5</B>, which
will use the MD5 hash algorithm. The MD5 hash computes faster than SHA1, but
is cryptographically less secure. 

<P>
The <B>verify=pins1</B> is ignored during the <B>InitCatalog</B> Job, but is
used during the subsequent <B>Catalog</B> Jobs to specify what attributes of
the files should be compared to those found in the catalog. <B>pins1</B> is a
reasonable set to begin with, but you may want to look at the details of these
and other options. They can be found in the 
FileSet ResourceFileSetResource section of this manual.
Briefly, however, the <B>p</B> of the <B>pins1</B> tells Verify to compare the
permissions bits, the <B>i</B> is to compare inodes, the <B>n</B> causes
comparison of the number of links, the <B>s</B> compares the file size, and the
<B>1</B> compares the SHA1 checksums (this requires the <B>signature=SHA1</B>
option to have been set also). 

<P>
You must also specify the <B>Client</B> and the <B>Catalog</B> resources for
your Verify job, but you probably already have them created for your client
and do not need to recreate them, they are included in the example below for
completeness. 

<P>
As mentioned above, you will need to have a <B>FileSet</B> resource for the
Verify job, which will have the additional <B>verify=pins1</B> option. You will
want to take some care in defining the list of files to be included in your
<B>FileSet</B>. Basically, you will want to include all system (or other) files
that should not change on your system. If you select files, such as log files
or mail files, which are constantly changing, your automatic Verify job will
be constantly finding differences. The objective in forming the FileSet is to
choose all unchanging important system files. Then if any of those files has
changed, you will be notified, and you can determine if it changed because you
loaded a new package, or because someone has broken into your computer and
modified your files. The example below shows a list of files that I use on my
Red Hat 7.3 system. Since I didn't spend a lot of time working on it, it
probably is missing a few important files (if you find one, please send it to
me). On the other hand, as long as I don't load any new packages, none of
these files change during normal operation of the system. 

<P>

<H1><A NAME="SECTION004120000000000000000">
Running the Verify</A>
</H1>
<A NAME="20151"></A>
<A NAME="20152"></A>

<P>
The first thing you will want to do is to run an <B>InitCatalog</B> level
Verify Job. This will initialize the catalog to contain the file information
that will later be used as a basis for comparisons with the actual file
system, thus allowing you to detect any changes (and possible intrusions into
your system). 

<P>
The easiest way to run the <B>InitCatalog</B> is manually with the console
program by simply entering <B>run</B>. You will be presented with a list of
Jobs that can be run, and you will choose the one that corresponds to your
Verify Job, <B>MatouVerify</B> in this example. 

<P>
<PRE>
The defined Job resources are:
     1: MatouVerify
     2: kernsrestore
     3: Filetest
     4: kernsave
Select Job resource (1-4): 1
</PRE>
<P>
Next, the console program will show you the basic parameters of the Job and
ask you: 

<P>
<PRE>
Run Verify job
JobName:  MatouVerify
FileSet:  Verify Set
Level:    Catalog
Client:   MatouVerify
Storage:  DLTDrive
OK to run? (yes/mod/no): mod
</PRE>
<P>
Here, you want to respond <B>mod</B> to modify the parameters because the Level
is by default set to <B>Catalog</B> and we want to run an <B>InitCatalog</B>
Job. After responding <B>mod</B>, the console will ask: 

<P>
<PRE>
Parameters to modify:
     1: Job
     2: Level
     3: FileSet
     4: Client
     5: Storage
Select parameter to modify (1-5): 2
</PRE>
<P>
you should select number 2 to modify the <B>Level</B>, and it will display: 

<P>
<PRE>
Levels:
     1: Initialize Catalog
     2: Verify from Catalog
     3: Verify Volume
     4: Verify Volume Data
Select level (1-4): 1
</PRE>
<P>
Choose item 1, and you will see the final display: 

<P>
<PRE>
Run Verify job
JobName:  MatouVerify
FileSet:  Verify Set
Level:    Initcatalog
Client:   MatouVerify
Storage:  DLTDrive
OK to run? (yes/mod/no): yes
</PRE>
<P>
at which point you respond <B>yes</B>, and the Job will begin. 

<P>
Thereafter the Job will automatically start according to the schedule you
have defined. If you wish to immediately verify it, you can simply run a
Verify <B>Catalog</B> which will be the default. No differences should be
found. 

<P>

<H1><A NAME="SECTION004130000000000000000">
What To Do When Differences Are Found</A>
</H1>
<A NAME="20175"></A>
<A NAME="20176"></A>

<P>
If you have setup your messages correctly, you should be notified if there are
any differences and exactly what they are. For example, below is the email
received after doing an update of OpenSSH: 

<P>
<PRE>
HeadMan: Start Verify JobId 83 Job=RufusVerify.2002-06-25.21:41:05
HeadMan: Verifying against Init JobId 70 run 2002-06-21 18:58:51
HeadMan: File: /etc/pam.d/sshd
HeadMan:       st_ino   differ. Cat: 4674b File: 46765
HeadMan: File: /etc/rc.d/init.d/sshd
HeadMan:       st_ino   differ. Cat: 56230 File: 56231
HeadMan: File: /etc/ssh/ssh_config
HeadMan:       st_ino   differ. Cat: 81317 File: 8131b
HeadMan:       st_size  differ. Cat: 1202 File: 1297
HeadMan:       SHA1 differs.
HeadMan: File: /etc/ssh/sshd_config
HeadMan:       st_ino   differ. Cat: 81398 File: 81325
HeadMan:       st_size  differ. Cat: 1182 File: 1579
HeadMan:       SHA1 differs.
HeadMan: File: /etc/ssh/ssh_config.rpmnew
HeadMan:       st_ino   differ. Cat: 812dd File: 812b3
HeadMan:       st_size  differ. Cat: 1167 File: 1114
HeadMan:       SHA1 differs.
HeadMan: File: /etc/ssh/sshd_config.rpmnew
HeadMan:       st_ino   differ. Cat: 81397 File: 812dd
HeadMan:       st_size  differ. Cat: 2528 File: 2407
HeadMan:       SHA1 differs.
HeadMan: File: /etc/ssh/moduli
HeadMan:       st_ino   differ. Cat: 812b3 File: 812ab
HeadMan: File: /usr/bin/scp
HeadMan:       st_ino   differ. Cat: 5e07e File: 5e343
HeadMan:       st_size  differ. Cat: 26728 File: 26952
HeadMan:       SHA1 differs.
HeadMan: File: /usr/bin/ssh-keygen
HeadMan:       st_ino   differ. Cat: 5df1d File: 5e07e
HeadMan:       st_size  differ. Cat: 80488 File: 84648
HeadMan:       SHA1 differs.
HeadMan: File: /usr/bin/sftp
HeadMan:       st_ino   differ. Cat: 5e2e8 File: 5df1d
HeadMan:       st_size  differ. Cat: 46952 File: 46984
HeadMan:       SHA1 differs.
HeadMan: File: /usr/bin/slogin
HeadMan:       st_ino   differ. Cat: 5e359 File: 5e2e8
HeadMan: File: /usr/bin/ssh
HeadMan:       st_mode  differ. Cat: 89ed File: 81ed
HeadMan:       st_ino   differ. Cat: 5e35a File: 5e359
HeadMan:       st_size  differ. Cat: 219932 File: 234440
HeadMan:       SHA1 differs.
HeadMan: File: /usr/bin/ssh-add
HeadMan:       st_ino   differ. Cat: 5e35b File: 5e35a
HeadMan:       st_size  differ. Cat: 76328 File: 81448
HeadMan:       SHA1 differs.
HeadMan: File: /usr/bin/ssh-agent
HeadMan:       st_ino   differ. Cat: 5e35c File: 5e35b
HeadMan:       st_size  differ. Cat: 43208 File: 47368
HeadMan:       SHA1 differs.
HeadMan: File: /usr/bin/ssh-keyscan
HeadMan:       st_ino   differ. Cat: 5e35d File: 5e96a
HeadMan:       st_size  differ. Cat: 139272 File: 151560
HeadMan:       SHA1 differs.
HeadMan: 25-Jun-2002 21:41
JobId:                  83
Job:                    RufusVerify.2002-06-25.21:41:05
FileSet:                Verify Set
Verify Level:           Catalog
Client:                 RufusVerify
Start time:             25-Jun-2002 21:41
End time:               25-Jun-2002 21:41
Files Examined:         4,258
Termination:            Verify Differences
</PRE>
<P>
At this point, it was obvious that these files were modified during
installation of the RPMs. If you want to be super safe, you should run a <B>Verify Level=Catalog</B> immediately before installing new software to verify
that there are no differences, then run a <B>Verify Level=InitCatalog</B>
immediately after the installation. 

<P>
To keep the above email from being sent every night when the Verify Job runs,
we simply re-run the Verify Job setting the level to <B>InitCatalog</B> (as we
did above in the very beginning). This will re-establish the current state of
the system as your new basis for future comparisons. Take care that you don't
do an <B>InitCatalog</B> after someone has placed a Trojan horse on your
system! 

<P>
If you have included in your <B>FileSet</B> a file that is changed by the
normal operation of your system, you will get false matches, and you will need
to modify the <B>FileSet</B> to exclude that file (or not to Include it), and
then re-run the <B>InitCatalog</B>. 

<P>
The FileSet that is shown below is what I use on my Red Hat 7.3 system. With a
bit more thought, you can probably add quite a number of additional files that
should be monitored. 

<P>

<H1><A NAME="SECTION004140000000000000000">
A Verify Configuration Example</A>
</H1>
<A NAME="20187"></A>
<A NAME="20188"></A>

<P>
<PRE>
Schedule {
  Name = "VerifyCycle"
  Run = Level=Catalog sun-sat at 5:05
}
Job {
  Name = "MatouVerify"
  Type = Verify
  Level = Catalog                     # default level
  Client = MatouVerify
  FileSet = "Verify Set"
  Messages = Standard
  Storage = DLTDrive
  Pool = Default
  Schedule = "VerifyCycle"
}
#
# The list of files in this FileSet should be carefully
# chosen. This is a good starting point.
#
FileSet {
  Name = "Verify Set"
  Include {
    Options {
      verify=pins1
      signature=SHA1
    }
    File = /boot
    File = /bin
    File = /sbin
    File = /usr/bin
    File = /lib
    File = /root/.ssh
    File = /home/kern/.ssh
    File = /var/named
    File = /etc/sysconfig
    File = /etc/ssh
    File = /etc/security
    File = /etc/exports
    File = /etc/rc.d/init.d
    File = /etc/sendmail.cf
    File = /etc/sysctl.conf
    File = /etc/services
    File = /etc/xinetd.d
    File = /etc/hosts.allow
    File = /etc/hosts.deny
    File = /etc/hosts
    File = /etc/modules.conf
    File = /etc/named.conf
    File = /etc/pam.d
    File = /etc/resolv.conf
  }
  Exclude = { }
P
Client {
  Name = MatouVerify
  Address = lmatou
  Catalog = Bacula
  Password = ""
  File Retention = 80d                # 80 days
  Job Retention = 1y                  # one year
  AutoPrune = yes                     # Prune expired Jobs/Files
}
Catalog {
  Name = Bacula
  dbname = verify; user = bacula; password = ""
}
</PRE>
<P>

<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1928"
  HREF="Installing_Configuring_MySQ.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> 
<A NAME="tex2html1922"
  HREF="Bacula_Main_Reference.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> 
<A NAME="tex2html1916"
  HREF="Data_Encryption.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> 
<A NAME="tex2html1924"
  HREF="Contents.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> 
<A NAME="tex2html1926"
  HREF="Thanks.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> 
<BR>
<B> Next:</B> <A NAME="tex2html1929"
  HREF="Installing_Configuring_MySQ.html">Installing and Configuring MySQL</A>
<B> Up:</B> <A NAME="tex2html1923"
  HREF="Bacula_Main_Reference.html">Bacula Main Reference</A>
<B> Previous:</B> <A NAME="tex2html1917"
  HREF="Data_Encryption.html">Data Encryption</A>
 &nbsp; <B>  <A NAME="tex2html1925"
  HREF="Contents.html">Contents</A></B> 
 &nbsp; <B>  <A NAME="tex2html1927"
  HREF="Thanks.html">Index</A></B> 
<!--End of Navigation Panel-->
<ADDRESS>

2012-01-24
</ADDRESS>
</BODY>
</HTML>