]> git.sur5r.net Git - bacula/docs/blob - docs/manual/tls.tex
046fc0f9d012db74b964bfc70d530ca743cdb7ac
[bacula/docs] / docs / manual / tls.tex
1
2 \section*{Bacula TLS}
3 \label{_ChapterStart61}
4 \index[general]{Bacula TLS}
5 \index[general]{TLS}
6 \addcontentsline{toc}{section}{Bacula TLS}
7
8 Bacula TLS (Transport Layer Security) is built-in network
9 encryption code to provide secure network transport similar to
10 that offered by {\bf stunnel} or {\bs ssh}. The Bacula code was
11 written by Landon Fuller.
12
13 Supported features of this code include: 
14 \begin{itemize} 
15 \item Client/Server TLS Requirement Negotiation 
16 \item TLSv1 Connections with Server and Client Certificate
17 Validation 
18 \item Forward Secrecy Support via Diffie-Hellman Ephemeral Keying 
19 \end{itemize}
20
21 This document will refer to both ``server'' and ``client'' contexts.  These
22 terms refer to the accepting and initiating peer, respectively.
23
24 Diffie-Hellman anonymous ciphers are not supported by this code.  The
25 use of DH anonymous ciphers increases the code complexity and places
26 explicit trust upon the two-way Cram-MD5 implementation.  Cram-MD5 is
27 subject to known plaintext attacks, and it should be considered
28 considerably less secure than PKI certificate-based authentication.
29
30 Appropriate autoconf macros have been added to detect and use OpenSSL  
31 if enabled on the {\bf ./configure} line with {\bf \verb?--?enable-openssl}
32
33
34 \subsection*{TLS Configuration Directives}
35 \addcontentsline{toc}{section}{TLS Configuration Directives}
36 Additional configuration directives have been added to all the daemons
37 (Director, File daemon, and Storage daemon) as well as the various
38 different Console programs.
39 These new directives are defined as follows:
40
41 \begin{description}
42 \item [TLS Enable = \lt{}yes|no\gt{}]
43 Enable TLS support.
44
45 \item [TLS Require = \lt{}yes|no\gt{}]
46 Require TLS connections.
47
48 \item [TLS Certificate = \lt{}Directory\gt{}]
49 Path to PEM encoded TLS certificate.  Used as either a client or server
50 certificate.
51
52 \item [TLS Key = \lt{}Directory\gt{}]
53 Path to PEM encoded TLS private key.  Must correspond with the TLS
54 certificate.
55
56 \item [TLS Verify Peer = \lt{}yes|no\gt{}]
57 Verify peer certificate.  Instructs server to request and verify the
58 client's x509 certificate.  Any client certificate signed by a known-CA
59 will be accepted unless the TLS Allowed CN configuration directive is used.
60 Not valid in a client context.
61
62 \item [TLS Allowed CN = \lt{}string list\gt{}]
63 Common name attribute of allowed peer certificates.  If directive is
64 specified, all client certificates will be verified against this list.
65 This directive may be specified more than once.  Not valid in a client
66 context.
67
68 \item [TLS CA Certificate File = \lt{}Directory\gt{}]
69 Path to PEM encoded TLS CA certificate(s).  Multiple certificates are
70 permitted in the file.  One of \emph{TLS CA Certificate File} or \emph{TLS
71 CA Certificate Dir} are required in a server context if \emph{TLS
72 Verify Peer} (see above) is also specified, and are always required in a client
73 context.
74
75 \item [TLS CA Certificate Dir = \lt{}Directory\gt{}]
76 Path to TLS CA certificate directory.  In the current implementation,
77 certificates must be stored PEM encoded with OpenSSL-compatible hashes.
78 One of \emph{TLS CA Certificate File} or \emph{TLS CA Certificate Dir} are
79 required in a server context if \emph{TLS Verify Peer} is also specified,
80 and are always required in a client context.
81
82 \item [TLS DH File = \lt{}Directory\gt{}]
83 Path to PEM encoded Diffie-Hellman parameter file.  If this directive is
84 specified, DH ephemeral keying will be enabled, allowing for forward
85 secrecy of communications.  This directive is only valid within a server
86 context.  To generate the parameter file, you may use openssl:
87
88 \begin{verbatim} 
89    openssl dhparam -out dh1024.pem -5 1024 
90 \end{verbatim}
91
92 \end{itemize}
93
94 \subsection*{Creating a Self-signed Certificate}
95 \index[general]{Creating a Self-signed Certificate }
96 \index[general]{Certificate!Creating a Self-signed }
97 \addcontentsline{toc}{subsection}{Creating a Self-signed Certificate}
98
99 You may create a self-signed certificate for use with the Bacula TLS
100 that will permit
101 you to make it function, but will not allow certificate validation. The .pem
102 file containing both the certificate and the key can be made with the
103 following, which I put in a file named {\bf makepem}: 
104
105 \footnotesize
106 \begin{verbatim}
107 #!/bin/sh
108 #
109 # Simple shell script to make a .pem file that can be used
110 # with stunnel and Bacula
111 #
112 OPENSSL=openssl
113    umask 77
114    PEM1=`/bin/mktemp openssl.XXXXXX`
115    PEM2=`/bin/mktemp openssl.XXXXXX`
116    ${OPENSSL} req -newkey rsa:1024 -keyout $PEM1 -nodes \
117        -x509 -days 365 -out $PEM2
118    cat $PEM1 > stunnel.pem
119    echo ""   >>stunnel.pem
120    cat $PEM2 >>stunnel.pem
121    rm $PEM1 $PEM2
122 \end{verbatim}
123 \normalsize
124
125 The above script will ask you a number of questions. You may simply answer
126 each of them by entering a return, or if you wish you may enter your own data.
127
128
129 \subsection*{Getting a CA Signed Certificate}
130 \index[general]{Certificate!Getting a CA Signed }
131 \index[general]{Getting a CA Signed Certificate }
132 \addcontentsline{toc}{subsection}{Getting a CA Signed Certificate}
133
134 The process of getting a certificate that is signed by a CA is quite a bit
135 more complicated. You can purchase one from quite a number of PKI vendors, but
136 that is not at all necessary for use with Bacula. To get a CA signed
137 certificate, you will either need to find a friend that has setup his own CA
138 or to become a CA yourself, and thus you can sign all your own certificates.
139 The book OpenSSL by John Viega, Matt Mesier \& Pravir Chandra from O'Reilly
140 explains how to do it, or you can read the documentation provided in the
141 Open-source PKI Book project at Source Forge: 
142 \elink{
143 http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm}
144 {http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm}.
145 Note, this link may change.