kdc: support pkinit_kdc_revoke for pkinit anchors
[lorikeet-heimdal.git] / doc / whatis.texi
1 @c $Id$
2
3 @node What is Kerberos?, What is PKIX?, Introduction, Top
4 @chapter What is Kerberos?
5
6 @quotation
7 @flushleft
8         Now this Cerberus had three heads of dogs,
9         the tail of a dragon, and on his back the
10         heads of all sorts of snakes.
11         --- Pseudo-Apollodorus Library 2.5.12
12 @end flushleft
13 @end quotation
14
15 Kerberos is a system for authenticating users and services on a network.
16 It is built upon the assumption that the network is ``unsafe''.  For
17 example, data sent over the network can be eavesdropped and altered, and
18 addresses can also be faked.  Therefore they cannot be used for
19 authentication purposes.
20 @cindex authentication
21
22 Kerberos is a trusted third-party service.  That means that there is a
23 third party (the kerberos server) that is trusted by all the entities on
24 the network (users and services, usually called @dfn{principals}).  All
25 principals share a secret password (or key) with the kerberos server and
26 this enables principals to verify that the messages from the kerberos
27 server are authentic.  Thus trusting the kerberos server, users and
28 services can authenticate each other.
29
30 @section Basic mechanism
31
32 @ifinfo
33 @macro sub{arg}
34 <\arg\>
35 @end macro
36 @end ifinfo
37
38 @ifhtml
39 @macro sub{arg}
40
41 @html
42 <sub>\arg\</sub>
43 @end html
44
45 @end macro
46 @end ifhtml
47
48 @ifdocbook
49 @macro sub{arg}
50 @docbook
51 @<subscript>\arg\</subscript>
52 @end docbook
53 @end macro
54 @end ifdocbook
55
56 @c @iftex
57 @c @macro sub{arg}
58 @c @textsubscript{\arg\}
59 @c @end macro
60 @c @end iftex
61
62 @quotation
63 @strong{Note} This discussion is about Kerberos version 4, but version
64 5 works similarly.
65 @end quotation
66
67 In Kerberos, principals use @dfn{tickets} to prove that they are who
68 they claim to be. In the following example, @var{A} is the initiator of
69 the authentication exchange, usually a user, and @var{B} is the service
70 that @var{A} wishes to use.
71
72 To obtain a ticket for a specific service, @var{A} sends a ticket
73 request to the kerberos server. The request contains @var{A}'s and
74 @var{B}'s names (along with some other fields). The kerberos server
75 checks that both @var{A} and @var{B} are valid principals.
76
77 Having verified the validity of the principals, it creates a packet
78 containing @var{A}'s and @var{B}'s names, @var{A}'s network address
79 (@var{A@sub{addr}}), the current time (@var{t@sub{issue}}), the lifetime
80 of the ticket (@var{life}), and a secret @dfn{session key}
81 @cindex session key
82 (@var{K@sub{AB}}). This packet is encrypted with @var{B}'s secret key
83 (@var{K@sub{B}}).  The actual ticket (@var{T@sub{AB}}) looks like this:
84 (@{@var{A}, @var{B}, @var{A@sub{addr}}, @var{t@sub{issue}}, @var{life},
85 @var{K@sub{AB}}@}@var{K@sub{B}}).
86
87 The reply to @var{A} consists of the ticket (@var{T@sub{AB}}), @var{B}'s
88 name, the current time, the lifetime of the ticket, and the session key, all
89 encrypted in @var{A}'s secret key (@{@var{B}, @var{t@sub{issue}},
90 @var{life}, @var{K@sub{AB}}, @var{T@sub{AB}}@}@var{K@sub{A}}). @var{A}
91 decrypts the reply and retains it for later use.
92
93 @sp 1
94
95 Before sending a message to @var{B}, @var{A} creates an authenticator
96 consisting of @var{A}'s name, @var{A}'s address, the current time, and a
97 ``checksum'' chosen by @var{A}, all encrypted with the secret session
98 key (@{@var{A}, @var{A@sub{addr}}, @var{t@sub{current}},
99 @var{checksum}@}@var{K@sub{AB}}). This is sent together with the ticket
100 received from the kerberos server to @var{B}.  Upon reception, @var{B}
101 decrypts the ticket using @var{B}'s secret key.  Since the ticket
102 contains the session key that the authenticator was encrypted with,
103 @var{B} can now also decrypt the authenticator. To verify that @var{A}
104 really is @var{A}, @var{B} now has to compare the contents of the ticket
105 with that of the authenticator. If everything matches, @var{B} now
106 considers @var{A} as properly authenticated.
107
108 @c (here we should have some more explanations)
109
110 @section Different attacks
111
112 @subheading Impersonating A
113
114 An impostor, @var{C} could steal the authenticator and the ticket as it
115 is transmitted across the network, and use them to impersonate
116 @var{A}. The address in the ticket and the authenticator was added to
117 make it more difficult to perform this attack.  To succeed @var{C} will
118 have to either use the same machine as @var{A} or fake the source
119 addresses of the packets. By including the time stamp in the
120 authenticator, @var{C} does not have much time in which to mount the
121 attack.
122
123 @subheading Impersonating B
124
125 @var{C} can hijack @var{B}'s network address, and when @var{A} sends
126 her credentials, @var{C} just pretend to verify them. @var{C} can't
127 be sure that she is talking to @var{A}.
128
129 @section Defence strategies
130
131 It would be possible to add a @dfn{replay cache}
132 @cindex replay cache
133 to the server side.  The idea is to save the authenticators sent during
134 the last few minutes, so that @var{B} can detect when someone is trying
135 to retransmit an already used message. This is somewhat impractical
136 (mostly regarding performance); MIT Kerberos 5 has a replay cache,
137 while Heimdal does not.
138
139 However, most GSS-API applicatons do not need a replay cache at all.
140
141 To authenticate @var{B}, @var{A} might request that @var{B} sends
142 something back that proves that @var{B} has access to the session
143 key. An example of this is the checksum that @var{A} sent as part of the
144 authenticator. One typical procedure is to add one to the checksum,
145 encrypt it with the session key and send it back to @var{A}.  This is
146 called @dfn{mutual authentication}.
147
148 The session key can also be used to add cryptographic checksums to the
149 messages sent between @var{A} and @var{B} (known as @dfn{message
150 integrity}).  Encryption can also be added (@dfn{message
151 confidentiality}). This is probably the best approach in all cases.
152 @cindex integrity
153 @cindex confidentiality
154
155 @section Further reading
156
157 The original paper on Kerberos from 1988 is @cite{Kerberos: An
158 Authentication Service for Open Network Systems}, by Jennifer Steiner,
159 Clifford Neuman and Jeffrey I. Schiller.
160
161 A less technical description can be found in @cite{Designing an
162 Authentication System: a Dialogue in Four Scenes} by Bill Bryant, also
163 from 1988.
164
165 These documents can be found on our web-page at
166 @url{http://www.pdc.kth.se/kth-krb/}.
167
168 @node What is PKIX?, What is a Certification Authority (CA)?, What is Kerberos?, Top
169 @chapter What is PKIX?
170
171 PKIX is the set of Internet standards for Public Key Infrastructure (PKI),
172 based on the ITU-T's x.509 standads.  PKI is an authentication mechanism based
173 on public keys (the 'PK' in 'PKI').
174
175 In PKIX we have public keys "certified" by certification authorities (CAs).  A
176 "relying party" is software that validates an entity's certificate and, if
177 valid, trusts the certified public key to "speak for" the entity identified by
178 the certificate.
179
180 In a PKI every entity has one (or more) certified public/private key pairs.
181
182 @node What is a Certification Authority (CA)?, What is kx509?, What is PKIX?, Top
183 @chapter What is a Certification Authority (CA)?
184
185 A Certification Authority (CA) is an entity in a PKI that issues certificates
186 to other entities -- a CA certifies that a public key speaks for a particular,
187 named entity.
188
189 There are two types of CAs: off-line and online.  Typically PKI hierarchies are
190 organized such that the most security-critical private keys are only used by
191 off-line CAs to certify the less security-critical public keys of online CAs.
192
193 Heimdal has support for off-line CAs using its Hx509 library and hxtool
194 command.
195
196 Heimdal also has an online CA with a RESTful, HTTPS-based protocol.
197
198 @node What is kx509?, What is bx509?, What is a Certification Authority (CA)?, Top
199 @chapter What is kx509?
200
201 kx509 is a kerberized certification authority (CA).  Heimdal implements this
202 protocol in its KDC.  The protocol is specified by <a
203 href="http://www.ietf.org/rfc/rfc6717.txt">RFC 6717</a>, though Heimdal has
204 implemented a number of extensions as well.  A client is implemented by the
205 heimtools command's kx509 sub-command.
206
207 @node What is bx509?, Building and Installing, What is kx509?, Top
208 @chapter What is kx509?
209
210 bx509 is an online CA, like kx509, but the protocol is based on HTTPS.
211
212 Heimdal's bx509d implementation of bx509 implements two authentication bridges:
213 a "/bx509" end-point that allows clients to trade bearer tokens (including
214 Negotiate/Kerberos) and CSRs for certificates, and a "/bnegotiate" end-point
215 allowing clients to trade bearer tokens (including Negotiate/Kerberos) for
216 Negotiate tokens to HTTP servers.