annotate thesis/tex/5-Improvements.tex @ 197:b08be036783d

moved new design to chapter of its own
author meillo@marmaro.de
date Wed, 31 Dec 2008 14:01:58 +0100
parents e038b2572d12
children 711f0d3f5dfd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
176
d4f818a4da04 restructured ch05
meillo@marmaro.de
parents: 175
diff changeset
1 \chapter{Improvements}
89
3b5ba7331eb5 complete restructuring of whole document
meillo@marmaro.de
parents:
diff changeset
2
109
de590ff06051 changes suggested by schaeffter
meillo@marmaro.de
parents: 93
diff changeset
3 << what to really implement within the thesis >>
de590ff06051 changes suggested by schaeffter
meillo@marmaro.de
parents: 93
diff changeset
4
89
3b5ba7331eb5 complete restructuring of whole document
meillo@marmaro.de
parents:
diff changeset
5
184
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
6
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
7
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
8
176
d4f818a4da04 restructured ch05
meillo@marmaro.de
parents: 175
diff changeset
9 \section{Implementation}
125
aa1fb227e68e unemphasised some terms
meillo@marmaro.de
parents: 109
diff changeset
10
184
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
11
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
12
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
13
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
14
176
d4f818a4da04 restructured ch05
meillo@marmaro.de
parents: 175
diff changeset
15 \subsection{Authentication for SMTP-in}
125
aa1fb227e68e unemphasised some terms
meillo@marmaro.de
parents: 109
diff changeset
16
184
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
17 Several ways to restrict access are available. The most simple one is restrictiction by the \NAME{IP} address. No extra complexity is added this way, but static \NAME{IP} addresses are mandatory. This kind of restriction may be enabled using the operating system's \path{hosts.allow} and \path{hosts.deny} files. To allow only connections to port 25 from localhost or the local network \texttt{192.168.100.0/24} insert the line ``\texttt{25: ALL}'' into \path{hosts.deny} and ``\texttt{25: 127.0.0.1, 192.168.100.}'' into \path{hosts.allow}.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
18
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
19 If static access restriction is not possible, for example if mail from locations with changing \NAME{IP} addresses wants to be accepted, some kind of authentication mechanism is required. Three common kinds exist:
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
20 \begin{enumerate}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
21 \item \SMTP-after-\NAME{POP}: uses authenication on the \NAME{POP} protocol to permit incoming \SMTP\ connections for a limited time afterwards.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
22 \item \SMTP authentication: is an extension to \SMTP. Authentication can be requested before mail is accepted.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
23 \item Certificates: confirm the identity of someone.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
24 \end{enumerate}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
25 The first mechanism requires a \NAME{POP} (or \NAME{IMAP}) server running on the same host (or a trusted one), to enable the \SMTP\ server to use the login dates on the \NAME{POP} server. This is a common practice used by mail service providers, but is not adequate for the environments \masqmail\ is designed for.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
26
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
27 Certificate based authentication, like provided by \NAME{TLS}, suffers from the overhead of certificate management. But \NAME{TLS} provides encryption too, so is useful anyway.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
28
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
29 \SMTP\ authentication (also refered to as \NAME{SMTP-AUTH}) suppoert is easiest received by using a \name{Simple Authentication and Security Layer} implementation. \person{Dent} sees in \NAME{SASL} the best solution for authenticating dynamic users:
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
30 \begin{quote}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
31 %None of these add-ons is an ideal solution. They require additional code compiled into your existing daemons that may then require special write accesss to system files. They also require additional work for busy system administrators. If you cannot use any of the nonauthenticating alternatives mentioned earlier, or your business requirements demand that all of your users' mail pass through your system no matter where they are on the Internet, SASL is probably the solution that offers the most reliable and scalable method to authenticate users.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
32 None of these [authentication methods] is an ideal solution. They require additional code compiled into your existing daemons that may then require special write accesss to system files. They also require additional work for busy system administrators. If you cannot use any of the nonauthenticating alternatives mentioned earlier, or your business requirements demand that all of your users' mail pass through your system no matter where they are on the Internet, \NAME{SASL} is probably the solution that offers the most reliable and scalable method to authenticate users.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
33 \cite[page 44]{dent04}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
34 \end{quote}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
35
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
36 %either by
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
37 %- network/ip address
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
38 % easiest: restricting by static IP addresses (Access control via hosts.allow/hosts.deny)
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
39 %or
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
40 %- some kind of auth (for dynamic remote hosts)
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
41 % adds complexity
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
42 % - SASL
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
43 % - POP/IMAP: pop-before-smtp, DRAC, WHOSON
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
44 % - TLS (certificates)
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
45
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
46
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
47
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
48
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
49
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
50
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
51
176
d4f818a4da04 restructured ch05
meillo@marmaro.de
parents: 175
diff changeset
52 \subsection{Encryption}
129
5a122d28f1ca moved some comment lines
meillo@marmaro.de
parents: 125
diff changeset
53
184
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
54 Electronic mail is very weak to sniffing attacks, because all data transfer is unencrypted. This concerns the message's content, as well as the email addresses in header and envelope, but also authentication dialogs that may transfer plain text passwords (\NAME{PLAIN} and \NAME{LOGIN} are examples). Adding encryption is therefor wanted.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
55
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
56 The common way to encrypt \SMTP\ dialogs is using \name{Transport Layer Security} (short: \TLS, successor of \NAME{SSL}). \TLS\ encrypts the datagrams of the \name{transport layer}. This means it works below the application protocols and can be used by any of them\citeweb{wikipedia:tls}.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
57
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
58 \TLS\ allows to create secure tunnels through which arbitrary programs can communicate. Hence one can add secure communication afterwards to programs without changing them. \name{OpenSSL} for example---a free implementation---allows traffic to be piped into a command; a secure tunnel is created and the traffic is forwarded through it. Or a secure tunnel can be set up between a local and a remote port; this tunnel can then be used by any application.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
59
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
60 The \NAME{POP} protocol, for example, is good suited for such tunneling, but \SMTP\ is is not generally. Outgoing \SMTP\ client connections can be tunneled without problem---\masqmail\ already provides a configure option called \texttt{wrapper} to do so. Tunneling incomming connections to a server leads to problems with \SMTP. As data comes encrypted through the tunnel to the receiving host and gets then decrypted and forwarded on local to the port the application listens on. From the \MTA's view, this makes all connections appear to come from localhost, unfortunately. Figure \ref{fig:stunnel} depicts the data flow.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
61
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
62 \begin{figure}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
63 \begin{center}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
64 \input{input/stunnel.tex}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
65 \end{center}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
66 \caption{Data flow using \name{stunnel}}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
67 \label{fig:stunnel}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
68 \end{figure}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
69
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
70 For incoming connections, \NAME{STARTTLS}---defined in \RFC2487---is what \mta{}s implement.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
71
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
72 \masqmail\ is already able to encrypt outgoing connections, but encryption of incoming connections, using \NAME{STARTTLS} should be implemented. This only affects the \SMTP\ server module.
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
73
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
74 %TLS/SSL prevents attackers to listen on the cable
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
75 %but it does not prevent man-in-the-middle attacks
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
76 %signed certificates help here
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
77 % or PGP encryption
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
78
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
79
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
80 %do not use stunnel wit SMTP:
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
81 %because all incoming mail would be from 127.0.0.1 !!
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
82 %use STARTTLS instead
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
83
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
84 %postfix: main.cf
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
85 %\begin{verbatim}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
86 % smtpd_use_tls = yes
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
87 % smtpd_tls_received_header = no (does not log in received headers)
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
88 %
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
89 % smtpd_tls_key_file = /etc/postfix/key.pem
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
90 % smtpd_tls_cert_file = /etc/postfix/cert.pem
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
91 % smtpd_tls_CA_file = /etc/postfix/CAcert.pem
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
92 %
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
93 % smtp_use_tls = yes (use TLS for sending)
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
94 % smtp_tls_key_file = /etc/postfix/key.pem
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
95 % smtp_tls_cert_file = /etc/postfix/cert.pem
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
96 % smtp_tls_CA_file = /etc/postfix/CAcert.pem
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
97 %\end{verbatim}
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
98
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
99
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
100
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
101
194
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
102 \subsection{Various bug fixes}
184
b0adae481138 moved content
meillo@marmaro.de
parents: 176
diff changeset
103
89
3b5ba7331eb5 complete restructuring of whole document
meillo@marmaro.de
parents:
diff changeset
104
3b5ba7331eb5 complete restructuring of whole document
meillo@marmaro.de
parents:
diff changeset
105
194
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
106
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
107
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
108
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
109 \section{Test and validation}
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
110
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
111
176
d4f818a4da04 restructured ch05
meillo@marmaro.de
parents: 175
diff changeset
112 \section{Documentation}
89
3b5ba7331eb5 complete restructuring of whole document
meillo@marmaro.de
parents:
diff changeset
113
3b5ba7331eb5 complete restructuring of whole document
meillo@marmaro.de
parents:
diff changeset
114
175
aab8499c9f2f moved ch06s content into other chapters to remove it
meillo@marmaro.de
parents: 129
diff changeset
115 \section{Release}
aab8499c9f2f moved ch06s content into other chapters to remove it
meillo@marmaro.de
parents: 129
diff changeset
116
194
e038b2572d12 minor restructuring
meillo@marmaro.de
parents: 184
diff changeset
117 Upstream and Debian