Merge branch 'master' of github.com:BetterCrypto/Applied-Crypto-Hardening
[ach-master.git] / src / practical_settings / DBs.tex
1 %%\subsection{Database Systems}
2 % This list is based on : http://en.wikipedia.org/wiki/Relational_database_management_system#Market_share
3
4 %% ---------------------------------------------------------------------- 
5 \subsection{Oracle}
6 %\subsubsection{Tested with Version}
7 \todo{not tested yet}
8
9 \subsubsection{References}
10 \begin{itemize}
11   \item Technical safety requirements by \emph{Deutsche Telekom AG} (German). Please read section 17.12 or pages 129 and following (Req 396 and Req 397) about SSL and ciphersuites \url{http://www.telekom.com/static/-/155996/7/technische-sicherheitsanforderungen-si}
12 \end{itemize}
13
14
15 %% ---------------------------------------------------------------------- 
16 \todo{write this}
17
18
19 %% ---------------------------------------------------------------------- 
20 \subsection{MySQL}
21 \subsubsection{Tested with Version}
22 \begin{itemize}
23   \item Debian 7.0 and MySQL 5.5
24 \end{itemize}
25
26
27 \subsubsection{Settings}
28 \paragraph*{my.cnf}
29 \begin{lstlisting}
30 [mysqld]
31 ssl
32 ssl-ca=/etc/mysql/ssl/ca-cert.pem
33 ssl-cert=/etc/mysql/ssl/client-cert.pem
34 ssl-key=/etc/mysql/ssl/client-key.pem
35 ssl-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
36 \end{lstlisting}
37
38 %\subsubsection{Additional settings}
39
40
41 %\subsubsection{Justification for special settings (if needed)}
42 % 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
43
44
45 \subsubsection{References}
46 \begin{itemize}
47   \item MySQL Documentation on SSl Connections: \url{https://dev.mysql.com/doc/refman/5.5/en/ssl-connections.html}
48 \end{itemize}
49
50
51 \subsubsection{How to test}
52 After restarting the server run the following query to see if the ssl settings are correct:
53 \begin{lstlisting}
54 show variables like '%ssl%';
55 \end{lstlisting}
56
57
58 %% ---------------------------------------------------------------------- 
59 \subsection{DB2}
60 \subsubsection{Tested with Version}
61 \todo{not tested}
62
63
64 \subsubsection{References}
65 \begin{itemize}
66   \item IMB Db2 Documentation on \emph{Supported cipher suites} \url{http://pic.dhe.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=\%2Fcom.ibm.db2.luw.admin.sec.doc\%2Fdoc\%2Fc0053544.html}
67 \end{itemize}
68
69
70 \subsubsection{Settings}
71 \paragraph*{ssl\_cipherspecs}
72 In the link above the whole SSL-configuration is described in-depth. The following command shows only how to set the recommended ciphersuites:
73 \begin{lstlisting}
74 # recommended and supported ciphersuites 
75
76 db2 update dbm cfg using SSL_CIPHERSPECS 
77 TLS_RSA_WITH_AES_256_CBC_SHA256,
78 TLS_RSA_WITH_AES_128_GCM_SHA256,
79 TLS_RSA_WITH_AES_128_CBC_SHA256,
80 TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
81 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
82 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
83 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
84 TLS_RSA_WITH_AES_256_GCM_SHA384,
85 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
86 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
87 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
88 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
89 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
90 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
91 TLS_RSA_WITH_AES_256_CBC_SHA,
92 TLS_RSA_WITH_AES_128_CBC_SHA,
93 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
94 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
95 \end{lstlisting}
96
97
98 %% ---------------------------------------------------------------------- 
99 \subsection{PostgreSQL}
100 \subsubsection{Tested with Versions}
101 \begin{itemize}
102   \item Debian 7.0 and PostgreSQL 9.1
103   \item Linux Mint 14 nadia / Ubuntu 12.10 quantal with PostgreSQL 9.1+136 and OpenSSL 1.0.1c
104 \end{itemize}
105
106
107 \subsubsection{References}
108 \begin{itemize}
109   \item It's recommended to read {\small \url{http://www.postgresql.org/docs/9.1/interactive/runtime-config-connection.html\#RUNTIME-CONFIG-CONNECTION-SECURITY}} (please edit the version with your preferred one).
110   \item PostgreSQL Documentation on \emph{Secure TCP/IP Connections with SSL}: \url{http://www.postgresql.org/docs/9.1/static/ssl-tcp.html}
111 \end{itemize}
112
113
114 \subsubsection{Settings}
115 To start in SSL mode the server.crt and server.key must exist in the server's data directory \$PGDATA.
116
117 Starting with version 9.2, you have the possibility to set the path manually.
118
119 \begin{lstlisting}
120 ssl_key_file = '/your/path/server.key'
121 ssl_cert_file = '/your/path/server.crt'
122 ssl_ca_file = '/your/path/root.crt'
123 \end{lstlisting}
124
125
126 \paragraph*{postgresql.conf}\mbox{}\\
127 \begin{lstlisting}
128 #>=8.3
129 ssl = on 
130 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'
131 \end{lstlisting}
132
133
134 \subsubsection{How to test}
135 To test your ssl settings, run psql with the sslmode parameter:
136 \begin{lstlisting}
137 psql "sslmode=require host=postgres-server dbname=database" your-username
138 \end{lstlisting}
139