~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/html/encryption-options.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Encryption Options</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REV="MADE"
 
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
 
11
REL="HOME"
 
12
TITLE="PostgreSQL 9.1beta1 Documentation"
 
13
HREF="index.html"><LINK
 
14
REL="UP"
 
15
TITLE="Server Setup and Operation"
 
16
HREF="runtime.html"><LINK
 
17
REL="PREVIOUS"
 
18
TITLE="Preventing Server Spoofing"
 
19
HREF="preventing-server-spoofing.html"><LINK
 
20
REL="NEXT"
 
21
TITLE="Secure TCP/IP Connections with SSL"
 
22
HREF="ssl-tcp.html"><LINK
 
23
REL="STYLESHEET"
 
24
TYPE="text/css"
 
25
HREF="stylesheet.css"><META
 
26
HTTP-EQUIV="Content-Type"
 
27
CONTENT="text/html; charset=ISO-8859-1"><META
 
28
NAME="creation"
 
29
CONTENT="2011-04-27T21:20:33"></HEAD
 
30
><BODY
 
31
CLASS="SECT1"
 
32
><DIV
 
33
CLASS="NAVHEADER"
 
34
><TABLE
 
35
SUMMARY="Header navigation table"
 
36
WIDTH="100%"
 
37
BORDER="0"
 
38
CELLPADDING="0"
 
39
CELLSPACING="0"
 
40
><TR
 
41
><TH
 
42
COLSPAN="5"
 
43
ALIGN="center"
 
44
VALIGN="bottom"
 
45
><A
 
46
HREF="index.html"
 
47
>PostgreSQL 9.1beta1 Documentation</A
 
48
></TH
 
49
></TR
 
50
><TR
 
51
><TD
 
52
WIDTH="10%"
 
53
ALIGN="left"
 
54
VALIGN="top"
 
55
><A
 
56
TITLE="Preventing Server Spoofing"
 
57
HREF="preventing-server-spoofing.html"
 
58
ACCESSKEY="P"
 
59
>Prev</A
 
60
></TD
 
61
><TD
 
62
WIDTH="10%"
 
63
ALIGN="left"
 
64
VALIGN="top"
 
65
><A
 
66
TITLE="Server Setup and Operation"
 
67
HREF="runtime.html"
 
68
>Fast Backward</A
 
69
></TD
 
70
><TD
 
71
WIDTH="60%"
 
72
ALIGN="center"
 
73
VALIGN="bottom"
 
74
>Chapter 17. Server Setup and Operation</TD
 
75
><TD
 
76
WIDTH="10%"
 
77
ALIGN="right"
 
78
VALIGN="top"
 
79
><A
 
80
TITLE="Server Setup and Operation"
 
81
HREF="runtime.html"
 
82
>Fast Forward</A
 
83
></TD
 
84
><TD
 
85
WIDTH="10%"
 
86
ALIGN="right"
 
87
VALIGN="top"
 
88
><A
 
89
TITLE="Secure TCP/IP Connections with SSL"
 
90
HREF="ssl-tcp.html"
 
91
ACCESSKEY="N"
 
92
>Next</A
 
93
></TD
 
94
></TR
 
95
></TABLE
 
96
><HR
 
97
ALIGN="LEFT"
 
98
WIDTH="100%"></DIV
 
99
><DIV
 
100
CLASS="SECT1"
 
101
><H1
 
102
CLASS="SECT1"
 
103
><A
 
104
NAME="ENCRYPTION-OPTIONS"
 
105
>17.8. Encryption Options</A
 
106
></H1
 
107
><P
 
108
>   <SPAN
 
109
CLASS="PRODUCTNAME"
 
110
>PostgreSQL</SPAN
 
111
> offers encryption at several
 
112
   levels, and provides flexibility in protecting data from disclosure
 
113
   due to database server theft, unscrupulous administrators, and
 
114
   insecure networks. Encryption might also be required to secure
 
