Debian Codegraph @

manuals/en/main/tls.tex

raw
1 \chapter{\bacula{} \acs{TLS} -- Communications Encryption}
2 \label{blb:CommEncryption}
3 \index[general]{\acs{TLS} -- Communications Encryption}
4 \index[general]{Communications Encryption}
5 \index[general]{Encryption!Communications}
6 \index[general]{Encryption!Transport}
7 \index[general]{Transport Encryption}
8 \index[general]{PSK}
9 \index[general]{\acs{TLS}}
10
11 \bacula{} \ac{TLS} is built-in network encryption code
12 to provide secure network transport similar to that offered by \btool{stunnel} or \btool{ssh}.
13 The \bacula{} \ac{TLS} encryption applies only to information transmitted across a network, so the data written to Volumes by
14 the Storage daemon is not encrypted by this code. For data encryption, please see the \acs{PKI} options described in \bilink{Data Encryption chapter}{blb:DataEncryption} of this manual.
15
16 The \bacula{} encryption implementation was initially written by Landon Fuller.
17
18 Supported features of this code include:
19 \begin{bitemize}
20 \item Client/Server \acs{TLS} Requirement Negotiation
21 \item \acs{TLS}v1.2 Connections with Server and Client Certificate
22 Validation
23 \item Forward Secrecy Support via Diffie-Hellman Ephemeral Keying
24 \item \acs{TLS-PSK} is used by default\footnote{starting with version 12.0} when TLS certificates are not configured.
25 \end{bitemize}
26
27 This document will refer to both ``server'' and ``client'' contexts.
28 These terms refer to the accepting and initiating peer, respectively. In
29 addition, each of the three daemons (Director, File daemon, Storage
30 daemon) as well as the user interface programs (\btool{bconsole}, \btool{tray monitor},
31 \ldots{}) use the same \acs{TLS} configuration directives. When we are speaking of
32 one or all of these daemons/programs, we will generally refer to them as a ``component''.
33
34 Diffie-Hellman anonymous ciphers are not supported by this code. The
35 use of \acs{DH} anonymous ciphers increases the code complexity and places
36 explicit trust upon the two-way \acs{CRAM}-\acs{MD}5 implementation. \acs{CRAM}-\acs{MD}5 is
37 subject to known plaintext attacks, and it should be considered
38 considerably less secure than \acs{PKI} certificate-based authentication.
39
40 Appropriate autoconf macros have been added to detect and use
41 \bfootref{https://www.openssl.org/}{OpenSSL}
42 if enabled on the \btool{./configure} line with \textbf{{-}{-}with-openssl}
43
44 \section{\acs{TLS} Configuration Directives}
45 Additional configuration directives have been added to all the components (daemons) (Director, File daemon, and Storage daemon) as well as the various different Console programs).
46
47 Note that for the connection between a Storage Daemon and a File Daemon or between two Storage
48 Daemons, the TLS directives that will be used are the ones defined in the Client \texttt{FileDaemon} resource
49 and in the Storage \texttt{Storage} resource.
50
51 The default value of the directive \textbf{\acs{TLS-PSK} Enable} is
52 \bvalue{yes}, if both \textbf{\acs{TLS} Enable} and \textbf{\acs{TLS-PSK} Enable} are enable on both side,
53 then Bacula will use \acs{TLS} certificates.
54
55 If none of \acs{TLS} or \acs{TLS-PSK} are enabled, then the \acs{TLS} directives have no effect.
56
57 These new directives are defined as follows:
58
59 \begin{bdescription}
60 % To get the documentation available on every directive, we include this section
61 % in other parts of the manual
62 % BEGIN-TLS
63 \bwebdoc{Main:TlsEnable}
64 \item [\acs{TLS} Enable = \byesorno{}]
65
66 Enable \acs{TLS} support. If \acs{TLS}
67 is not enabled, none of the other \acs{TLS} directives have any effect. In
68 other words, even if you set \textbf{\acs{TLS} Require = yes} you need to
69 have \acs{TLS} enabled or \acs{TLS} will not be used.
70
71 \bwebdoc{Main:TlsPskEnable}
72 \item [\acs{TLS} PSK Enable = \byesorno{}]
73
74 Enable or Disable automatic \acs{TLS} PSK support. \acs{TLS} PSK is enabled
75 by default between all \bacula{} components. The Pre-Shared Key used between
76 the programs is the \bacula{} password. If both \bdirectivename{TLS Enable}
77 and \bdirectivename{TLS PSK Enable} are enabled, the system will use TLS
78 certificates.
79
80 \bwebdoc{Main:TlsRequire}
81 \item [\acs{TLS} Require = \byesorno{}]
82
83 Require \acs{TLS} or \acs{TLS-PSK} encryption. This directive is ignored
84 unless one of \textbf{\acs{TLS} Enable} or \textbf{\acs{TLS} PSK Enable} is set to \bvalue{yes}.
85 If \acs{TLS} is not required while \acs{TLS} or \acs{TLS-PSK} are enabled,
86 then the \bacula{} component will connect with other components either with
87 or without \acs{TLS} or \acs{TLS-PSK}
88
89 If \acs{TLS} or \acs{TLS-PSK} is enabled and \acs{TLS} is required, then
90 the \bacula{} component will refuse any connection request that does not use \acs{TLS}.
91
92 \bwebdoc{Main:TlsAuthenticate}
93 \item [\acs{TLS} Authenticate = \byesorno{}]
94 \index[general]{\acs{TLS} authentication}
95 When \bdirectivename{\acs{TLS} Authenticate} is enabled, after doing the \acs{CRAM}-\acs{MD}5
96 authentication, \bacula{} will also do \acs{TLS} authentication, then \acs{TLS}
97 encryption will be turned off, and the rest of the communication between
98 the two \bacula{} components will be done without encryption.
99 If \acs{TLS-PSK} is used instead of the regular \acs{TLS}, the
100 encryption is turned off after the \acs{TLS-PSK} authentication step.
101
102 If you want to encrypt communications data, use the normal \acs{TLS} directives
103 but do \textbf{not} turn on \bdirectivename{\acs{TLS} Authenticate}.
104
105 \bwebdoc{Main:TlsCertificate}
106 \item [\acs{TLS} Certificate = \bbracket{Filename}]
107 The full path and filename of a \acs{PEM} encoded \acs{TLS} certificate. It will be
108 used as either a client or server certificate, depending on the connection direction. \acs{PEM} stands for \acl{PEM}, but in this context refers to how the certificates are
109 encoded. This format is used because \acs{PEM} files are base64 encoded and hence \acs{ASCII}
110 text based rather than binary. They may also contain encrypted
111 information.
112
113 This directive is required in a server context, but it may not be specified in a client context if \bdirectivename{\acs{TLS} Verify Peer} is set to \bvalue{no} in the corresponding server context.
114
115 \bwebdoc{Main:EndX}
116
117 Example:
118
119 File Daemon configuration file (\bfilename{bacula-fd.conf}), \bDirector{} resource configuration has \bvalueddirective{\acs{TLS} Verify Peer}{no}:
120 \begin{bVerbatim}
121 Director {
122 Name = bacula-dir
123 Password = "password"
124 Address = director.example.com
125
126 # TLS configuration directives
127 TLS Enable = yes
128 TLS Require = yes
129 TLS Verify Peer = no
130 TLS CA Certificate File = /opt/bacula/ssl/certs/root_cert.pem
131 TLS Certificate = /opt/bacula/ssl/certs/client1_cert.pem
132 TLS Key = /opt/bacula/ssl/keys/client1_key.pem
133 }
134 \end{bVerbatim}
135
136 Having \bvalueddirective{\acs{TLS} Verify Peer}{no}, means the File Daemon, server context, will not check Director’s public certificate, client context. There is no need to specify \bdirectivename{\acs{TLS} Certificate File} neither \bdirectivename{\acs{TLS} Key} directives in the \bClient{} resource, director configuration file. We can have the below client configuration in \bfilename{bacula-dir.conf}:
137
138 \begin{bVerbatim}
139 Client {
140 Name = client1-fd
141 Address = client1.example.com
142 FDPort = 9102
143 Catalog = MyCatalog
144 Password = "password"
145 ...
146 # TLS configuration directives
147 TLS Enable = yes
148 TLS Require = yes
149 TLS CA Certificate File = /opt/bacula/ssl/certs/ca_client1_cert.pem
150 }
151 \end{bVerbatim}
152
153 \bwebdoc{Main:TlsKey}
154 \item [TLS Key = \bbracket{Filename}]
155 The full path and filename of a \acs{PEM} encoded \acs{TLS} private key. It must
156 correspond to the \acs{TLS} certificate.
157
158 \bwebdoc{Main:TlsVerifyPeer}
159 \item [\acs{TLS} Verify Peer = \byesorno{}]\label{blb:tls:verifypeer}
160 Verify peer certificate. Instructs server to request and verify the
161 client's \bfootref{https://en.wikipedia.org/wiki/X.509}{X.509} certificate. Any client certificate signed by a known-\acs{CA}
162 will be accepted. Additionally, the client's X509 certificate Common Name must meet the value of the \bdirectivename{Address} directive. If the \bdirectivename{\acs{TLS}Allowed CN} onfiguration directive is used, the client's x509 certificate Common Name must also correspond to one of the \acs{CN} specified in the \bdirectivename{\acs{TLS} Allowed CN} directive. This directive is valid only for a server and not in client context. The default is \bdefaultvalue{yes}.
163
164 \bwebdoc{Main:TlsAllowedCn}
165 \item [\acs{TLS} Allowed CN = \bbracket{string list}]
166 Common name attribute of allowed peer certificates. This directive is valid for a server and in a client context. If this directive is specified, the peer certificate will be verified against this list. In the case this directive is configured on a server side, the allowed \acs{CN} list will not be checked if \bdirectivename{\acs{TLS} Verify Peer} is set to \bvalue{no} (\bdirectivename{\acs{TLS} Verify Peer} is \bdefaultvalue{yes} by default). This can be used to ensure that only the \acs{CN}-approved component may connect. This directive may be specified more than once.
167
168 In the case this directive is configured in a server side, the allowed \acs{CN} list will only be checked if \bdirectivename{\acs{TLS} Verify Peer = yes} (default). For example, in \bfilename{bacula-fd.conf}, \bDirector{} resource definition:
169 \begin{bVerbatim}
170 Director {
171 Name = bacula-dir
172 Password = "password"
173 Address = director.example.com
174 # TLS configuration directives
175 TLS Enable = yes
176 TLS Require = yes
177 # if TLS Verify Peer = no, then TLS Allowed CN will not be checked.
178 TLS Verify Peer = yes
179 TLS Allowed CN = director.example.com
180 TLS CA Certificate File = /opt/bacula/ssl/certs/root_cert.pem
181 TLS Certificate = /opt/bacula/ssl/certs/client1_cert.pem
182 TLS Key = /opt/bacula/ssl/keys/client1_key.pem
183 }
184 \end{bVerbatim}
185
186 In the case this directive is configured in a client side, the allowed \acs{CN} list will always be checked.
187
188 \begin{bVerbatim}
189 Client {
190 Name = client1-fd
191 Address = client1.example.com
192 FDPort = 9102
193 Catalog = MyCatalog
194 Password = "password"
195 ...
196 # TLS configuration directives
197 TLS Enable = yes
198 TLS Require = yes
199 # the Allowed CN will be checked for this client by director
200 # the client's certificate Common Name must match any of
201 # the values of the Allowed CN list
202 TLS Allowed CN = client1.example.com
203 TLS CA Certificate File = /opt/bacula/ssl/certs/ca_client1_cert.pem
204 TLS Certificate = /opt/bacula/ssl/certs/director_cert.pem
205 TLS Key = /opt/bacula/ssl/keys/director_key.pem
206 }
207 \end{bVerbatim}
208
209 If the client doesn’t provide a certificate with a Common Name that meets any value in the \bdirectivename{\acs{TLS} Allowed CN} list, an error message will be issued:
210
211 \begin{bVerbatim}
212 16-Nov 17:30 bacula-dir JobId 0: Fatal error: bnet.c:273 TLS certificate
213 verification failed. Peer certificate did not match a required commonName
214 16-Nov 17:30 bacula-dir JobId 0: Fatal error: TLS negotiation failed with FD at
215 "192.168.100.2:9102".
216 \end{bVerbatim}
217
218 \bwebdoc{Main:TlsCaCertificateFile}
219 \item [\acs{TLS} CA Certificate File = \bbracket{Filename}]
220 The full path and filename specifying a \acs{PEM} encoded \acs{TLS} \acs{CA} certificate(s). Multiple certificates are permitted in the file. One of \bdirectivename{\acs{TLS} \acs{CA} Certificate File} or \bdirectivename{\acs{TLS} \acs{CA} Certificate Dir} are required in a server context, unless \bdirectivename{\acs{TLS} Verify Peer} (see above) is set to \bvalue{no}, and are always required in a client context.
221
222 \bwebdoc{Main:TlsCaCertificateDir}
223 \item [\acs{TLS} CA Certificate Dir = \bbracket{Directory}]
224 Full path to \acs{TLS} \acs{CA} certificate directory. In the current implementation,
225 certificates must be stored \acs{PEM} encoded with OpenSSL-compatible hashes,
226 which is the subject name's hash and an extension of \textbf{.0}. One of \bdirectivename{\acs{TLS} \acs{CA} Certificate File} or \bdirectivename{\acs{TLS} \acs{CA} Certificate Dir} are required in a server context, unless \bdirectivename{\acs{TLS} Verify Peer} is set to \bvalue{no}, and are always required in a client context.
227
228 \bwebdoc{Main:TlsDhFile}
229 \item [\acs{TLS} DH File = \bbracket{Directory}]
230 Path to \acs{PEM} encoded Diffie-Hellman parameter file. If this directive is
231 specified, \acs{DH} key exchange will be used for the ephemeral keying, allowing
232 for forward secrecy of communications. \acs{DH} key exchange adds an additional
233 level of security because the key used for encryption/decryption by the
234 server and the client is computed on each end and thus is never passed over
235 the network if Diffie-Hellman key exchange is used. Even if \acs{DH} key
236 exchange is not used, the encryption/decryption key is always passed
237 encrypted. This directive is only valid within a server context.
238
239 To generate the parameter file, you may use \btool{openssl}:
240
241 \begin{bVerbatim}
242 openssl dhparam -out dh4096.pem -5 4096
243 \end{bVerbatim}
244
245 \bwebdoc{Main:TlsEnd}
246 % END-TLS
247 % End of the section that is used in other files
248 \end{bdescription}
249
250 \section{Creating a Self-Signed Certificate}
251 \index[general]{Creating a Self-Signed Certificate }
252 \index[general]{Certificate!Creating a Self-Signed }
253
254 A self-signed certificate for use with the \bacula{} \acs{TLS} that
255 will work, but will not allow proper certificate
256 validation can be created easily. The .pem file containing both the certificate and the key
257 valid for about ten years can be created as follows:
258
259 \begin{bVerbatim}
260 openssl req -new -x509 -nodes -out bacula.pem -keyout bacula.pem -days 3650
261 \end{bVerbatim}
262
263 The above command will ask a number of questions. You may simply answer each of them by entering a return, or if you wish you may enter your own data.
264
265 Note, however, that self-signed certificates will only work for the
266 outgoing end of connections. For example, in the case of the Director
267 making a connection to a File Daemon, the File Daemon may be configured to
268 allow self-signed certificates, but the certificate used by the
269 Director must be signed by a certificate that is explicitly trusted on the
270 File Daemon end.
271
272 This is necessary to prevent ``man in the middle'' attacks from tools such
273 as \bfootref{https://www.ettercap-project.org/}{ettercap}. Essentially, if the
274 Director does not verify that it is talking to a trusted remote endpoint,
275 it can be tricked into talking to any malicious 3$^{rd}$ party who is relaying and
276 capturing all traffic by presenting its own certificates to the Director
277 and File Daemons. The only way to prevent this is by using trusted
278 certificates, so that the man in the middle is incapable of spoofing the
279 connection using his own.
280
281 %% To get a trusted certificate (\acs{CA} or \acl{CA} signed
282 %% certificate), you will either need to purchase certificates signed by a
283 %% commercial \acs{CA} or find a friend that has setup his own \acs{CA} or become a \acs{CA}
284 %% yourself, and thus you can sign all your own certificates. The book
285 %% \bfootref{shop.oreilly.com/product/9780596002701.do}{OpenSSL by John Viega, Matt Mesier \& Pravir Chandra}\footnote{This link is valid as of the 07-december-2016}
286 %% from \bfootref{http://www.oreilly.com/}{O'Reilly} explains
287 %% how to do it, or you can read the documentation provided in the
288 %% \bfootref{http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm}{Open-source \acs{PKI} Book}.
289 %% % project at Source Forge: \bref{http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm}.
290 %% Note, this link may change but is valid as of the 07 December 2016.
291
292 %% The program TinyCA has a very nice \ac{GUI}
293 %% that allows you to easily setup and maintain your own \acs{CA}.
294 %% TinyCA can be found at \bref{http://tinyca.sm-zone.net/}{tinyca.sm-zone.net/}. As of the 7th of December, 2016, this link is not valid. This project seems to be dead.
295 %% Dogtag is a quite usable CA package... in the RHEL world, it's the default and supported
296 %% CA suite. It is freely available in particular with Fedora, where you usually get
297 %% more or less the bleeding edge of its functionality.
298 %% It *is* quite a bit to swallow, though...
299
300
301 \section{Getting a \acs{CA} Signed Certificate}
302 \index[general]{Certificate!Getting a \acs{CA} Signed }
303 \index[general]{Getting a \acs{CA} Signed Certificate }
304
305 The process of getting a certificate that is signed by a \acs{CA} is quite a bit
306 more complicated. You can purchase one from a number of \acs{PKI} vendors, but that is not at all necessary for use with \bacula{}.
307 \smallskip
308
309 To get a \acs{CA} signed certificate, you will either need to find a friend that has setup his own, trusted \acs{CA}, or to become a \acs{CA} yourself, and thus you can sign all your own certificates. The book \bfootref{shop.oreilly.com/product/9780596002701.do}{OpenSSL by John Viega, Matt Mesier \& Pravir Chandra from O'Reilly}\footnote{This link is valid as of the 27-september-2018} explains how to do it, or you can read the documentation provided in the \bfootref{http://ospkibook.sourceforge.net/docs/OSPKI-2.4.7/OSPKI-html/ospki-book.htm}{Open-source \acs{PKI} Book}.
310
311 \section{Example \acs{TLS} Configuration Files}
312 \index[general]{Example!\acs{TLS} Configuration Files}
313 \index[general]{\acs{TLS} Configuration Files}
314 A few examples of the \acs{TLS} portions of configuration files are shown, which should help you setting up your own.
315
316 For the examples in this section, we will consider three hosts named darkstar, arrakis and caladan, in order to have examples with components running in different machines. The following private key and public certificate files will be used:
317 \begin{bVerbatim}
318 * host darkstar.example.com:
319
320 /opt/bacula/ssl/keys/darkstar_key.pem
321 /opt/bacula/ssl//certs/darkstar_cert.pem
322
323 * host arrakis.example.com:
324
325 /opt/bacula/ssl/keys/arrakis_key.pem
326 /opt/bacula/ssl//certs/arrakis_cert.pem
327
328 * host caladan.example.com:
329
330 /opt/bacula/ssl/keys/caladan_key.pem
331 /opt/bacula/ssl//certs/caladan_cert.pem
332 \end{bVerbatim}
333
334 The \bdirectivename{\acs{TLS} Verify Peer = yes} is present in the below examples to emphasize where it can be configured, but there is no need since this is the \textbf{default value used by \bacula{}}. This means that both server and client certificates will be checked in the \acs{TLS} communication handshake. The \ac{CN} in the peer certificate will be checked against the \bdirectivename{Address} directive configured for the corresponding resource.
335
336 The \bdirectivename{\acs{TLS} Allowed \acs{CN} = \bbracket{\acs{FQDN} or \acs{IP} address}} is configured to ensure that only the peer certificates with a \acs{CN} Subject field listed here are authorized to communicate. For example, consider the below certificate:
337
338 \begin{bVerbatim}
339 # openssl x509 -in ../ssl/certs/arrakis_cert.pem -text -noout
340 Certificate:
341 Data:
342 Version: 3 (0x2)
343 Serial Number: 1 (0x1)
344 Signature Algorithm: sha256WithRSAEncryption
345 Issuer: C=US, ST=Yverdon-les-Bains, L=Vaud, O=Bacula Systems, CN=ca.baculasystems.com/[email protected]
346 Validity
347 Not Before: Sep 7 09:50:27 2016 GMT
348 Not After : Dec 31 23:59:00 2021 GMT
349 Subject: C=CH, ST=Madrid, O=BaculaSystems, CN=arrakis.example.com
350 Subject Public Key Info:
351 Public Key Algorithm: rsaEncryption
352 Public-Key: (4096 bit)
353 Modulus:
354 00:ae:7f:3f:6f:22:27:c3:c5:f5:d3:d6:f9:fd:8f:
355 a0:7c:40:33:4c:90:1e:43:b2:14:fa:d3:82:00:b0:
356 88:df:71:43:29:f7:7b:de:b4:87:0a:52:80:43:f7:
357 1a:c9:1f:0f:c1:7c:27:00:45:5b:c4:a3:c3:a0:4a:
358 14:53:7b:f6:33:54:44:70:41:8c:50:70:a1:eb:50:
359 7a:52:87:6d:6c:84:2e:e5:48:86:9c:60:48:96:8e:
360 48:2c:4b:13:87:af:94:cf:56:c1:74:e9:f5:4b:f9:
361 16:32:fe:3a:65:a1:ef:eb:99:97:1a:10:e6:7f:6e:
362 f3:18:1f:1f:67:f7:2a:38:0b:4b:00:70:0b:34:37:
363 8c:04:56:02:ec:41:43:35:0c:c5:0c:8a:b2:91:00:
364 7c:39:95:65:1e:b4:49:44:f6:af:87:d9:27:1e:a2:
365 74:b3:5d:98:ac:da:53:fe:f6:9b:ee:15:fa:34:29:
366 14:48:90:d6:61:31:43:3e:c0:30:f6:59:bb:b8:00:
367 3b:98:a3:e8:d5:73:f1:ff:f5:23:d5:ac:87:57:ce:
368 18:9f:35:1f:c2:4d:ba:44:05:b4:e3:ba:47:17:6a:
369 76:5c:84:5c:f9:ce:83:19:87:ff:67:5b:82:24:4a:
370 35:99:b1:91:7c:43:c9:84:2f:d4:1d:cf:6f:23:84:
371 13:ae:59:28:66:a5:da:a4:5d:14:a4:04:69:21:4b:
372 dd:d3:68:a3:16:0e:5f:23:4d:51:12:10:e3:f5:24:
373 38:51:67:bf:cf:73:10:9a:b3:44:ff:87:bf:23:47:
374 db:36:f0:c4:4a:6a:16:21:1f:ec:3c:1e:a9:c8:84:
375 b4:2e:e5:d7:a1:d7:29:57:69:be:67:e9:1f:f5:66:
376 dc:4b:c8:89:58:53:cd:c3:63:5e:58:86:48:db:71:
377 3b:9f:25:1a:91:27:93:bf:1f:20:49:fc:b9:5b:ea:
378 ba:b5:29:28:f2:a2:10:c5:ed:1c:fa:75:11:d2:22:
379 7a:fd:50:be:56:e7:13:b1:a6:59:3b:aa:4b:8e:54:
380 4b:1a:10:d8:6b:9c:46:ce:d8:7e:9a:f5:e7:28:62:
381 6b:25:7c:ad:e6:64:4c:c0:4e:dc:1a:d8:c6:20:68:
382 8b:3a:7a:8d:86:df:2e:e5:ab:39:7d:a1:3a:84:19:
383 55:9b:46:2c:81:19:77:2c:2f:ca:6f:49:e0:92:98:
384 c5:36:5a:db:4c:d8:58:04:4c:af:17:38:0e:2c:b1:
385 21:1d:8b:88:69:69:fa:de:e7:fc:f0:9a:1a:71:1b:
386 5e:68:51:b1:ef:44:1c:d6:a4:2d:55:93:b8:4c:e7:
387 e2:dc:5b:99:ed:79:3a:02:6e:4e:61:32:62:03:a8:
388 be:b2:4d
389 Exponent: 65537 (0x10001)
390 X509v3 extensions:
391 X509v3 Basic Constraints:
392 CA:FALSE
393 Netscape Comment:
394 OpenSSL Generated Certificate
395 X509v3 Subject Key Identifier:
396 EC:FC:DC:5C:A5:50:1B:AE:B5:04:40:E3:C6:72:63:9F:F8:34:A3:89
397 X509v3 Authority Key Identifier:
398 keyid:3B:36:FF:19:37:DF:12:D1:78:CC:F7:88:13:25:3D:CD:62:59:0F:9B
399 Signature Algorithm: sha256WithRSAEncryption
400 6d:f0:74:43:a7:9a:1b:99:ee:9e:51:e8:9c:5f:4c:f3:c3:f4:
401 ff:f5:5c:b4:e2:33:07:ed:fd:d5:09:e8:6f:b5:83:51:66:58:
402 53:66:04:75:46:6b:5b:2a:ac:d8:54:78:df:de:d0:fc:6c:57:
403 6e:0c:c9:3c:cf:62:64:63:cd:f3:a2:5b:fe:57:8c:12:7a:08:
404 6a:53:b0:de:0e:c2:c7:35:9c:78:d5:27:98:05:b3:8c:54:fa:
405 4f:0a:34:fc:4d:5f:14:93:5a:b1:86:2d:4a:74:e4:d8:83:e7:
406 99:dd:36:56:a0:11:ff:d8:68:d2:62:13:72:96:4f:66:08:7c:
407 f7:ce:7f:8f:2a:7d:c0:fc:fe:bf:1a:38:43:cc:01:aa:46:e4:
408 ac:d7:be:65:51:a6:bc:6c:80:ed:54:76:0b:b8:b8:4b:a1:85:
409 d5:9b:14:2b:65:19:cf:0f:65:5f:32:b8:9e:36:5c:c2:6f:92:
410 7c:c5:db:90:11:40:db:e7:37:23:c5:78:1f:c0:09:c5:11:b8:
411 06:30:3b:95:82:17:3e:49:51:7e:91:45:2e:a6:d1:89:1f:49:
412 dc:6d:a9:1d:92:53:bd:ff:a2:cf:7b:8e:40:ab:96:4a:82:fd:
413 5e:c7:04:53:2d:55:0c:78:57:03:5c:c1:6c:b1:12:ce:5f:be:
414 10:9f:76:2c:5a:79:5a:a3:3c:68:ee:8c:69:c8:ac:cc:c5:09:
415 fb:19:50:cb:5e:61:8a:9b:47:74:60:68:2a:94:49:6f:0f:22:
416 78:6d:9b:ff:76:24:60:d1:ee:c6:59:59:e2:6f:f2:69:3f:ae:
417 43:53:54:a1:ab:e0:ae:30:13:82:64:9c:ce:c1:fa:de:6a:7d:
418 bb:94:a4:05:6e:03:84:d2:f1:f2:5d:1d:45:4c:bb:88:0b:6a:
419 b6:74:8b:4b:fb:cf:99:6e:1d:ed:df:67:97:92:a7:0d:08:a7:
420 57:be:7e:6e:06:13:f7:42:12:7a:05:aa:a9:1c:1b:1d:86:73:
421 00:66:a7:07:88:d0:2d:eb:2b:dc:6e:e0:61:15:d9:ff:43:65:
422 2d:99:c1:e6:80:ea:26:c4:08:ae:3c:12:ef:f0:6e:15:00:33:
423 53:6a:c1:e3:14:5c:f3:ec:df:72:c1:ee:ca:ff:f6:c9:51:22:
424 79:62:af:00:07:92:7c:0c:75:17:98:1d:b2:43:b2:fa:a7:41:
425 d4:64:8e:3e:47:1c:f6:a0:aa:e3:30:d1:d7:5c:91:5c:ea:80:
426 dc:31:8f:a2:40:fc:ac:4d:05:02:cb:c3:b4:f6:b5:98:58:7e:
427 31:c2:0c:85:1b:a4:95:ed:77:bb:dc:95:12:81:45:6c:5c:2f:
428 c4:7e:d3:86:9c:b0:1a:d4
429 \end{bVerbatim}
430
431 If a component (director, file daemon, storage daemon or console) has \bdirectivename{\acs{TLS} Allowed CN = arrakis.example.com}, it will accept only connections from peers that have ``\acs{CN}=arrakis.example.com'' in the subject field of their certificate. The \bdirectivename{\acs{TLS} Allowed \acs{CN}} directive can have a list of values like \bdirectivename{\acs{TLS} Allowed \acs{CN} = darkstar.example.com, arrakis.example.com}. This will permit the clients with \acs{CN} Subject field equal to \bvalue{darkstar.example.com} or \bvalue{arrakis.example.com} to be allowed for connection. The below examples are configured with \bdirectivename{\acs{TLS} Allowed \acs{CN}} to show where and how to configure this directive.
432
433 \subsection{Enable \acs{TLS} Communications Encryption Between Console and Director}
434
435 \subsubsection{Director and Console are on the Same ``darkstar'' Host}
436
437 \begin{benumerate}
438 \item\label{blb:enum:anonymousconsole} If you are using an anonymous console:\\
439 You only need to define the \acs{TLS} directives in the \bDirector{} resource of both \bfilename{bacula-dir.conf} and \bfilename{bconsole.conf} files.
440 \begin{bitemize}
441 \item In \bfilename{bacula-dir.conf}:\\
442 \begin{bVerbatim}
443 Director {
444 Name = darkstar-dir
445 DIR Port = 9111
446 DIR Address = darkstar.example.com
447 QueryFile = "/usr/local/bacula/scripts/query.sql"
448 WorkingDirectory = "/usr/local/bacula/working"
449 PidDirectory = "/var/run"
450 Maximum Concurrent Jobs = 10
451 Password = "password"
452 Messages = Daemon
453 TLS Enable = yes
454 TLS Require = yes
455 TLS Verify Peer = yes
456 TLS Allowed CN = darkstar.example.com
457 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
458 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
459 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
460 }
461 \end{bVerbatim}
462 \item In \bfilename{bconsole.conf}:\\
463 \begin{bVerbatim}
464 Director {
465 Name = darkstar-dir
466 DIRport = 9111
467 Address = darkstar.example.com
468 Password = "password"
469 TLS Enable = yes
470 TLS Require = yes
471 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
472 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
473 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
474 }
475 \end{bVerbatim}
476 \end{bitemize}
477 \item If a named console is used:\\
478 You only need to define the \acs{TLS} directives in the \bConsole{} resource of both \bfilename{bacula-dir.conf} and \bfilename{bconsole.conf}.
479 \begin{bitemize}
480 \item In \bfilename{bacula-dir.conf}:\\
481 There is no need to configure \acs{TLS} in the \bDirector{} resource as for option \vref{blb:enum:anonymousconsole}\\
482 \begin{bVerbatim}
483 Director {
484 Name = darkstar-dir
485 DIR Port = 9111
486 DIR Address = darkstar.example.com
487 QueryFile = "/usr/local/bacula/scripts/query.sql"
488 WorkingDirectory = "/usr/local/bacula/working"
489 PidDirectory = "/var/run"
490 Maximum Concurrent Jobs = 10
491 Password = "password"
492 Messages = Daemon
493 }
494 \end{bVerbatim}
495 Instead, the named \bConsole{} resource has the \acs{TLS} configuration:\\
496 \begin{bVerbatim}
497 Console {
498 Name = darkstar-con
499 Password = "password"
500 TLS Enable = yes
501 TLS Require = yes
502 TLS Verify Peer = yes
503 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
504 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
505 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
506 }
507 \end{bVerbatim}
508 \item In \bfilename{bconsole.conf}:\\
509 There is no need to configure \acs{TLS} in the \bDirector{} resource as for option \vref{blb:enum:anonymousconsole}:\\
510 \begin{bVerbatim}
511 Director {
512 Name = darkstar-dir
513 DIRport = 9111
514 Address = darkstar.example.com
515 Password = "password"
516 }
517 \end{bVerbatim}
518 Instead, the \bConsole{} resource contains the \acs{TLS} configuration:
519 \begin{bVerbatim}
520 Console {
521 Name = darkstar-con
522 Password = "password"
523 TLS Enable = yes
524 TLS Require = yes
525 TLS Verify Peer = yes
526 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
527 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
528 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
529 }
530 \end{bVerbatim}
531 \end{bitemize}
532 \end{benumerate}
533
534 \subsubsection{Director and Console are on Different Hosts}
535
536 If you have your \bconsole{} installed on another host than the Director one, then it is more likely that different public certificate and private key files for director and for console are used. Let's consider ``darkstart-dir'' director on ``darkstar.example.com'' and ``arrakis-con'' console on ``arrakis.example.com''.
537
538 \subsection{Enable \acs{TLS} Communications Encryption Between Console and Director}
539 \begin{benumerate}
540 \item\label{blb:enum:diffhost:anonymous} If you're using an anonymous console:\\
541 \begin{bitemize}
542 \item In \bfilename{bacula-dir.conf}:\\
543 \begin{bVerbatim}
544 Director {
545 Name = darkstar-dir
546 DIR Port = 9111
547 DIR Address = darkstar.example.com
548 QueryFile = "/usr/local/bacula/scripts/query.sql"
549 WorkingDirectory = "/usr/local/bacula/working"
550 PidDirectory = "/var/run"
551 Maximum Concurrent Jobs = 10
552 Password = "password"
553 Messages = Daemon
554 TLS Enable = yes
555 TLS Require = yes
556 TLS Verify Peer = yes
557 TLS Allowed CN = darkstar.example.com
558 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
559 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
560 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
561 }
562 \end{bVerbatim}
563 \item In \bfilename{bconsole.conf}:\\
564 \begin{bVerbatim}
565 Director {
566 Name = darkstar-dir
567 DIRport = 9111
568 Address = darkstar.example.com
569 Password = "password"
570 TLS Enable = yes
571 TLS Require = yes
572 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
573 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
574 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
575 }
576 \end{bVerbatim}
577 \end{bitemize}
578 \item If you are using a named console:
579 \begin{bitemize}
580 \item In \bfilename{bacula-dir.conf}:\\
581 There is no need to configure \acs{TLS} in the \bDirector{} resource as for option \vref{blb:enum:diffhost:anonymous}:\\
582 \begin{bVerbatim}
583 Director {
584 Name = darkstar-dir
585 DIR Port = 9111
586 DIR Address = darkstar.example.com
587 QueryFile = "/usr/local/bacula/scripts/query.sql"
588 WorkingDirectory = "/usr/local/bacula/working"
589 PidDirectory = "/var/run"
590 Maximum Concurrent Jobs = 10
591 Password = "password"
592 Messages = Daemon
593 }
594 \end{bVerbatim}
595 Instead, the \bConsole{} resource has the \acs{TLS} configurations:\\
596 \begin{bVerbatim}
597 Console {
598 Name = arrakis-con
599 Password = "password"
600 TLS Enable = yes
601 TLS Require = yes
602 TLS Allowed CN = arrakis.example.com
603 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
604 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
605 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
606 }
607 \end{bVerbatim}
608 \item In \bfilename{bconsole.conf}:
609 It is not needed to configure \acs{TLS} in the \bDirector{} resource as for \vref{blb:enum:diffhost:anonymous}:\\
610 \begin{bVerbatim}
611 Director {
612 Name = darkstar-dir
613 DIRport = 9111
614 Address = darkstar.example.com
615 Password = "password"
616 }
617 \end{bVerbatim}
618 Instead, the \bConsole{} resource needs the \acs{TLS} configuration:\\
619 \begin{bVerbatim}
620 Console {
621 Name = arrakis-con
622 Password = "password"
623 TLS Enable = yes
624 TLS Require = yes
625 TLS Verify Peer = yes
626 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
627 TLS Certificate = /usr/local/bacula/etc/ssl/certs/arrakis_cert.pem
628 TLS Key = /usr/local/bacula/etc/ssl/keys/arrakis_key.pem
629 }
630 \end{bVerbatim}
631 \end{bitemize}
632 \end{benumerate}
633
634 \subsection{Enable \acs{TLS} Communications Encryption between Director and File Daemon}
635
636 \subsubsection{Director and File Daemon are on the Same ``darkstar'' Host}
637 \begin{bitemize}
638 \item In \bfilename{bacula-dir.conf}:\\
639 \begin{bVerbatim}
640 Client {
641 Name = darkstar-fd
642 Address = darkstar.example.com
643 FD Port = 9112
644 Catalog = MyCatalog
645 Password = "password"
646 AutoPrune = no
647 Maximum Concurrent Jobs = 4
648 TLS Enable = yes
649 TLS Require = yes
650 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
651 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
652 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
653 }
654 \end{bVerbatim}
655 \item In \bfilename{bacula-fd.conf}:
656 \begin{bVerbatim}
657 Director {
658 Name = darkstar-dir
659 Password = "password"
660 TLS Enable = yes
661 TLS Require = yes
662 TLS Verify Peer = yes
663 TLS Allowed CN = darkstart.example.com
664 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
665 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
666 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
667 }
668 \end{bVerbatim}
669 \end{bitemize}
670
671 \subsubsection{Director and File Daemon are on Different Hosts}
672
673 Let's consider ``darkstart-dir'' director at ``darkstar.example.com'' and the ``arrakis-fd'' file daemon on ``arrakis.example.com''.
674 \begin{bitemize}
675 \item In \bfilename{bacula-dir.conf}:\\
676 \begin{bVerbatim}
677 Client {
678 Name = arrakis-fd
679 Address = arrakis.example.com
680 FD Port = 9112
681 Catalog = MyCatalog
682 Password = "password"
683 AutoPrune = no
684 Maximum Concurrent Jobs = 4
685 TLS Enable = yes
686 TLS Require = yes
687 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
688 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
689 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
690 }
691 \end{bVerbatim}
692 \item In \bfilename{bacula-fd.conf}:\\
693 \begin{bVerbatim}
694 Director {
695 Name = darkstar-dir
696 Password = "password"
697 TLS Enable = yes
698 TLS Require = yes
699 TLS Require = yes
700 TLS Verify Peer = yes
701 TLS Allowed CN = arrakis.example.com
702 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
703 TLS Certificate = /usr/local/bacula/etc/ssl/certs/arrakis_cert.pem
704 TLS Key = /usr/local/bacula/etc/ssl/keys/arrakis_key.pem
705 }
706 \end{bVerbatim}
707 \end{bitemize}
708
709 \subsection{Enable \acs{TLS} Communications Encryption Between Director and Storage Daemon}
710
711 \subsubsection{Director and Storage Daemon are on the Same ``darkstar'' Host}
712 \begin{bitemize}
713 \item In \bfilename{bacula-dir.conf}:\\
714 \begin{bVerbatim}
715 Storage {
716 Name = VTL-storage
717 SD Port = 9113
718 Address = darkstar.example.com
719 Password = "password"
720 Device = "Virtual Tape Library"
721 Autochanger = yes
722 Media Type = VTL
723 Maximum Concurrent Jobs = 30
724 TLS Enable = yes
725 TLS Require = yes
726 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
727 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
728 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
729 }
730 \end{bVerbatim}
731 \item In bacula-sd.conf:\\
732 \begin{bVerbatim}
733 Director {
734 Name = darkstar-dir
735 Password = "password"
736 TLS Enable = yes
737 TLS Require = yes
738 TLS Verify Peer = yes
739 TLS Allowed CN = darkstart.example.com
740 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
741 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
742 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
743 }
744 \end{bVerbatim}
745 \end{bitemize}
746
747 \subsubsection{Director and Storage Daemon are on Different Hosts}
748
749 Let's consider the ``darkstart-dir'' director on ``darkstar.example.com'' and the ``caladan-sd'' storage daemon running on ``caladan.example.com''.
750 \begin{bitemize}
751 \item In \bfilename{bacula-dir.conf}:\\
752 \begin{bVerbatim}
753 Storage {
754 Name = VTL-storage
755 SD Port = 9113
756 Address = caladan.example.com
757 Password = "password"
758 Device = "Virtual Tape Library"
759 Autochanger = yes
760 Media Type = VTL
761 Maximum Concurrent Jobs = 30
762 TLS Enable = yes
763 TLS Require = yes
764 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
765 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
766 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
767 }
768 \end{bVerbatim}
769 \item In bacula-sd.conf:\\
770 \begin{bVerbatim}
771 Director {
772 Name = darkstar-dir
773 Password = "password"
774 TLS Enable = yes
775 TLS Require = yes
776 TLS Verify Peer = yes
777 TLS Allowed CN = caladan.example.com
778 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
779 TLS Certificate = /usr/local/bacula/etc/ssl/certs/caladan_cert.pem
780 TLS Key = /usr/local/bacula/etc/ssl/keys/caladan_key.pem
781 }
782 \end{bVerbatim}
783 \end{bitemize}
784
785 \subsection{Enable \acs{TLS} Communications Encryption Between File Daemon and Storage Daemon}
786
787 Let's consider ``darkstar-fd'' (on ``darkstar.example.com'') and ``arrakis-fd'' (at ``arrakis.example.com'') clients, needing to connect to ``caladan-sd'' storage daemon at ``caladan.example.com'' using \acs{TLS}.
788
789 \begin{bitemize}
790 \item In \bfilename{bacula-fd.conf} file at darkstar.example.com:
791 \begin{bVerbatim}
792 FileDaemon {
793 Name = darkstar-fd
794 FD Port = 9112
795 FD Address = darkstar.example.com
796 WorkingDirectory = /usr/local/bacula/working
797 Pid Directory = /var/run
798 Maximum Concurrent Jobs = 10
799 TLS Enable = yes
800 TLS Require = yes
801 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
802 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
803 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
804 }
805 \end{bVerbatim}
806 \item In \bfilename{bacula-fd.conf} file at ``arrakis.example.com'':
807 \begin{bVerbatim}
808 FileDaemon {
809 Name = arrakis-fd
810 FD Port = 9112
811 FD Address = arrakis.example.com
812 WorkingDirectory = /usr/local/bacula/working
813 Pid Directory = /var/run
814 Maximum Concurrent Jobs = 10
815 TLS Enable = yes
816 TLS Require = yes
817 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
818 TLS Certificate = /usr/local/bacula/etc/ssl/certs/arrakis_cert.pem
819 TLS Key = /usr/local/bacula/etc/ssl/keys/arrakis_key.pem
820 }
821 \end{bVerbatim}
822 \item In bacula-sd.conf file at ``caladan.example.com'':\\
823 \begin{bVerbatim}
824 Storage {
825 Name = caladan-sd
826 SD Port = 9113
827 SD Address = caladan.example.com
828 WorkingDirectory = "/usr/local/bacula/working"
829 Pid Directory = "/var/run"
830 Maximum Concurrent Jobs = 40
831 TLS Enable = yes
832 TLS Require = yes
833 TLS Allowed CN = darkstar.example.com , arrakis.example.com
834 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
835 TLS Certificate = /usr/local/bacula/etc/ssl/certs/caladan_cert.pem
836 TLS Key = /usr/local/bacula/etc/ssl/keys/caladan_key.pem
837 }
838 \end{bVerbatim}
839 \end{bitemize}
840
841 Please note that the \bdirectivename{\acs{TLS} Allowed CN} directive is only configured on the Storage Daemon side.
842 This is due to the fact that the communication in this case is always between the Storage Daemon acting as a ``\acs{TLS} server'' and the File Daemon acting as a ``\acs{TLS} client''. In this case, the client is the peer in the \acs{TLS} communications context. The \ac{CN} in the client's certificate subject will be checked by the Storage Daemon if it is an ``\emph{Allowed \acs{CN}}''. in the case of the above example, \bdirectivename{\acs{TLS} Allowed CN = darkstar.example.com, arrakis.example.com} is allowing ``darkstar-fd'' (at darkstar.example.com) and ``arrakis-fd'' (at arrakis.example.com) clients to connect to ``caladan-sd'' storage daemon at ``caladan.example.com'' using \acs{TLS}.
843
844 \subsection{Using Certificates Issued by Different Root CA}
845
846 It is possible to have a \acs{TLS} environment that uses certificates issued by different \acsp{CA}. In the above examples, we have been using only one root \acs{CA}:
847 \begin{bVerbatim}
848 # openssl genrsa -out ./keys/root_key.pem 4096
849 # openssl req -new -x509 -batch -config ./openssl.cnf -key ./keys/root_key.pem -days 36500 -out ./certs/root_cert.pem
850 \end{bVerbatim}
851
852 In the case of the use of multiple root \acs{CA} in your \bacula{} environment, there are two possible ways to configure:
853 \begin{benumerate}
854 \item to concatenate all the root \acs{CA} certificates into one \bfilename{.pem} file used in the \bdirectivename{\acs{TLS} \acs{CA} Certificate File} directive:\\
855 \begin{bVerbatim}
856 # cat root_cert_ca1.pem root_cert_ca2.pem root_cert_ca3.pem > root_cert_ca.pem
857 \end{bVerbatim}
858 \begin{bitemize}
859 \item use \bdirectivename{\acs{TLS} CA Certificate File = /usr/local/bacula/etc/ssl/certs/root\_cert\_ca.pem} in resources \acs{TLS} directives definitions.
860 \end{bitemize}
861 \item use the \bdirectivename{\acs{TLS} \acs{CA} Certificate Dir} directive instead. In this case, the certificates should have Open\acs{SSL}-compatible hashes. Please find below an example:
862 \begin{bVerbatim}
863 root@darkstar:/opt/bacula/ssl/certs# ls -l
864 ...
865 lrwxrwxrwx 1 root root 19 Oct 25 23:10 7293a8c5.0 -> root_ca1_cert.pem
866 lrwxrwxrwx 1 root root 19 Oct 25 23:10 8fb0c2b0.0 -> root_ca2_cert.pem
867 lrwxrwxrwx 1 root root 18 Oct 25 23:10 a6476ecf.0 -> root_ca3_cert.pem
868 -rw-r--r-- 1 root root 2134 Sep 7 16:03 root_ca1_cert.pem
869 -rw-r--r-- 1 root root 2134 Sep 7 15:56 root_ca2_cert.pem
870 -rw-r--r-- 1 root root 2134 Sep 7 11:47 root_ca3_cert.pem
871 \end{bVerbatim}
872 \begin{bitemize}
873 \item \bdirectivename{\acs{TLS} CA Certificate File = /usr/local/bacula/etc/ssl/certs/root\_cert\_ca.pem} in resources \acs{TLS} directives definitions.
874 \end{bitemize}
875 \end{benumerate}
876
877 \subsection{Using \bdirectivename{\acs{TLS} Authenticate} to Enable a \acs{TLS} Authentication Between Daemons}
878 \bacula{} by default uses \acs{CRAM}-\acs{MD5} authentication using the \bdirectivename{Password} directive as a shared secret for each daemon.
879 In addition to this, you can also use \acs{TLS} to provide a more secure authentication between the daemons.
880 This is achieved by using the \bdirectivename{\acs{TLS} Authenticate = yes} directive in the main daemon configuration resource in addition to configuring \bdirectivename{\acs{TLS} Enable}, \bdirectivename{\acs{TLS} Require}, \bdirectivename{\acs{TLS} Certificate CA File}, \bdirectivename{\acs{TLS} Certificate} and \bdirectivename{\acs{TLS} Key} directives. Please find examples below.
881
882 Please notice a very important feature of enabling \bdirectivename{\acs{TLS} Authenticate} to your daemons: \textbf{if you enable the \acs{TLS} authentication, the \acs{TLS} encryption will be turned off and communication between the daemons will be done without Encryption}.
883
884 \subsubsection{Enabling \acs{TLS} Authentication Between Director and Console}
885 \begin{benumerate}
886 \item\label{blb:enum:tlsdircons:anonymous} If you're using an anonymous console:\\
887 You only need to define the \acs{TLS} directives in the \bDirector{} resource of both \bfilename{bacula-dir.conf} and \bfilename{bconsole.conf} files.
888 \begin{bitemize}
889 \item In \bfilename{bacula-dir.conf}:
890 \begin{bVerbatim}
891 Director {
892 Name = darkstar-dir
893 DIR Port = 9111
894 DIR Address = darkstar.example.com
895 QueryFile = "/usr/local/bacula/scripts/query.sql"
896 WorkingDirectory = "/usr/local/bacula/working"
897 PidDirectory = "/var/run"
898 Maximum Concurrent Jobs = 10
899 Password = "password"
900 Messages = Daemon
901 TLS Enable = yes
902 TLS Require = yes
903 TLS Verify Peer = yes
904 TLS Authenticate = yes
905 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
906 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
907 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
908 }
909 \end{bVerbatim}
910 \item In \bfilename{bconsole.conf}:
911 \begin{bVerbatim}
912 Director {
913 Name = darkstar-dir
914 DIRport = 9111
915 Address = darkstar.example.com
916 Password = "password"
917 TLS Enable = yes
918 TLS Require = yes
919 TLS Authenticate = yes
920 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
921 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
922 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
923 }
924 \end{bVerbatim}
925 \end{bitemize}
926 \item If you are using a named console:\\
927 You only need to define the \acs{TLS} directives in the \bConsole{} resource of both \bfilename{bacula-dir.conf} and \bfilename{bconsole.conf}.
928 \begin{bitemize}
929 \item In \bfilename{bacula-dir.conf}:\\
930 There is no need to configure \acs{TLS} in the \bDirector{} resource as for option \vref{blb:enum:tlsdircons:anonymous}:
931 \begin{bVerbatim}
932 Director {
933 Name = darkstar-dir
934 DIR Port = 9111
935 DIR Address = darkstar.example.com
936 QueryFile = "/usr/local/bacula/scripts/query.sql"
937 WorkingDirectory = "/usr/local/bacula/working"
938 PidDirectory = "/var/run"
939 Maximum Concurrent Jobs = 10
940 Password = "password"
941 Messages = Daemon
942 }
943 \end{bVerbatim}
944 Instead, the \bConsole{} resource has the \acs{TLS} configurations:\\
945 \begin{bVerbatim}
946 Console {
947 Name = darkstar-con
948 Password = "password"
949 TLS Enable = yes
950 TLS Require = yes
951 TLS Verify Peer = yes
952 TLS Authenticate = yes
953 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
954 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
955 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
956 }
957 \end{bVerbatim}
958 \item In \bfilename{bconsole.conf}:\\
959 There is no need to configure \acs{TLS} in the \bDirector{} resource as for option \vref{blb:enum:tlsdircons:anonymous}:
960 \begin{bVerbatim}
961 Director {
962 Name = darkstar-dir
963 DIRport = 9111
964 Address = darkstar.example.com
965 Password = "password"
966 }
967 \end{bVerbatim}
968 Instead, the \bConsole{} resource has the \acs{TLS} configurations:
969 \begin{bVerbatim}
970 Console {
971 Name = darkstar-con
972 Password = "password"
973 TLS Enable = yes
974 TLS Require = yes
975 TLS Verify Peer = yes
976 TLS Authenticate = yes
977 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
978 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
979 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
980 }
981 \end{bVerbatim}
982 \end{bitemize}
983 \end{benumerate}
984
985 \subsubsection{Enabling \acs{TLS} Authentication Between Director and Client}
986 Let's consider ``darkstart-dir'' director at ``darkstar.example.com and'' and the ``arrakis-fd'' file daemon at ``arrakis.example.com''.
987 \begin{bitemize}
988 \item In \bfilename{bacula-dir.conf}:\\
989 \begin{bVerbatim}
990 Client {
991 Name = arrakis-fd
992 Address = arrakis.example.com
993 FD Port = 9112
994 Catalog = MyCatalog
995 Password = "password"
996 AutoPrune = no
997 Maximum Concurrent Jobs = 4
998 TLS Enable = yes
999 TLS Require = yes
1000 TLS Authenticate = yes
1001 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1002 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
1003 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
1004 }
1005 \end{bVerbatim}
1006 \item In \bfilename{bacula-fd.conf}:\\
1007 \begin{bVerbatim}
1008 Director {
1009 Name = darkstar-dir
1010 Password = "password"
1011 TLS Enable = yes
1012 TLS Require = yes
1013 TLS Verify Peer = yes
1014 TLS Authenticate = yes
1015 TLS Allowed CN = arrakis.example.com
1016 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1017 TLS Certificate = /usr/local/bacula/etc/ssl/certs/arrakis_cert.pem
1018 TLS Key = /usr/local/bacula/etc/ssl/keys/arrakis_key.pem
1019 }
1020 \end{bVerbatim}
1021 \end{bitemize}
1022
1023 \subsubsection{Enabling \acs{TLS} Authentication Between Director and Storage}
1024
1025 Let's consider ``darkstart-dir'' director at ``darkstar.example.com'' and the ``caladan-sd'' storage daemon on ``caladan.example.com''.
1026 \begin{bitemize}
1027 \item In \bfilename{bacula-dir.conf}:\\
1028 \begin{bVerbatim}
1029 Storage {
1030 Name = VTL-storage
1031 SD Port = 9113Address = caladan.example.com
1032 Password = "password"
1033 Device = "Virtual Tape Library"
1034 Autochanger = yes
1035 Media Type = VTL
1036 Maximum Concurrent Jobs = 30
1037 TLS Enable = yes
1038 TLS Require = yes
1039 TLS Authenticate = yes
1040 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1041 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
1042 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
1043 }
1044 \end{bVerbatim}
1045 \item In bacula-sd.conf:\\
1046 \begin{bVerbatim}
1047 Director {
1048 Name = darkstar-dir
1049 Password = "password"
1050 TLS Enable = yes
1051 TLS Require = yes
1052 TLS Verify Peer = yes
1053 TLS Authenticate = yes
1054 TLS Allowed CN = caladan.example.com
1055 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1056 TLS Certificate = /usr/local/bacula/etc/ssl/certs/caladan_cert.pem
1057 TLS Key = /usr/local/bacula/etc/ssl/keys/caladan_key.pem
1058 }
1059 \end{bVerbatim}
1060 \end{bitemize}
1061
1062 \subsubsection{Enabling \acs{TLS} Authentication Between Client and Storage}
1063
1064 Let's consider ``darkstar-fd'' (on ``darkstar.example.com'') and ``arrakis-fd'' (at ``arrakis.example.com'') clients need to connect to the ``aladan-sd'' storage daemon running on ``caladan.example.com'' using \acs{TLS}.
1065 \begin{bitemize}
1066 \item In \bfilename{bacula-fd.conf} file at darkstar.example.com:\\
1067 \begin{bVerbatim}
1068 FileDaemon {
1069 Name = darkstar-fd
1070 FD Port = 9112
1071 FD Address = darkstar.example.com
1072 WorkingDirectory = /usr/local/bacula/working
1073 Pid Directory = /var/run
1074 Maximum Concurrent Jobs = 10
1075 TLS Enable = yes
1076 TLS Require = yes
1077 TLS Authenticate = yes
1078 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1079 TLS Certificate = /usr/local/bacula/etc/ssl/certs/darkstar_cert.pem
1080 TLS Key = /usr/local/bacula/etc/ssl/keys/darkstar_key.pem
1081 }
1082 \end{bVerbatim}
1083 \item In \bfilename{bacula-fd.conf} file at ``arrakis.example.com'':\\
1084 \begin{bVerbatim}
1085 FileDaemon {
1086 Name = arrakis-fd
1087 FD Port = 9112
1088 FD Address = arrakis.example.com
1089 WorkingDirectory = /usr/local/bacula/working
1090 Pid Directory = /var/run
1091 Maximum Concurrent Jobs = 10
1092 TLS Enable = yes
1093 TLS Require = yes
1094 TLS Authenticate = yes
1095 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1096 TLS Certificate = /usr/local/bacula/etc/ssl/certs/arrakis_cert.pem
1097 TLS Key = /usr/local/bacula/etc/ssl/keys/arrakis_key.pem
1098 }
1099 \end{bVerbatim}
1100 \item In bacula-sd.conf file at ``caladan.example.com'':\\
1101 \begin{bVerbatim}
1102 Storage {
1103 Name = caladan-sd
1104 SD Port = 9113
1105 SD Address = caladan.example.com
1106 WorkingDirectory = "/usr/local/bacula/working"
1107 Pid Directory = "/var/run"
1108 Maximum Concurrent Jobs = 40
1109 TLS Enable = yes
1110 TLS Require = yes
1111 TLS Authenticate = yes
1112 TLS Allowed CN = darkstar.example.com , arrakis.example.com
1113 TLS CA Certificate File = /usr/local/bacula/etc/ssl/certs/root_cert.pem
1114 TLS Certificate = /usr/local/bacula/etc/ssl/certs/caladan_cert.pem
1115 TLS Key = /usr/local/bacula/etc/ssl/keys/caladan_key.pem
1116 }
1117 \end{bVerbatim}
1118 \end{bitemize}