]> git.sur5r.net Git - bacula/docs/blob - docs/manual/dataencryption.tex
Updates
[bacula/docs] / docs / manual / dataencryption.tex
1
2 \section*{Bacula -- Data Encryption}
3 \label{DataEncryption}
4 \index[general]{Data Encryption}
5 \index[general]{Encryption!Data}
6 \index[general]{Data Encryption}
7 \addcontentsline{toc}{section}{Data Encryption}
8
9 Bacula permits file data encryption and signing within the File Daemon (or
10 Client) prior to sending data to the Storage Daemon.  Upon restoration,
11 file signatures are validated and any mismatches are reported.  At no time
12 does the Director or the Storage Daemon have access to unencrypted file
13 contents.
14
15
16 It is very important to specify what this implementation does NOT
17 do:
18 \begin{itemize}
19 \item There is one important restore problem to be aware of, namely, it's
20   possible for the director to restore new keys or a Bacula configuration
21   file to the client, and thus force later backups to be made with a
22   compromised key and/or with no encryption at all.  You can avoid this by
23   not not changing the location of the keys in your Bacula File daemon
24   configuration file, and not changing your File daemon keys.  If you do
25   change either one, you must ensure that no restore is done that restores
26   the old configuration or the old keys.  In general, the worst effect of
27   this will be that you can no longer connect the File daemon.
28
29 \item The implementation does not encrypt file metadata such as file path
30   names, permissions, and ownership. Extended attributes are also currently
31   not encrypted. However, Mac OS X resource forks are encrypted.
32 \end{itemize}
33
34 Encryption and signing are implemented using RSA private keys coupled with
35 self-signed x509 public certificates. This is also sometimes known as PKI
36 or Public Key Infrastructure. 
37
38 Each File Daemon should be given its own unique private/public key pair.
39 In addition to this key pair, any number of "Master Keys" may be specified
40 -- these are key pairs that may be used to decrypt any backups should the
41 File Daemon key be lost.  Only the Master Key's public certificate should
42 be made available to the File Daemon.  Under no circumstances should the
43 Master Private Key be shared or stored on the Client machine.
44
45 The Master Keys should be backed up to a secure location, such as a CD
46 placed in a in a fire-proof safe or bank safety deposit box. The Master
47 Keys should never be kept on the same machine as the Storage Daemon or
48 Director if you are worried about an unauthorized party compromising either
49 machine and accessing your encrypted backups.
50
51 While less critical than the Master Keys, File Daemon Keys are also a prime
52 candidate for off-site backups; burn the key pair to a CD and send the CD
53 home with the owner of the machine.
54
55 NOTE!!! If you lose your encryption keys, backups will be unrecoverable.
56 {\bf ALWAYS} store a copy of your master keys in a secure, off-site location.
57
58 The basic algorithm used for each backup session (Job) is:
59 \begin{enumerate}
60 \item The File daemon generates a session key.
61 \item The FD encrypts that session key via PKE for all recipients (the file  
62 daemon, any master keys).
63 \item The FD uses that session key to perform symmetric encryption on the data.
64 \end{enumerate}
65
66
67 \subsection*{Building Bacula with Encryption Support}
68 \index[general]{Building Bacula with Encryption Support}
69 \addcontentsline{toc}{subsection}{Building Bacula with Encryption Support}
70
71 The configuration option for enabling OpenSSL encryption support has not changed
72 since Bacula 1.38. To build Bacula with encryption support, you will need
73 the OpenSSL libraries and headers installed.  When configuring Bacula, use:
74
75 \begin{verbatim}
76    ./configure --with-openssl ...
77 \end{verbatim}
78
79
80
81
82 \subsection*{Generating Private/Public Encryption Keypairs}
83 \index[general]{Generating Private/Public Encryption Keypairs}
84 \addcontentsline{toc}{subsection}{Generating Private/Public Encryption Keypairs}
85
86 Generate a Master Key Pair with:
87
88 \footnotesize
89 \begin{verbatim}
90   openssl genrsa -out master.key 2048
91   openssl req -new -key master.key -x509 -out master.cert
92 \end{verbatim}
93 \normalsize
94
95 Generate  a File Daemon Key Pair for each FD:
96
97 \footnotesize
98 \begin{verbatim}
99   openssl genrsa -out fd-example.key 2048
100   openssl req -new -key fd-example.key -x509 -out fd-example.cert
101   cat fd-example.key fd-example.cert >fd-example.pem
102 \end{verbatim}
103 \normalsize
104
105
106 \subsection*{Example Data Encryption Configuration}
107 \index[general]{Example!File Daemon Configuration File}
108 \index[general]{Example!Data Encryption Configuration File}
109 \index[general]{Example Data Encryption Configuration}
110 \addcontentsline{toc}{subsection}{Example Data Encryption Configuration}
111
112     
113 {\bf bacula-fd.conf}
114 \footnotesize
115 \begin{verbatim}
116 FileDaemon {
117    Name = example-fd
118    FDport = 9102                  # where we listen for the director
119    WorkingDirectory = /var/bacula/working
120    Pid Directory = /var/run
121    Maximum Concurrent Jobs = 20
122  
123    PKI Signatures = Yes            # Enable Data Signing
124    PKI Encryption = Yes            # Enable Data Encryption
125    PKI Keypair = "/etc/bacula/fd-example.pem"    # Public and Private Keys
126    PKI Master Key = "/etc/bacula/master.cert"    # ONLY the Public Key
127 }
128 \end{verbatim}
129 \normalsize