115
   sensitive data such as medical records or financial transactions.
 
116
  </P
 
117
><P
 
118
></P
 
119
><DIV
 
120
CLASS="VARIABLELIST"
 
121
><DL
 
122
><DT
 
123
>Password Storage Encryption</DT
 
124
><DD
 
125
><P
 
126
>     By default, database user passwords are stored as MD5 hashes, so
 
127
     the administrator cannot determine the actual password assigned
 
128
     to the user. If MD5 encryption is used for client authentication,
 
129
     the unencrypted password is never even temporarily present on the
 
130
     server because the client MD5-encrypts it before being sent
 
131
     across the network.
 
132
    </P
 
133
></DD
 
134
><DT
 
135
>Encryption For Specific Columns</DT
 
136
><DD
 
137
><P
 
138
>     The <A
 
139
HREF="pgcrypto.html"
 
140
>Section F.28</A
 
141
> module allows certain fields to be
 
142
     stored encrypted.
 
143
     This is useful if only some of the data is sensitive.
 
144
     The client supplies the decryption key and the data is decrypted
 
145
     on the server and then sent to the client.
 
146
    </P
 
147
><P
 
148
>     The decrypted data and the decryption key are present on the
 
149
     server for a brief time while it is being decrypted and
 
150
     communicated between the client and server. This presents a brief
 
151
     moment where the data and keys can be intercepted by someone with
 
152
     complete access to the database server, such as the system
 
153
     administrator.
 
154
    </P
 
155
></DD
 
156
><DT
 
157
>Data Partition Encryption</DT
 
158
><DD
 
159
><P
 
160
>     On Linux, encryption can be layered on top of a file system
 
161
     using a <SPAN
 
162
CLASS="QUOTE"
 
163
>"loopback device"</SPAN
 
164
>. This allows an entire
 
165
     file system partition to be encrypted on disk, and decrypted by the
 
166
     operating system. On FreeBSD, the equivalent facility is called
 
167
     GEOM Based Disk Encryption (<ACRONYM
 
168
CLASS="ACRONYM"
 
169
>gbde</ACRONYM
 
170
>), and many
 
171
     other operating systems support this functionality, including Windows.
 
172
    </P
 
173
><P
 
174
>     This mechanism prevents unencrypted data from being read from the
 
175
     drives if the drives or the entire computer is stolen. This does
 
176
     not protect against attacks while the file system is mounted,
 
177
     because when mounted, the operating system provides an unencrypted
 
178
     view of the data. However, to mount the file system, you need some
 
179
     way for the encryption key to be passed to the operating system,
 
180
     and sometimes the key is stored somewhere on the host that mounts
 
181
     the disk.
 
182
    </P
 
183
></DD
 
184
><DT
 
185
>Encrypting Passwords Across A Network</DT
 
186
><DD
 
187
><P
 
188
>      The <TT
 
189
CLASS="LITERAL"
 
190
>MD5</TT
 
191
> authentication method double-encrypts the
 
192
      password on the client before sending it to the server. It first
 
193
      MD5-encrypts it based on the user name, and then encrypts it
 
194
      based on a random salt sent by the server when the database
 
195
      connection was made. It is this double-encrypted value that is
 
196
      sent over the network to the server. Double-encryption not only
 
197
      prevents the password from being discovered, it also prevents
 
198
      another connection from using the same encrypted password to
 
199
      connect to the database server at a later time.
 
200
     </P
 
201
></DD
 
202
><DT
 
203
>Encrypting Data Across A Network</DT
 
204
><DD
 
205
><P
 
206
>      SSL connections encrypt all data sent across the network: the
 
207
      password, the queries, and the data returned. The
 
208
      <TT
 
209
CLASS="FILENAME"
 
210
>pg_hba.conf</TT
 
211
> file allows administrators to specify
 
