2 \section{Recommendations on practical settings}
3 \label{section:PracticalSettings}
6 \subsection{Webservers}
11 \item[Tested with Version:]
13 \item[Settings:] \mbox{}
15 %-All +TLSv1.1 +TLSv1.2
16 \begin{lstlisting}[breaklines]
17 SSLProtocol All -SSLv2 -SSLv3
18 SSLHonorCipherOrder On
20 # Add six earth month HSTS header for all users...
21 Header add Strict-Transport-Security "max-age=15768000"
22 # If you want to protect all subdomains, use the following header
23 # ALL subdomains HAVE TO support https if you use this!
24 # Strict-Transport-Security: max-age=15768000 ; includeSubDomains
26 SSLCipherSuite 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA'
29 Note again, that any cipher suite starting with ECDHE can be omitted in case of doubt.
30 %% XXX NOTE TO SELF: remove from future automatically generated lists!
32 \item[Additional settings:]
34 You should redirect everything to httpS:// if possible. In Apache you can do this with the following setting inside of a VirtualHost environment:
36 \begin{lstlisting}[breaklines]
40 RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=permanent]
45 \item[Justification for special settings (if needed):]
51 See ssllabs in section \ref{section:Tools}
54 %XXXX ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
57 \subsubsection{lighttpd}
62 \item[Tested with Version:]
66 \item[Settings:] \mbox{}
69 %% Complete ssl.cipher-list with same algo than Apache
70 \todo{FIXME: this string seems to be wrongly formatted??}
72 \begin{lstlisting}[breaklines]
73 $SERVER["socket"] == "0.0.0.0:443" {
75 ssl.use-sslv2 = "disable"
76 ssl.use-sslv3 = "disable"
77 #ssl.use-compression obsolete >= 1.4.3.1
78 ssl.pemfile = "/etc/lighttpd/server.pem"
79 ssl.cipher-list = 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA'
80 ssl.honor-cipher-order = "enable"
81 setenv.add-response-header = ( "Strict-Transport-Security" => "max-age=31536000")
86 \item[Additional settings:]
88 As for any other webserver, you should redirect automatically http traffic toward httpS://
90 \begin{lstlisting}[breaklines]
91 $HTTP["scheme"] == "http" {
92 # capture vhost name with regex conditiona -> %0 in redirect pattern
93 # must be the most inner block to the redirect rule
94 $HTTP["host"] =~ ".*" {
95 url.redirect = (".*" => "https://%0$0")
102 \todo{add references}.
103 lighttpd httpS:// redirection: \url{http://redmine.lighttpd.net/projects/1/wiki/HowToRedirectHttpToHttps}
105 % add any further references or best practice documents here
107 \item[How to test:] See ssllabs in section \ref{section:Tools}
109 % describe here or point the admin to tools (can be a simple footnote or \ref{} to the tools section) which help the admin to test his settings.
113 \subsubsection{nginx}
116 \item[Tested with Version:]
120 \item[Settings:] \mbox{}
122 \begin{lstlisting}[breaklines]
123 ssl_prefer_server_ciphers on;
124 ssl_protocols -SSLv2 -SSLv3;
125 ssl_ciphers 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA';
126 add_header Strict-Transport-Security max-age=2592000;
127 add_header X-Frame-Options DENY;
130 %% XXX FIXME: do we need to specify dhparams? Parameter: ssl_dhparam = file. See: http://wiki.nginx.org/HttpSslModule#ssl_protocols
132 \item[Additional settings:]
134 If you decide to trust NIST's ECC curve recommendation, you can add the following line to nginx's configuration file to select special curves:
136 \begin{lstlisting}[breaklines]
137 ssl_ecdh_curve sect571k1;
140 You should redirect everything to httpS:// if possible. In Nginx you can do this with the following setting:
142 \begin{lstlisting}[breaklines]
143 rewrite ^(.*) https://$host$1 permanent;
147 \item[References:] \todo{add references}
149 \item[How to test:] See ssllabs in section \ref{section:Tools}
157 \subsubsection{MS IIS}
161 \todo{Daniel: add screenshots and registry keys}
165 \item[Tested with Version:] \todo{Daniel: add tested version}
167 \item[Settings:] \mbox{}
170 When trying to avoid RC4 and CBC (BEAST-Attack) and requiring perfect
171 forward secrecy, Microsoft Internet Information Server (IIS) supports
172 ECDSA, but does not support RSA for key exchange (consider ECC suite
173 B doubts\footnote{\url{http://safecurves.cr.yp.to/rigid.html}}).
175 Since \verb|ECDHE_RSA_*| is not supported, a SSL certificate based on
176 elliptic curves needs to be used.
178 The configuration of cipher suites MS IIS will use can be configured in one
179 of the following ways:
181 \item Group Policy \footnote{\url{http://msdn.microsoft.com/en-us/library/windows/desktop/bb870930(v=vs.85).aspx}}
183 \item IIS Crypto~\footnote{\url{https://www.nartac.com/Products/IISCrypto/}}
187 Table~\ref{tab:MS_IIS_Client_Support} shows the process of turning on
188 one algorithm after another and the effect on the supported Clients
189 tested using https://www.ssllabs.com.
191 \verb|SSL 3.0|, \verb|SSL 2.0| and \verb|MD5| are turned off.
192 \verb|TLS 1.0| and \verb|TLS 2.0| are turned on.
199 Cipher Suite & Client \\
201 \verb|TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256| & only IE 10,11, OpenSSL 1.0.1e \\
202 \verb|TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256| & Chrome 30, Opera 17, Safari 6+ \\
203 \verb|TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA| & FF 10-24, IE 8+, Safari 5, Java 7\\
206 \caption{Client support}
207 \label{tab:MS_IIS_Client_Support}
210 Table~\ref{tab:MS_IIS_Client_Support} shows the algoriths from
211 strongest to weakest and why they need to be added in this order. For
212 example insisting on SHA-2 algorithms (only first two lines) would
213 eliminate all versions of Firefox, so the last line is needed to
214 support this browser, but should be placed at the bottom, so capable
215 browsers will choose the stronger SHA-2 algorithms.
217 \verb|TLS_RSA_WITH_RC4_128_SHA| or equivalent should also be added if
218 MS Terminal Server Connection is used (make sure to use this only in a
219 trusted environment). This suite will not be used for SSL, since we do
223 % \verb|TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256| ... only supported by: IE 10,11, OpenSSL 1.0.1e
224 % \verb|TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256| ... Chrome 30, Opera 17, Safari 6+
225 % \verb|TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA| ... Firefox 10-24, IE 8+, Safari 5, Java 7
228 Not supported Clients:
235 \item[Additional settings:]
237 %Here you can add additional settings
239 \item[Justification for special settings (if needed):]
241 % in case you have the need for further justifications why you chose this and that setting or if the settings do not fit into the standard Variant A or Variant B schema, please document this here
245 \todo{add references}
247 % add any further references or best practice documents here
249 \item[How to test:] See ssllabs in section \ref{section:Tools}
256 \subsection{Mail Servers}
258 This section documents the most common mail (SMTP) and IMAPs/POPs servers. Another option to secure IMAPs/POPs servers is to place them behind an stunnel server.
260 \subsubsection{Dovecot}
265 % Example: http://dovecot.org/list/dovecot/2013-October/092999.html
267 \begin{lstlisting}[breaklines]
268 ssl_cipher_list = 'EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA'
269 ssl_prefer_server_ciphers = yes
272 Dovecot 2.1: Almost as good as dovecot 2.2. Does not support ssl\_prefer\_server\_ciphers
274 \paragraph*{Limitations}\mbox{}\\
276 Dovecot currently does not support disabling TLS compression. Furthermore, DH parameters
277 greater than 1024bit aren't possible. The most recent version 2.2.7 of Dovecot implements
278 configurable DH parameter length
279 \footnote{\url{http://hg.dovecot.org/dovecot-2.2/rev/43ab5abeb8f0}}.
281 \subsubsection{cyrus-imapd (based on 2.4.17)}
283 \paragraph*{imapd.conf}\mbox{}\\
285 To activate SSL/TLS configure your certificate with
286 \begin{lstlisting}[breaklines]
287 tls_cert_file: .../cert.pem
288 tls_key_file: .../cert.key
291 Do not forget to add necessary intermediate certificates to the .pem file.\\
293 Limiting the ciphers provided may force (especially older) clients to connect without encryption at all! Sticking to the defaults is recommended.\\
295 If you still want to force strong encryption use
296 \begin{lstlisting}[breaklines]
297 tls_cipher_list: <...recommended ciphersuite...>
300 cyrus-imapd loads hardcoded 1024 bit DH parameters using get\_rfc2409\_prime\_1024() by default. If you want to load your own DH parameters add them PEM encoded to the certificate file given in tls\_cert\_file. Do not forget to re-add them after updating your certificate.\\
302 To prevent unencrypted connections on the STARTTLS ports you can set
303 \begin{lstlisting}[breaklines]
306 This way MUAs can only authenticate after STARTTLS if you only provide plaintext and SASL PLAIN login methods. Therefore providing CRAM-MD5 or DIGEST-MD5 methods is not recommended.\\
308 \paragraph*{cyrus.conf}\mbox{}\\
310 To support POP3/IMAP on ports 110/143 with STARTTLS add
311 \begin{lstlisting}[breaklines]
312 imap cmd="imapd" listen="imap" prefork=3
313 pop3 cmd="pop3d" listen="pop3" prefork=1
315 to the SERVICES section.\\
317 To support POP3S/IMAPS on ports 995/993 add
318 \begin{lstlisting}[breaklines]
319 imaps cmd="imapd -s" listen="imaps" prefork=3
320 pop3s cmd="pop3d -s" listen="pop3s" prefork=1
324 \paragraph*{Limitations}\mbox{}\\
326 cyrus-imapd currently (2.4.17, trunk) does not support elliptic curves. ECDHE will not work even if defined in your cipher list.\\
328 Currently there is no way to prefer server ciphers or to disable compression.\\
330 There is a working patch for all three features:
331 \url{https://bugzilla.cyrusimap.org/show_bug.cgi?id=3823}\\
337 % XXX config von Adi?
339 % ciphers = EDH+CAMELLIA256:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:-AES128:!CAMELLIA128:!ECDSA:AES256-SHA:EDH+AES128;
340 % options = CIPHER_SERVER_PREFERENCE
343 \subsubsection{SMTP in general}
345 SMTP usually uses opportunistic TLS. This means that an MTA will accept TLS connections when asked for it during handshake but will not require it. One should always support incoming opportunistic TLS and always try TLS handshake outgoing.\\
347 Furthermore a mailserver can operate in three modes:
349 \item As MSA (Mail Submission Agent) your mailserver receives mail from your clients MUAs (Mail User Agent).
350 \item As receiving MTA (Mail Transmission Agent, MX)
351 \item As sending MTA (SMTP client)
354 We recommend the following basic setup for all modes:
356 \item correctly setup MX, A and PTR RRs without using CNAMEs at all.
357 \item enable encryption (opportunistic TLS)
358 \item do not use self signed certificates
361 For SMTP client mode we additionally recommend:
363 \item the hostname used as HELO must match the PTR RR
364 \item setup a client certificate (most server certificates are client certificates as well)
365 \item either the common name or at least an alternate subject name of your certificate must match the PTR RR
366 \item do not modify the cipher suite for client mode
369 For MSA operation we recommend:
371 \item listen on submission port 587
372 \item enforce SMTP AUTH even for local networks
373 \item do not allow SMTP AUTH on unencrypted connections
374 \item optionally use the recommended cipher suites if (and only if) all your connecting MUAs support them
379 % Note that (with the exception of MSA mode), it might be better to allow any cipher suite -- since any encryption is better than no encryption when it comes to opportunistic TLS.
381 We strongly recommend to allow all cipher suites for anything but MSA
382 mode, because the alternative is plain text transmission.
384 \subsubsection{Postfix}
387 \item[Tested with Version:] \mbox{}
390 \item Postfix 2.9.6 (Debian Wheezy)
393 \item[Settings:] \mbox{}
395 First, you need to generate Diffie Hellman parameters (please first take a look at the section \ref{section:PRNG}):
397 \todo{FIXME: this is a really weak setting! See also: http://postfix.1071664.n5.nabble.com/postfix-hardening-what-can-we-do-td61874.html}
398 \begin{lstlisting}[breaklines]
399 % openssl gendh -out /etc/postfix/dh_param_512.pem -2 512
400 % openssl gendh -out /etc/postfix/dh_param_1024.pem -2 1024
403 Next, we specify these DH parameters in \verb|main.cf|:
405 \begin{lstlisting}[breaklines]
406 smtpd_tls_dh512_param_file = /etc/postfix/dh_param_512.pem
407 smtpd_tls_dh1024_param_file = /etc/postfix/dh_param_1024.pem
410 \paragraph*{MX and SMTP client configuration}\mbox{}\\
412 As discussed above, because of opportunistic encryption we do not
413 restrict the list of ciphers. There's still some steps needed to
414 enable TLS, all in \verb|main.cf|:
416 \begin{lstlisting}[breaklines]
417 smtpd_tls_cert_file = /etc/postfix/server.pem
418 smtpd_tls_key_file = /etc/postfix/server.key
419 # use 0 for Postfix >= 2.9, and 1 for earlier versions
420 smtpd_tls_loglevel = 0
421 # enable opportunistic TLS support in the SMTP server and client
422 smtpd_tls_security_level = may
423 smtp_tls_security_level = may
424 # if you have authentication enabled, only offer it after STARTTLS
425 smtpd_tls_auth_only = yes
426 tls_ssl_options=NO_COMPRESSION
427 tls_random_source = dev:/dev/urandom
430 \paragraph*{MSA}\mbox{}\\
432 For the MSA \verb|smtpd| process, we first define the ciphers that are
433 acceptable for the ``mandatory'' security level, again in
436 \begin{lstlisting}[breaklines]
437 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
438 smtpd_tls_mandatory_ciphers=high
439 tls_high_cipherlist=EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA
442 Then, we configure the MSA smtpd in \verb|master.cf| with two
443 additional options that are only used for this instance of smtpd:
445 \begin{lstlisting}[breaklines]
446 587 inet n - - - - smtpd
447 -o smtpd_tls_security_level=encrypt -o tls_preempt_cipherlist = yes
450 For those users who want to use ECC key exchange, it is possible to specify this via:
451 \begin{lstlisting}[breaklines]
452 smtpd_tls_eecdh_grade = ultra
455 \item[Limitations:] \mbox{}
457 tls\_ssl\_options is supported from Postfix 2.11 onwards. You can
458 leave the statement in the configuration for older versions, it will
461 tls\_preempt\_cipherlist is supported from Postfix 2.8 onwards. Again,
462 you can leave the statement in for older versions.
466 Refer to \url{http://www.postfix.org/TLS_README.html} for an in-depth
469 % \item[Additional settings:]
470 % no additional settings
472 % \item[Justification for special settings (if needed):]
473 % no special settings
477 You can check the effect of the settings with the following command:
478 \begin{lstlisting}[breaklines]
479 $ zegrep "TLS connection established from.*with cipher" | /var/log/mail.log | awk '{printf("%s %s %s %s\n", $12, $13, $14, $15)}' | sort | uniq -c | sort -n
480 1 SSLv3 with cipher DHE-RSA-AES256-SHA
481 23 TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384
482 60 TLSv1 with cipher ECDHE-RSA-AES256-SHA
483 270 TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384
484 335 TLSv1 with cipher DHE-RSA-AES256-SHA
489 \subsubsection{Exim (based on 4.82)}
491 It is highly recommended to read
493 \url{http://exim.org/exim-html-current/doc/html/spec_html/ch-encrypted_smtp_connections_using_tlsssl.html}
497 \paragraph*{MSA mode (submission)}\mbox{}\\
499 In the main config section of Exim add:
501 \begin{lstlisting}[breaklines]
502 tls_certificate = ..../cert.pem
503 tls_privatekey = ..../cert.key
505 don't forget to add intermediate certificates to the .pem file if needed.\\
507 Tell Exim to advertise STARTTLS in the EHLO answer to everyone:
508 \begin{lstlisting}[breaklines]
509 tls_advertise_hosts = *
512 If you want to support legacy SMTPS on port 465, and STARTTLS on smtp(25)/submission(587) ports set
513 \begin{lstlisting}[breaklines]
514 daemon_smtp_ports = smtp : smtps : submission
515 tls_on_connect_ports = 465
518 It is highly recommended to limit SMTP AUTH to SSL connections only. To do so add
519 \begin{lstlisting}[breaklines]
520 server_advertise_condition = ${if eq{$tls_cipher}{}{no}{yes}}
522 to every authenticator defined.\\
524 Add the following rules on top of your acl\_smtp\_mail:
525 \begin{lstlisting}[breaklines]
527 control = submission/sender_retain
529 This switches Exim to submission mode and allows addition of missing Message-ID: and Date: headers.\\
531 It is not advisable to restrict the default cipher list for MSA mode if you don't know all connecting MUAs. If you still want to define one please consult the Exim documentation or ask on the exim-users mailinglist.\\
532 % Exim maintainers do not recommend to change default ciphers
533 % I think we shouldn't, too
535 %\begin{lstlisting}[breaklines]
536 % tls_require_ciphers = <...recommended ciphersuite...>
539 The cipher used is written to the logfiles by default. You may want to add
540 \begin{lstlisting}[breaklines]
541 log_selector = <....whatever your log_selector already contains...> \
542 +tls_certificate_verified +tls_peerdn +tls_sni
544 to get even more TLS information logged.
547 \paragraph*{server mode (incoming)}\mbox{}\\
549 In the main config section of Exim add:
551 \begin{lstlisting}[breaklines]
552 tls_certificate = ..../cert.pem
553 tls_privatekey = ..../cert.key
555 don't forget to add intermediate certificates to the .pem file if needed.\\
557 Tell Exim to advertise STARTTLS in the EHLO answer to everyone:
558 \begin{lstlisting}[breaklines]
559 tls_advertise_hosts = *
562 Listen on smtp(25) port only
563 \begin{lstlisting}[breaklines]
564 daemon_smtp_ports = smtp
567 It is not advisable to restrict the default cipher list for opportunistic encryption as used by SMTP. Do not use cipher lists recommended for HTTPS! If you still want to define one please consult the Exim documentation or ask on the exim-users mailinglist.\\
568 % Exim maintainers do not recommend to change default ciphers
571 %\begin{lstlisting}[breaklines]
572 % tls_require_ciphers = <...recommended ciphersuite...>
575 If you want to request and verify client certificates from sending hosts set
576 \begin{lstlisting}[breaklines]
577 tls_verify_certificates = /etc/pki/tls/certs/ca-bundle.crt
578 tls_try_verify_hosts = *
581 tls\_try\_verify\_hosts only reports the result to your logfile. If you want to disconnect such clients you have to use
582 \begin{lstlisting}[breaklines]
586 The cipher used is written to the logfiles by default. You may want to add
587 \begin{lstlisting}[breaklines]
588 log_selector = <....whatever your log_selector already contains...> \
589 +tls_certificate_verified +tls_peerdn +tls_sni
591 to get even more TLS information logged.
593 \paragraph*{client mode (outgoing)}\mbox{}\\
595 Exim uses opportunistic encryption in the SMTP transport by default.
597 Client mode settings have to be done in the configuration section of the smtp transport (driver = smtp).
599 If you want to use a client certificate (most server certificates can be used as client certificate, too) set
600 \begin{lstlisting}[breaklines]
601 tls_certificate = .../cert.pem
602 tls_privatekey = .../cert.key
604 This is recommended for MTA-MTA traffic.\\
606 %If you want to limit used ciphers set
607 %\begin{lstlisting}[breaklines]
608 % tls_require_ciphers = <...recommended ciphersuite...>
610 % Exim Maintainers do not recommend ciphers. We shouldn't do so, too.
611 Do not limit ciphers without a very good reason. In the worst case you end up without encryption at all instead of some weak encryption. Please consult the Exim documentation if you really need to define ciphers.
613 \paragraph*{OpenSSL}\mbox{}\\
614 Exim already disables SSLv2 by default. We recommend to add
615 \begin{lstlisting}[breaklines]
616 openssl_options = +all +no_sslv2 +no_compression +cipher_server_preference
618 to the main configuration.\\
619 Note: +all is misleading here since OpenSSL only activates the most common workarounds. But that's how SSL\_OP\_ALL is defined.\\
621 You do not need to set dh\_parameters. Exim with OpenSSL by default uses parameter initialization with the "2048-bit MODP Group with 224-bit Prime Order Subgroup" defined in section 2.2 of RFC 5114 (ike23).
622 If you want to set your own DH parameters please read the TLS documentation of exim.\\
626 \paragraph*{GnuTLS}\mbox{}\\
628 GnuTLS is different in only some respects to OpenSSL:
630 \item tls\_require\_ciphers needs a GnuTLS priority string instead of a cipher list. It is recommended to use the defaults by not defining this option. It highly depends on the version of GnuTLS used. Therefore it is not advisable to change the defaults.
631 \item There is no option like openssl\_options
634 \paragraph*{Exim string expansion}\mbox{}\\
636 Note that most of the options accept expansion strings. This way you can eg. set cipher lists or STARTTLS advertisment conditionally. Please follow the link to the official Exim documentation to get more information.
638 \paragraph*{Limitations}\mbox{}\\
640 Exim currently (4.82) does not support elliptic curves with OpenSSL. This means that ECDHE is not used even if defined in your cipher list.
641 There already is a working patch to provide support:\\
642 \url{http://bugs.exim.org/show_bug.cgi?id=1397}
645 % do we need to documment starttls in detail?
646 %\subsubsection{starttls?}
650 \begin{lstlisting}[breaklines]
652 PermitEmptyPasswords no
655 HostKey /etc/ssh/ssh_host_rsa_key
656 Ciphers aes256-gcm@openssh.com aes128-gcm@openssh.com aes256-ctr aes128-ctr
657 MACs umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160
658 KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
661 % XXX: curve25519-sha256@libssh.org only available upstream(!)
662 Note: older linux systems won't support SHA2. PuTTY (Windows) does not support RIPE-MD160. Curve25519, AES-GCM and UMAC are only available upstream (OpenSSH 6.1). DSA host keys have been removed on purpose, the DSS standard does not support for DSA keys stronger than 1024bit
663 \footnote{\url{https://bugzilla.mindrot.org/show_bug.cgi?id=1647}}
664 which is far below current standards (see section \ref{section:keylengths}).
669 \todo{write this subsection}
670 \subsubsection{IPSec}
671 \label{section:IPSECgeneral}
674 \todo{cm: check if there are downgrade attacks for checkpoint \& co} \\
678 \item[Settings:] \mbox{}
680 \paragraph*{Assumptions}\mbox{}\\
682 We assume the usage of IKE (v1 or v2) for this document, and ESP.
684 \paragraph*{Authentication}\mbox{}\\
686 IPSEC authentication should optimally be performed via RSA signatures,
687 with a key size of 2048 bits or more. Configuring only the trusted CA
688 that issued the peer certificate provides for additional protection
689 against fake certificates.
691 If you need to use Pre-Shared Key authentication:
694 \item Choose a \textbf{random}, \textbf{long enough} PSK (see below)
695 \item Use a \textbf{separate} PSK for any IPSEC connection
696 \item Change the PSKs regularily
699 The size of the PSK should not be shorter than the output size of
700 the hash algorithm used in IKE \footnote{It is used in a HMAC, see
701 \url{http://www.ietf.org/rfc/rfc2104.txt}.}.
703 For a key composed of upper- and lowercase letters, numbers, and two
704 additional symbols \footnote{64 possible values = 6 bits}, that gives
705 the following minimum lengths in characters:
712 IKE Hash & PSK length \\
721 \paragraph*{Cryptographic Suites}\mbox{}\\
723 IPSEC Cryptographic Suites are pre-defined settings for all the
724 items of a configuration; they try to provide a balanced security
725 level and make setting up VPNs easier.
727 When using any of those suites, make sure to enable ``Perfect Forward
728 Secrecy`` for Phase 2, as this is not specified in the suites. The
729 equivalents to the recommended ciphers suites in section
730 \ref{section:recommendedciphers} are:
737 Configuration A & Configuration B & Notes\\
739 \verb|Suite-B-GCM-256|\footnote{\url{http://tools.ietf.org/html/rfc6379}} &
740 \verb|Suite-B-GCM-128| & Uses NIST elliptic curves
741 \\ & \verb|VPN-B|\footnote{\url{http://tools.ietf.org/html/rfc4308}} &
747 \paragraph*{IKE or Phase 1}\mbox{}\\
749 Alternatively to the pre-defined cipher suites, you can define your
750 own, as described in this and the next section.
752 IKE or Phase 1 is the mutual authentication and key exchange phase.
754 Use only ``main mode``, as ``aggressive mode`` has known security
755 vulnerabilities \footnote{\url{http://ikecrack.sourceforge.net/}}.
757 \todo{how to make footnotes in a table appear in the output document?}
764 & Configuration A & Configuration B \\
766 Mode & Main Mode & Main Mode \\
767 Encryption & AES-256 & AES-256, CAMELLIA-256 \\
768 Hash & SHA2-* & SHA2-*, SHA1 \\
769 DH Group & Group 14--18 \footnote{2048--8192 bit DH},
770 19--21\footnote{(256--521 bit ECDH)} & Group 14--21 \\
771 Lifetime & \todo{need recommendations; 1 day seems to be common
777 \paragraph*{ESP or Phase 2}\mbox{}\\
779 ESP or Phase 2 is where the actual data are protected.
781 \todo{make the tables appear right here!}
788 & Configuration A & Configuration B \\
790 Perfect Forward Secrecy & yes & yes \\
791 Encryption & AES-GCM-16, AES-CTR, AES-CCM-16, AES-256 & AES-GCM-16, AES-CTR, AES-CCM-16, AES-256, CAMELLIA-256 \\
792 Hash & SHA2-* (or none for AES-GCM) & SHA2-*, SHA1 (or none for AES-GCM) \\
793 DH Group & Same as Phase 1 & Same as Phase 1 \\
794 Lifetime & \todo{need recommendations; 1-8 hours is common} & \\
799 \item[References:] \mbox{}
801 ``A Cryptographic Evaluation of IPsec'', Niels Ferguson and Bruce
802 Schneier: \url{https://www.schneier.com/paper-ipsec.pdf}
806 \subsubsection{Check Point FireWall-1}
809 \item[Tested with Version:] \mbox{}
812 \item R77 (should work with any currently supported version)
815 \item[Settings:] \mbox{}
817 Please see section \ref{section:IPSECgeneral} for guidance on
818 parameter choice. In this section, we will configure a strong setup
819 according to ``Configuration A''.
821 This is based on the concept of a ``VPN Community'', which has all the
822 settings for the gateways that are included in that community.
823 Communities can be found in the ``IPSEC VPN'' tab of SmartDashboard.
825 \todo{make those graphics prettier -- whoever has the right LaTeX
828 \includegraphics{checkpoint_1.png}
830 Either chose one of the encryption suites here, or proceed to
831 ``Custom Encryption...'', where you can set encryption and hash for
834 \includegraphics{checkpoint_2.png}
836 The Diffie-Hellman groups and Perfect Forward Secrecy Settings can be
837 found under ``Advanced Settings'' / ``Advanced VPN Properties'':
839 \includegraphics{checkpoint_3.png}
841 \item[Additional settings:]
843 For remote Dynamic IP Gateways, the settings are not taken from the
844 community, but set in the ``Global Properties'' dialog under ``Remote
845 Access'' / ``VPN Authentication and Encryption''. Via the ``Edit...''
846 button, you can configure sets of algorithms that all gateways support:
848 \includegraphics{checkpoint_4.png}
850 Please note that these settings restrict the available algorithms for
851 \textbf{all} gateways, and also influence the VPN client connections.
853 %\item[Justification for special settings (if needed):]
857 \item[References:]\mbox{}
862 \href{https://sc1.checkpoint.com/documents/R77/CP_R77_VPN_AdminGuide/html_frameset.htm}{VPN
863 R77 Administration Guide} (may require a
864 UserCenter account to access)
868 % \item[How to test:]
873 \subsubsection{OpenVPN}
877 \item[Tested with Version:] OpenVPN 2.3.2 from Debian backports linked against openssl (libssl.so.1.0.0)
879 \todo{cm: please write this subsubsection}
880 \todo{We suppose user uses easy-rsa which is roughly used in all HOWTO\footnote{\url{http://openvpn.net/index.php/open-source/documentation/howto.html}}}
883 \item[Additional settings:] \mbox{}
885 \paragraph{Fine tuning at installation level}
887 When installing an OpenVPN server instance, you are probably using {\it easy-rsa} tools to generate the crypto stuff needed.
888 From the directory where you will run them, you can enhance you configuration by changing the following variables in \verb|vars|:
890 \begin{lstlisting}[breaklines]
892 export KEY_EXPIRE=365
893 export CA_EXPIRE=1826
896 This will enhance the security of the key generation by using RSA keys
897 with a length of 2048 bits, and set a lifetime of one year for the
898 keys and five years for the CA certificate.
900 In addition, edit the \verb|pkitool| script and replace all occurences
901 of \verb|sha1| with \verb|sha256|, to sign the certificates with
904 \paragraph{Server Configuration}
906 In the server configuration file, you can select the algorithm that will be used for traffic encryption.
907 Based on previous recommendation established in that document, select AES with a 256 bits key in CBC mode.
909 Note that TLS is used only for negotiation bla bla bla...
911 \todo{cm: explain how openvpn crypto works; make configA/B sections/tables}
913 \item[Settings:] \mbox{}
915 % openvpn --show-ciphers
918 \todo{cm: changelog 2.3.1: ``Switch to IANA names for TLS ciphers'' --
919 give both types of strings?}
921 \begin{lstlisting}[breaklines]
922 cipher AES-256-CBC # AES
926 tls-cipher EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EDH+CAMELLIA256:EECDH:EDH+aRSA:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED:!AES128:!CAMELLIA128:!ECDSA:AES256-SHA
936 % tls-cipher is a list, C&P the string!
937 % what about: TLS-DHE-RSA-WITH-AES-256-CBC-SHA
938 % DH params/DH key sizes
940 \todo{Explain a little bit tls-auth and auth directives + TEST}
941 \todo{also test with network-damager?}
943 The following ciphers are avaible and recommended\footnote{You can retrieve the list of supported algorithm on your OpenVPN installation thanks to the command {\it openvpn --show-ciphers}}
944 \begin{lstlisting}[breaklines]
955 \paragraph{Client Configuration}
957 Client and server have to use identical configuration otherwise they can't communicate.
958 The {\it cipher} directive has then to be identical in both server and client configuration.
960 \begin{lstlisting}[breaklines]
961 cipher AES-256-CBC # AES
963 remote-cert-tls server # http://openvpn.net/index.php/open-source/documentation/howto.html#mitm
965 tls-remote server.example.com
969 \todo{what about tls-auth keys/ta.key? }.
970 \todo{what about auth sha512 ?}
972 \item[Justification for special settings (if needed):]
974 \item[References:] \url{http://openvpn.net/index.php/open-source/documentation/security-overview.html}
977 \todo{write me please}
985 PPTP is considered insecure, Microsoft recommends to ``use a more secure VPN
986 tunnel''\footnote{\url{http://technet.microsoft.com/en-us/security/advisory/2743314}}.
988 There is a cloud service that cracks the underlying MS-CHAPv2
989 authentication protocol for the price of USD~200\footnote{\url{https://www.cloudcracker.com/blog/2012/07/29/cracking-ms-chap-v2/}},
990 and given the resulting MD4 hash, all PPTP traffic for a user can
993 \subsubsection{Cisco IPSec}
994 \todo{write this subsubsection}
996 \subsubsection{Juniper VPN}
997 \todo{write this subsubsection. AK: ask Hannes}
999 \subsubsection{L2TP over IPSec}
1000 \todo{write this subsubsection}
1002 \subsubsection{Racoon}
1003 \todo{write this subsubsection}
1006 \subsection{PGP/ GPG - Pretty Good Privacy}
1008 \todo{re-work this subsection -- this is still only a draft!!}
1011 \subsection{seclayer-tcp}
1012 \todo{Ramin: please write this section or ask Posch}
1013 For the austrian citizen card....
1016 seclayer-tcp 3495/udp # securitylayer over tcp
1017 seclayer-tcp 3495/tcp # securitylayer over tcp
1021 \subsection{IPMI, ILO and other lights out management solutions}
1024 We \textbf{strongly} recommend that any remote management system for servers such as ILO, IPMI and similar never be connected to a public IP address.
1025 Consider creating a management VLAN and access that only via a VPN.
1029 \todo{AK: ask Klaus. Write this section, Klaus??? }
1031 \subsection{Instant Messaging Systems}
1032 \subsubsection{XMPP / Jabber}
1033 \todo{ts: Describe ejabberd configuration. Reference to Peter`s manifesto https://github.com/stpeter/manifesto}
1038 \input{proxy_solutions}
1042 %%% Local Variables:
1044 %%% TeX-master: "applied-crypto-hardening"