d7217304a31a1a9af2e34c941e8635c15d3396e7
[ach-master.git] / src / practical_settings.tex
1 \section{Recommendations on practical settings}
2
3
4 \subsection{SSL}
5
6 %%% NOTE: we do not need to list this all here, can move to an appendix
7 %At the time of this writing, SSL is defined in RFCs:   
8 %
9 %\begin{itemize}
10 %\item RFC2246 - TLS1.0         
11 %\item RFC3268 - AES            
12 %\item RFC4132 - Camelia                
13 %\item RFC4162 - SEED           
14 %\item RFC4279 - PSK            
15 %\item RFC4346 - TLS 1.1                
16 %\item RFC4492 - ECC            
17 %\item RFC4785 - PSK\_NULL              
18 %\item RFC5246 - TLS 1.2                
19 %\item RFC5288 - AES\_GCM               
20 %\item RFC5289 - AES\_GCM\_SHA2\_ECC            
21 %\item RFC5430 - Suite B                
22 %\item RFC5487 - GCM\_PSK               
23 %\item RFC5489 - ECDHE\_PSK             
24 %\item RFC5932 - Camelia                
25 %\item RFC6101 - SSL 3.0                
26 %\item RFC6209 - ARIA           
27 %\item RFC6367 - Camelia                
28 %\item RFC6655 - AES\_CCM               
29 %\item RFC7027 - Brainpool Curves               
30 %\end{itemize}
31
32 \subsubsection{Overview of SSL Server settings}
33
34 Most Server software (Webservers, Mail servers, etc.) can be configured to prefer certain cipher suites over others. 
35 We followed the recommendations by Ivan Ristic's SSL/TLS Deployment Best Practices\footnote{\url{https://www.ssllabs.com/projects/best-practices/index.html}} document (see section 2.2 "Use Secure Protocols") and arrived at a list of recommended cipher suites for SSL enabled servers.
36
37 The results of following his adivce is a categorisation of cipher suites.
38
39 \begin{center}
40 \begin{tabular}{| l | l | l | l | l|}
41 \hline
42 & Version   & Key\_Exchange  & Cipher    & MAC       \\ \hline
43 \cellcolor{green}prefer  & TLS 1.2   & DHE\_DSS   & AES\_256\_GCM   & SHA384        \\ \hline
44     &   & DHE\_RSA   & AES\_256\_CCM   & SHA256        \\ \hline
45     &   & ECDHE\_ECDSA   & AES\_256\_CBC   &       \\ \hline
46     &   & ECDHE\_RSA &   &       \\ \hline
47     &   &   &   &       \\ \hline
48 \cellcolor{orange}consider    & TLS 1.1   & DH\_DSS    & AES\_128\_GCM   & SHA       \\ \hline
49     & TLS 1.0   & DH\_RSA    & AES\_128\_CCM   &       \\ \hline
50     &   & ECDH\_ECDSA    & AES\_128\_CBC   &       \\ \hline
51     &   & ECDH\_RSA  & CAMELLIA\_256\_CBC  &       \\ \hline
52     &   & RSA   & CAMELLIA\_128\_CBC  &       \\ \hline
53     &   &   &   &       \\ \hline
54 \cellcolor{red}avoid   
55 & SSL 3.0   & NULL  & NULL  & NULL      \\ \hline
56     &   & DH\_anon   & RC4\_128   & MD5       \\ \hline
57     &   & ECDH\_anon & 3DES\_EDE\_CBC  &       \\ \hline
58     &   &   & DES\_CBC   &       \\ \hline
59     &   &   &   &       \\ \hline
60 \cellcolor{blue}{\color{white}special }
61 &   & PSK   & CAMELLIA\_256\_GCM  &       \\ \hline
62     &   & DHE\_PSK   & CAMELLIA\_128\_GCM  &       \\ \hline
63     &   & RSA\_PSK   & ARIA\_256\_GCM  &       \\ \hline
64     &   & ECDHE\_PSK & ARIA\_256\_CBC  &       \\ \hline
65     &   &   & ARIA\_128\_GCM  &       \\ \hline
66     &   &   & ARIA\_128\_CBC  &       \\ \hline
67     &   &   & SEED  &       \\ \hline
68 \end{tabular}
69 \end{center}
70
71 A remark on the ``consider'' section: the BSI (Bundesamt f\"ur Sicherheit in der Informationstechnik, Germany) recommends in its technical report TR-02102-2\footnote{\url{https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Publikationen/TechnischeRichtlinien/TR02102/BSI-TR-02102-2_pdf.html}} to \textbf{avoid} non-ephemeral\footnote{ephemeral keys are session keys which are destroyed upon termination of the encrypted session. In TLS/SSL, they are realized by the DHE cipher suites. } keys for any communication which might contain personal or sensitive data. In this document, we follow BSI's advice and therefore only keep cipher suites containing (EC)DH\textbf{E} variants. System administrators, who can not use forward secrecy can still use the cipher suites in the consider section. We however, do not recommend them in this document.
72
73 %% NOTE: s/forward secrecy/perfect forward secrecy???
74
75 Note that the entries marked as "special" are cipher suites which are not common to all clients (webbrowsers etc).
76
77
78 \subsubsection{Client recommendations}
79  
80 Next we tested the cipher suites above on the following clients:
81
82 \begin{itemize}
83 \item Chrome 30.0.1599.101 Mac OS X 10.9
84 \item Safari 7.0 Mac OS X 10.9
85 \item Firefox 25.0 Mac OS X 10.9
86 \item Internet Explorer 10 Windows 7
87 \item Apple iOS 7.0.3
88 \end{itemize}
89
90
91 The result of testing the cipher suites with these clients gives us a preference order as shown in table \ref{table:prefOrderCipherSuites}. 
92 Should a client not be able to use a specific cipher suite, it will fall back to the next possible entry as given by the ordering.
93
94 \begin{center}
95 \begin{table}[h]
96 \small
97     \begin{tabular}{|l|l|l|l|l|}
98     \hline
99     Pref & Cipher Suite                                   & ID         & Browser                     \\ \hline
100     1    & TLS\_DHE\_RSA\_WITH\_AES\_256\_GCM\_SHA384     &     0x009f & OpenSSL command line client \\ \hline
101     2    & TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA384 &     0xC024 & Safari                      \\ \hline
102     3    & TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA384   &     0xC028 & Safari                      \\ \hline
103     4    & TLS\_DHE\_RSA\_WITH\_AES\_256\_CBC\_SHA256     &     0x006B & Safari, Chrome              \\ \hline
104     5    & TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA    &     0xC00A & Safari, Chrome, Firefox, IE \\ \hline
105     6    & TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA      &     0xC014 & Safari, Chrome, Firefox, IE \\ \hline
106     7    & TLS\_DHE\_RSA\_WITH\_AES\_256\_CBC\_SHA        &     0x0039 & Safari, Chrome, Firefox     \\ \hline
107     8    & TLS\_DHE\_DSS\_WITH\_AES\_256\_CBC\_SHA        &     0x0038 & Firefox, IE                 \\ \hline
108     9    & TLS\_DHE\_RSA\_WITH\_CAMELLIA\_256\_CBC\_SHA   &     0x0088 & Firefox                     \\ \hline
109     10   & TLS\_DHE\_DSS\_WITH\_CAMELLIA\_256\_CBC\_SHA   &     0x0087 & Firefox                     \\ \hline
110     \end{tabular}
111 \caption{Preference order of cipher suites}
112 \label{table:prefOrderCipherSuites}
113 \end{table}
114 \end{center}
115
116
117 Table \ref{table:prefOrderOpenSSLNames} shows the same data again with specifying the corresponding OpenSSL name.
118
119 \begin{center}
120 \begin{table}[h]
121 \small
122     \begin{tabular}{|l|l|l|}
123     \hline
124     Cipher Suite                                   & ID         & OpenSSL Name                  \\ \hline
125     TLS\_DHE\_RSA\_WITH\_AES\_256\_GCM\_SHA384     &     0x009f &         DHE-RSA-AES256-GCM-SHA384 \\ \hline
126     TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA384 &     0xC024 &     ECDHE-ECDSA-AES256-SHA384 \\ \hline
127     TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA384   &     0xC028 &     ECDHE-RSA-AES256-SHA384   \\ \hline
128     TLS\_DHE\_RSA\_WITH\_AES\_256\_CBC\_SHA256     &     0x006B &     DHE-RSA-AES256-SHA256     \\ \hline
129     TLS\_ECDHE\_ECDSA\_WITH\_AES\_256\_CBC\_SHA    &     0xC00A &     ECDHE-ECDSA-AES256-SHA    \\ \hline
130     TLS\_ECDHE\_RSA\_WITH\_AES\_256\_CBC\_SHA      &     0xC014 &     ECDHE-RSA-AES256-SHA      \\ \hline
131     TLS\_DHE\_RSA\_WITH\_AES\_256\_CBC\_SHA        &     0x0039 &     DHE-RSA-AES256-SHA        \\ \hline
132     TLS\_DHE\_DSS\_WITH\_AES\_256\_CBC\_SHA        &     0x0038 &     DHE-DSS-AES256-SHA        \\ \hline
133     TLS\_DHE\_RSA\_WITH\_CAMELLIA\_256\_CBC\_SHA   &     0x0088 &     DHE-RSA-CAMELLIA256-SHA   \\ \hline
134     TLS\_DHE\_DSS\_WITH\_CAMELLIA\_256\_CBC\_SHA   &     0x0087 &     DHE-DSS-CAMELLIA256-SHA   \\ \hline
135     \end{tabular}
136 \caption{Preference order of cipher suites, with OpenSSL names}
137 \label{table:prefOrderOpenSSLNames}
138 \end{table}
139 \end{center}
140
141 Note: the tables \ref{table:prefOrderOpenSSLNames} and \ref{table:prefOrderCipherSuites} contains Eliptic curve key exchanges. There are currently strong doubts\footnote{\url{http://safecurves.cr.yp.to/rigid.html}} concerning ECC.
142 If unsure, remove the cipher suites starting with ECDHE in the table above.
143
144
145 Based on this ordering, we can now define the corresponding settings for servers. We will start with the most common web servers
146
147 \subsubsection{Apache}
148
149 Note: a "\textbackslash" (backslash) denotes a line continuation which was wrapped due to formatting reasons here. Do not copy it verbatim.
150
151 %-All +TLSv1.1 +TLSv1.2
152 \begin{verbatim}
153   SSLProtocol All -SSLv2 -SSLv3 
154   SSLHonorCipherOrder On
155   SSLCompression off
156   # Add six earth month HSTS header for all users...
157   Header add Strict-Transport-Security "max-age=15768000"
158   # If you want to protect all subdomains, use the following header
159   # Strict-Transport-Security: max-age=15768000 ; includeSubDomains
160
161   SSLCipherSuite  DHE+AESGCM:\
162     ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:\
163     DHE-RSA-AES256-SHA256:ECDHE-ECDSA-AES256-SHA:\
164     ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:\
165     DHE-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:\
166     DHE-DSS-CAMELLIA256-SHA:!ADH:!AECDH:!MD5:!DSS
167 \end{verbatim}
168
169 Note again, that any cipher suite starting with ECDHE  can be omitted in case of doubt.
170 %% XXX NOTE TO SELF: remove from future automatically generated lists!
171
172 %XXXX   ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AES:RSA+3DES:!ADH:!AECDH:!MD5:!DSS
173
174
175
176 \subsubsection{nginx}
177
178 \begin{verbatim}
179   ssl_prefer_server_ciphers on;
180   ssl_protocols All -SSLv2 -SSLv3; 
181   ssl_ciphers DHE+AESGCM:\
182     ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:\
183     DHE-RSA-AES256-SHA256:ECDHE-ECDSA-AES256-SHA:\
184     ECDHE-RSA-AES256-SHA:DHE-RSA-AES256-SHA:\
185     DHE-DSS-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:\
186     DHE-DSS-CAMELLIA256-SHA:!ADH:!AECDH:!MD5:!DSS;
187   add_header Strict-Transport-Security max-age=2592000;
188   add_header                X-Frame-Options DENY
189 \end{verbatim}
190
191 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:
192
193 \begin{verbatim}
194   ssl_ecdh_curve          sect571k1;
195 \end{verbatim}
196
197 \subsubsection{openssl.conf settings}
198
199 %\subsubsection{Differences in SSL libraries: gnutls vs. openssl vs. others}
200
201 \subsubsection{IMAPS}
202 \subsubsection{Postfix}
203 \subsubsection{SMTP: opportunistic TLS}
204 % do we need to documment starttls in detail?
205 %\subsubsection{starttls?}
206
207 \subsection{SSH}
208
209 \subsection{OpenVPN}
210
211 \subsection{IPSec}
212
213 \subsection{PGP}
214
215 \subsection{PRNG settings}
216