212
      which hosts can use non-encrypted connections (<TT
 
213
CLASS="LITERAL"
 
214
>host</TT
 
215
>)
 
216
      and which require SSL-encrypted connections
 
217
      (<TT
 
218
CLASS="LITERAL"
 
219
>hostssl</TT
 
220
>). Also, clients can specify that they
 
221
      connect to servers only via SSL. <SPAN
 
222
CLASS="APPLICATION"
 
223
>Stunnel</SPAN
 
224
> or
 
225
      <SPAN
 
226
CLASS="APPLICATION"
 
227
>SSH</SPAN
 
228
> can also be used to encrypt transmissions.
 
229
     </P
 
230
></DD
 
231
><DT
 
232
>SSL Host Authentication</DT
 
233
><DD
 
234
><P
 
235
>     It is possible for both the client and server to provide SSL
 
236
     certificates to each other. It takes some extra configuration
 
237
     on each side, but this provides stronger verification of identity
 
238
     than the mere use of passwords. It prevents a computer from
 
239
     pretending to be the server just long enough to read the password
 
240
     sent by the client. It also helps prevent <SPAN
 
241
CLASS="QUOTE"
 
242
>"man in the middle"</SPAN
 
243
>
 
244
     attacks where a computer between the client and server pretends to
 
245
     be the server and reads and passes all data between the client and
 
246
     server.
 
247
    </P
 
248
></DD
 
249
><DT
 
250
>Client-Side Encryption</DT
 
251
><DD
 
252
><P
 
253
>     If the system administrator for the server's machine cannot be trusted,
 
254
     it is necessary
 
255
     for the client to encrypt the data; this way, unencrypted data
 
256
     never appears on the database server. Data is encrypted on the
 
257
     client before being sent to the server, and database results have
 
258
     to be decrypted on the client before being used.
 
259
    </P
 
260
></DD
 
261
></DL
 
262
></DIV
 
263
></DIV
 
264
><DIV
 
265
CLASS="NAVFOOTER"
 
266
><HR
 
267
ALIGN="LEFT"
 
268
WIDTH="100%"><TABLE
 
269
SUMMARY="Footer navigation table"
 
270
WIDTH="100%"
 
271
BORDER="0"
 
272
CELLPADDING="0"
 
273
CELLSPACING="0"
 
274
><TR
 
275
><TD
 
276
WIDTH="33%"
 
277
ALIGN="left"
 
278
VALIGN="top"
 
279
><A
 
280
HREF="preventing-server-spoofing.html"
 
281
ACCESSKEY="P"
 
282
>Prev</A
 
283
></TD
 
284
><TD
 
285
WIDTH="34%"
 
286
ALIGN="center"
 
287
VALIGN="top"
 
288
><A
 
289
HREF="index.html"
 
290
ACCESSKEY="H"
 
291
>Home</A
 
292
></TD
 
293
><TD
 
294
WIDTH="33%"
 
295
ALIGN="right"
 
296
VALIGN="top"
 
297
><A
 
298
HREF="ssl-tcp.html"
 
299
ACCESSKEY="N"
 
300
>Next</A
 
301
></TD
 
302
></TR
 
303
><TR
 
304
><TD
 
305
WIDTH="33%"
 
306
ALIGN="left"
 
307
VALIGN="top"
 
308
>Preventing Server Spoofing</TD
 
309
><TD
 
310
WIDTH="34%"
 
311
ALIGN="center"
 
312
VALIGN="top"
 
313
><A
 
314
HREF="runtime.html"
 
315
ACCESSKEY="U"
 
316
>Up</A
 
317
></TD
 
318
><TD
 
319
WIDTH="33%"
 
320
ALIGN="right"
 
321
VALIGN="top"
 
322
>Secure TCP/IP Connections with SSL</TD
 
323
></TR
 
324
></TABLE
 
325
></DIV
 
326
></BODY
 
327
></HTML
 
328
>
 
 
b'\\ No newline at end of file'