Kerberos PDF
Kerberos PDF
Kerberos PDF
Jennifer G. Steiner
Project Athena
Massachusetts Institute of Technology
Cambridge, MA 02139
[email protected]
Clifford Neuman†
Jeffrey I. Schiller
Project Athena
Massachusetts Institute of Technology
Cambridge, MA 02139
[email protected]
† Clifford Neuman was a member of the Project Athena staff during the design and initial implementation phase of Ker-
beros.
-2-
the current status of Kerberos at Project Athena. machine. However, there is always only one
In the appendix, we describe in detail how Ker- definitive copy of the Kerberos database. The
beros is applied to a network file service to machine which houses this database is called the
authenticate users who wish to gain access to master machine, or just the master. Other
remote file systems. machines may possess read-only copies of the
Conventions. Throughout this paper we Kerberos database, and these are called slaves.
use terms that may be ambiguous, new to the
reader, or used differently elsewhere. Below we 1. Motivation
state our use of those terms. In a non-networked personal computing
User, Client, Server. By user, we mean a environment, resources and information can be
human being who uses a program or service. A protected by physically securing the personal
client also uses something, but is not necessarily computer. In a timesharing computing environ-
a person; it can be a program. Often network ment, the operating system protects users from
applications consist of two parts; one program one another and controls resources. In order to
which runs on one machine and requests a remote determine what each user is able to read or
service, and another program which runs on the modify, it is necessary for the timesharing system
remote machine and performs that service. We to identify each user. This is accomplished when
call those the client side and server side of the the user logs in.
application, respectively. Often, a client will In a network of users requiring services
contact a server on behalf of a user. from many separate computers, there are three
Each entity that uses the Kerberos system, approaches one can take to access control: One
be it a user or a network server, is in one sense a can do nothing, relying on the machine to which
client, since it uses the Kerberos service. So to the user is logged in to prevent unauthorized
distinguish Kerberos clients from clients of other access; one can require the host to prove its iden-
services, we use the term principal to indicate tity, but trust the host’s word as to who the user
such an entity. Note that a Kerberos principal is; or one can require the user to prove her/his
can be either a user or a server. (We describe the identity for each required service.
naming of Kerberos principals in a later section.) In a closed environment where all the
Service vs. Server. We use service as an machines are under strict control, one can use the
abstract specification of some actions to be per- first approach. When the organization controls
formed. A process which performs those actions all the hosts communicating over the network,
is called a server . At a given time, there may be this is a reasonable approach.
several servers (usually running on different In a more open environment, one might
machines) performing a given service . For exam- selectively trust only those hosts under organiza-
ple, at Athena there is one BSD UNIX rlogin tional control. In this case, each host must be
server running on each of our timesharing required to prove its identity. The rlogin and rsh
machines. programs use this approach. In those protocols,
Key, Private Key, Password. Kerberos authentication is done by checking the Internet
uses private key encryption. Each Kerberos prin- address from which a connection has been esta-
cipal is assigned a large number, its private key, blished.
known only to that principal and Kerberos. In In the Athena environment, we must be
the case of a user, the private key is the result of a able to honor requests from hosts that are not
one-way function applied to the user’s password. under organizational control. Users have com-
We use key as shorthand for private key . plete control of their workstations: they can
Credentials. Unfortunately, this word has a reboot them, bring them up standalone, or even
special meaning for both the Sun Network File boot off their own tapes. As such, the third
System and the Kerberos system. We explicitly approach must be taken; the user must prove
state whether we mean NFS credentials or Ker- her/his identity for each desired service. The
beros credentials, otherwise the term is used in server must also prove its identity. It is not suffi-
the normal English language sense. cient to physically secure the host running a net-
work server; someone elsewhere on the network
Master and Slave. It is possible to run Ker-
may be masquerading as the given server.
beros authentication software on more than one
Our environment places several
-3-
-4-
Kerberos applications library the database. The client side of the program may
encryption library be run on any machine on the network. The
database library server side, however, must run on the machine
database administration programs housing the Kerberos database in order to make
administration server changes to the database.
authentication server The authentication server (or Kerberos
db propagation software server), on the other hand, performs read-only
user programs operations on the Kerberos database, namely, the
applications authentication of principals, and generation of
Figure 1. Kerberos Software Components. session keys. Since this server does not modify
the Kerberos database, it may run on a machine
housing a read-only copy of the master Kerberos
Encryption in Kerberos is based on DES,
database.
the Data Encryption Standard.5 The encryption
library implements those routines. Several Database propagation software manages
methods of encryption are provided, with trade- replication of the Kerberos database. It is possi-
offs between speed and security. An extension to ble to have copies of the database on several dif-
the DES Cypher Block Chaining (CBC) mode, ferent machines, with a copy of the authentication
called the Propagating CBC mode, is also pro- server running on each machine. Each of these
vided. In CBC, an error is propagated only slave machines receives an update of the Ker-
through the current block of the cipher, whereas beros database from the master machine at given
in PCBC, the error is propagated throughout the intervals.
message. This renders the entire message useless Finally, there are end-user programs for
if an error occurs, rather than just a portion of it. logging in to Kerberos, changing a Kerberos
The encryption library is an independent module, password, and displaying or destroying Kerberos
and may be replaced with other DES implementa- tickets (tickets are explained later on).
tions or a different encryption library.
Another replaceable module is the database 3. Kerberos Names
management system. The current Athena imple- Part of authenticating an entity is naming it.
mentation of the database library uses ndbm, The process of authentication is the verification
although Ingres was originally used. Other data- that the client is the one named in a request.
base management libraries could be used as well. What does a name consist of? In Kerberos, both
The Kerberos database needs are straight- users and servers are named. As far as the
forward; a record is held for each principal, con- authentication server is concerned, they are
taining the name, private key, and expiration date equivalent. A name consists of a primary name,
of the principal, along with some administrative an instance, and a realm, expressed as
information. (The expiration date is the date after name.instance@realm (see Figure 2).
which an entry is no longer valid. It is usually set
to a few years into the future at registration.) bcn
Other user information, such as real name, treese.root
phone number, and so forth, is kept by another [email protected]
server, the Hesiod nameserver.6 This way, sensi- [email protected]
tive information, namely passwords, can be han-
dled by Kerberos, using fairly high security Figure 2. Kerberos Names.
measures; while the non-sensitive information
kept by Hesiod is dealt with differently; it can, The primary name is the name of the user
for example, be sent unencrypted over the net- or the service. The instance is used to distinguish
work. among variations on the primary name. For
users, an instance may entail special privileges,
The Kerberos servers use the database
such as the ‘‘root’’ or ‘‘admin’’ instances. For
library, as do the tools for administering the data-
services in the Athena environment, the instance
base.
is usually the name of the machine on which the
The administration server (or KDBM server runs. For example, the rlogin service has
server) provides a read-write network interface to different instances on different hosts:
-5-
rlogin.priam is the rlogin server on the host server. A ticket also passes information that can
named priam. A Kerberos ticket is only good for be used to make sure that the person using the
a single named server. As such, a separate ticket ticket is the same person to which it was issued.
is required to gain access to different instances of The authenticator contains the additional informa-
the same service. The realm is the name of an tion which, when compared against that in the
administrative entity that maintains authentication ticket proves that the client presenting the ticket is
data. For example, different institutions may the same one to which the ticket was issued.
each have their own Kerberos machine, housing a A ticket is good for a single server and a
different database. They have different Kerberos single client. It contains the name of the server,
realms. (Realms are discussed further in section the name of the client, the Internet address of the
8.2.) client, a timestamp, a lifetime, and a random ses-
sion key. This information is encrypted using the
4. How It Works key of the server for which the ticket will be used.
This section describes the Kerberos authen- Once the ticket has been issued, it may be used
tication protocols. The following abbreviations multiple times by the named client to gain access
are used in the figures. to the named server, until the ticket expires. Note
that because the ticket is encrypted in the key of
c -> client the server, it is safe to allow the user to pass the
s -> server ticket on to the server without having to worry
addr -> client’s network address about the user modifying the ticket (see Figure 3).
life -> lifetime of ticket
tgs, TGS -> ticket-granting server
{s, c, addr, timestamp, life, Ks,c}Ks
Kerberos -> authentication server
KDBM -> administration server
Figure 3. A Kerberos Ticket.
Kx -> x’s private key
Kx,y -> session key for x and y Unlike the ticket, the authenticator can only
{abc}Kx -> abc encrypted in x’s key be used once. A new one must be generated each
Tx,y -> x’s ticket to use y time a client wants to use a service. This does not
Ax -> authenticator for x present a problem because the client is able to
WS -> workstation build the authenticator itself. An authenticator
contains the name of the client, the workstation’s
IP address, and the current workstation time. The
As mentioned above, the Kerberos authentication authenticator is encrypted in the session key that
model is based on the Needham and Schroeder is part of the ticket (see Figure 4).
key distribution protocol. When a user requests a
service, her/his identity must be established. To
do this, a ticket is presented to the server, along {c, addr, timestamp}Ks,c
with proof that the ticket was originally issued to
the user, not stolen. There are three phases to Figure 4. A Kerberos Authenticator.
authentication through Kerberos. In the first
phase, the user obtains credentials to be used to 4.2. Getting the Initial Ticket
request access to other services. In the second
When the user walks up to a workstation,
phase, the user requests authentication for a
only one piece of information can prove her/his
specific service. In the final phase, the user
identity: the user’s password. The initial
presents those credentials to the end server.
exchange with the authentication server is
designed to minimize the chance that the pass-
4.1. Credentials
word will be compromised, while at the same
There are two types of credentials used in time not allowing a user to properly authenticate
the Kerberos authentication model: tickets and her/himself without knowledge of that password.
authenticators. Both are based on private key The process of logging in appears to the user to
encryption, but they are encrypted using different be the same as logging in to a timesharing system.
keys. A ticket is used to securely pass the iden- Behind the scenes, though, it is quite different
tity of the person to whom the ticket was issued (see Figure 5).
between the authentication server and the end
-6-
-7-
WS WS WS
Client TGS
{{Tc,s}Ks,Kc,s}Kc,tgs
-8-
-9-
advantages of having multiple copies of the data- 6. Kerberos From the Outside Looking In
base are those usually cited for replication: The section will describe Kerberos from
higher availability and better performance. If the the practical point of view, first as seen by the
master machine is down, authentication can still user, then from the application programmer’s
be achieved on one of the slave machines. The viewpoint, and finally, through the tasks of the
ability to perform authentication on any one of Kerberos administrator.
several machines reduces the probability of a
bottleneck at the master machine. 6.1. User’s Eye View
Keeping multiple copies of the database If all goes well, the user will hardly notice
introduces the problem of data consistency. We that Kerberos is present. In our UNIX implemen-
have found that very simple methods suffice for tation, the ticket-granting ticket is obtained from
dealing with inconsistency. The master database Kerberos as part of the login process. The
is dumped every hour. The database is sent, in its changing of a user’s Kerberos password is part of
entirety, to the slave machines, which then update the passwd program. And Kerberos tickets are
their own databases. A program on the master automatically destroyed when a user logs out.
host, called kprop, sends the update to a peer pro-
gram, called kpropd, running on each of the slave If the user’s login session lasts longer than
machines (see Figure 13). First kprop sends a the lifetime of the ticket-granting ticket (currently
checksum of the new database it is about to send. 8 hours), the user will notice Kerberos’ presence
The checksum is encrypted in the Kerberos mas- because the next time a Kerberos-authenticated
ter database key, which both the master and slave application is executed, it will fail. The Kerberos
Kerberos machines possess. The data is then ticket for it will have expired. At that point, the
transferred over the network to the kpropd on the user can run the kinit program to obtain a new
slave machine. The slave propagation server cal- ticket for the ticket-granting server. As when log-
culates a checksum of the data it has received, ging in, a password must be provided in order to
and if it matches the checksum sent by the master, get it. A user executing the klist command out of
the new information is used to update the slave’s curiosity may be surprised at all the tickets which
database. have silently been obtained on her/his behalf for
services which require Kerberos authentication.
Master
6.2. From the Programmer’s Viewpoint
A programmer writing a Kerberos applica-
kprop tion will often be adding authentication to an
already existing network application consisting of
a client and server side. We call this process
‘‘Kerberizing’’ a program. Kerberizing usually
kpropd kpropd kpropd involves making a call to the Kerberos library in
order to perform authentication at the initial
request for service. It may also involve calls to
Slave Slave Slave
the DES library to encrypt messages and data
which are subsequently sent between application
Figure 13. Database Propagation. client and application server.
The most commonly used library functions
All passwords in the Kerberos database are
are krb_mk_req on the client side, and
encrypted in the master database key Therefore,
krb_rd_req on the server side. The krb_mk_req
the information passed from master to slave over
routine takes as parameters the name, instance,
the network is not useful to an eavesdropper.
and realm of the target server, which will be
However, it is essential that only information
requested, and possibly a checksum of the data to
from the master host be accepted by the slaves,
be sent. The client then sends the message
and that tampering of data be detected, thus the
returned by the krb_mk_req call over the network
checksum.
to the server side of the application. When the
server receives this message, it makes a call to the
library routine krb_rd_req. The routine returns a
judgement about the authenticity of the sender’s
- 10 -
- 11 -
credentials, depending on the degree of security acquire other network services on her/his behalf?
required and the level of trust in the realm that An example where this would be important is the
initially authenticated the user. use of a service that will gain access to protected
In order to perform cross-realm authentica- files directly from a fileserver. Another example
tion, it is necessary that the administrators of each of this problem is what we call authentication for-
pair of realms select a key to be shared between warding. If a user is logged into a workstation
their realms. A user in the local realm can then and logs in to a remote host, it would be nice if
request a ticket-granting ticket from the local the user had access to the same services available
authentication server for the ticket-granting server locally, while running a program on the remote
in the remote realm. When that ticket is used, the host. What makes this difficult is that the user
remote ticket-granting server recognizes that the might not trust the remote host, thus authentica-
request is not from its own realm, and it uses the tion forwarding is not desirable in all cases. We
previously exchanged key to decrypt the ticket- do not presently have a solution to this problem.
granting ticket. It then issues a ticket as it nor- Another problem, and one that is important
mally would, except that the realm field for the in the Athena environment, is how to guarantee
client contains the name of the realm in which the the integrity of the software running on a work-
client was originally authenticated. station. This is not so much of a problem on
This approach could be extended to allow private workstations since the user that will be
one to authenticate oneself through a series of using it has control over it. On public work-
realms until reaching the realm with the desired stations, however, someone might have come
service. In order to do this, though, it would be along and modified the login program to save the
necessary to record the entire path that was taken, user’s password. The only solution presently
and not just the name of the initial realm in which available in our environment is to make it diffi-
the user was authenticated. In such a situation, all cult for people to modify software running on the
that is known by the server is that A says that B public workstations. A better solution would
says that C says that the user is so-and-so. This require that the user’s key never leave a system
statement can only be trusted if everyone along that the user knows can be trusted. One way this
the path is also trusted. could be done would be if the user possessed a
smartcard capable of doing the encryptions
8. Issues and Open Problems required in the authentication protocol.
There are a number of issues and open
9. Status
problems associated with the Kerberos authenti-
cation mechanism. Among the issues are how to A prototype version of Kerberos went into
decide the correct lifetime for a ticket, how to production in September of 1986. Since January
allow proxies, and how to guarantee workstation of 1987, Kerberos has been Project Athena’s sole
integrity. means of authenticating its 5,000 users, 650
workstations, and 65 servers. In addition, Ker-
The ticket lifetime problem is a matter of
beros is now being used in place of .rhosts files
choosing the proper tradeoff between security and
for controlling access in several of Athena’s
convenience. If the life of a ticket is long, then if
timesharing systems.
a ticket and its associated session key are stolen
or misplaced, they can be used for a longer period
10. Acknowledgements
of time. Such information can be stolen if a user
forgets to log out of a public workstation. Alter- Kerberos was initially designed by Steve
natively, if a user has been authenticated on a sys- Miller and Clifford Neuman with suggestions
tem that allows multiple users, another user with from Jeff Schiller and Jerry Saltzer. Since that
access to root might be able to find the informa- time, numerous other people have been involved
tion needed to use stolen tickets. The problem with the project. Among them are Jim Aspnes,
with giving a ticket a short lifetime, however, is Bob Baldwin, John Barba, Richard Basch, Jim
that when it expires, the user will have to obtain a Bloom, Bill Bryant, Mark Colan, Rob French,
new one which requires the user to enter the pass- Dan Geer, John Kohl, John Kubiatowicz, Bob
word again. Mckie, Brian Murphy, John Ostlund Ken Rae-
burn, Chris Reed, Jon Rochlis, Mike Shanzer, Bill
An open problem is the proxy problem.
Sommerfeld, Ted T’so, Win Treese, and Stan
How can an authenticated user allow a server to
Zanarotti.
- 12 -
- 13 -
Appendix
A key component of the Project Athena truly unfriendly user can break in by the very fact
workstation system is the interposing of the net- that s/he is sitting in the same physical location as
work between the user’s workstation and her/his the machine and has access to all console func-
private file storage (home directory). All private tions. Therefore we cannot truly trust our work-
storage resides on a set of computers (currently stations in the NFS interpretation of trust. To
VAX 11/750s) that are dedicated to this purpose. allow proper access controls in our environment
This allows us to offer services on publicly avail- we had to make some modifications to the base
able UNIX workstations. When a user logs in to NFS software, and integrate Kerberos into the
one of these publicly available workstations, scheme.
rather then validate her/his name and password
against a locally resident password file, we use Unmodified NFS
Kerberos to determine her/his authenticity. The In the implementation of NFS that we
login program prompts for a username (as on any started with (from the University of Wisconsin),
UNIX system). This username is used to fetch a authentication was provided in the form of a
Kerberos ticket-granting ticket. The login pro- piece of data included in each NFS request
gram uses the password to generate a DES key (called a ‘‘credential’’ in NFS terminology). This
for decrypting the ticket. If decryption is success- credential contains information about the unique
ful, the user’s home directory is located by con- user identifier (UID) of the requester and a list of
sulting the Hesiod naming service and mounted the group identifiers (GIDs) of the requester’s
through NFS. The login program then turns con- membership. This information is then used by the
trol over to the user’s shell, which then can run NFS server for access checking. The difference
the traditional per-user customization files between a trusted and a non-trusted workstation is
because the home directory is now ‘‘attached’’ to whether or not its credentials are accepted by the
the workstation. The Hesiod service is also used NFS server.12
to construct an entry in the local password file.
(This is for the benefit of programs that look up Modified NFS
information in /etc/passwd.)
In our environment, NFS servers must
From several options for delivery of remote accept credentials from a workstation if and only
file service, we chose SUN’s Network File Sys- if the credentials indicate the UID of the
tem. However this system fails to mesh with our workstation’s user, and no other.
needs in a crucial way. NFS assumes that all
One obvious solution would be to change
workstations fall into two categories (as viewed
the nature of credentials from mere indicators of
from a file server’s point of view): trusted and
UID and GIDs to full blown Kerberos authenti-
untrusted. Untrusted systems cannot access any
cated data. However a significant performance
files at all, trusted can. Trusted systems are com-
penalty would be paid if this solution were
pletely trusted. It is assumed that a trusted system
adopted. Credentials are exchanged on every
is managed by friendly management. Specifi-
NFS operation including all disk read and write
cally, it is possible from a trusted workstation to
activities. Including a Kerberos authentication on
masquerade as any valid user of the file service
each disk transaction would add a fair number of
system and thus gain access to just about every
full-blown encryptions (done in software) per
file on the system. (Only files owned by ‘‘root’’
transaction and, according to our envelope calcu-
are exempted.)
lations, would have delivered unacceptable per-
In our environment, the management of a formance. (It would also have required placing
workstation (in the traditional sense of UNIX sys- the Kerberos library routines in the kernel
tem management) is in the hands of the user address space.)
currently using it. We make no secret of the root
We needed a hybrid approach, described
password on our workstations, as we realize that a
below. The basic idea is to have the NFS server
- 14 -
map credentials received from client work- to the kernel as the valid mapping of the
stations, to a valid (and possibly different) <CLIENT−IP−ADDRESS, CLIENT−UID> tuple
credential on the server system. This mapping is for this request.
performed in the server’s kernel on each NFS At unmount time a request is sent to the
transaction and is setup at ‘‘mount’’ time by a mount daemon to remove the previously added
user-level process that engages in Kerberos- mapping from the kernel. It is also possible to
moderated authentication prior to establishing a send a request at logout time to invalidate all
valid kernel credential mapping. mapping for the current user on the server in
To implement this we added a new system question, thus cleaning up any remaining map-
call to the kernel (required only on server sys- pings that exist (though they shouldn’t) before the
tems, not on client systems) that provides for the workstation is made available for the next user.
control of the mapping function that maps incom-
ing credentials from client workstations to Security Implications of the Modified NFS
credentials valid for use on the server (if any). This implementation is not completely
The basic mapping function maps the tuple: secure. For starters, user data is still sent across
<CLIENT−IP−ADDRESS, UID−ON−CLIENT> the network in an unencrypted, and therefore
interceptable, form. The low-level, per-
to a valid NFS credential on the server system. transaction authentication is based on a
The CLIENT−IP−ADDRESS is extracted from <CLIENT−IP−ADDRESS, CLIENT−UID> pair
the NFS request packet and the provided unencrypted in the request packet. This
UID−ON−CLIENT is extracted from the creden- information could be forged and thus security
tial supplied by the client system. Note: all infor- compromised. However, it should be noted that
mation in the client-generated credential except only while a user is actively using her/his files
the UID−ON−CLIENT is discarded. (i.e., while logged in) are valid mappings in place
If no mapping exists, the server reacts in and therefore this form of attack is limited to
one of two ways, depending it is configured. In when the user in question is logged in. When a
our friendly configuration we default the unmap- user is not logged in, no amount of IP address for-
pable requests into the credentials for the user gery will permit unauthorized access to her/his
‘‘nobody’’ who has no privileged access and has files.
a unique UID. Unfriendly servers return an NFS
access error when no valid mapping can be found References
for an incoming NFS credential.
Our new system call is used to add and 1. S. P. Miller, B. C. Neuman, J. I. Schiller,
delete entries from the kernel resident map. It and J. H. Saltzer, Section E.2.1: Kerberos
also provides the ability to flush all entries that Authentication and Authorization System,
map to a specific UID on the server system, or M.I.T. Project Athena, Cambridge, Mas-
flush all entries from a given sachusetts (December 21, 1987).
CLIENT−IP−ADDRESS.
2. E. Balkovich, S. R. Lerman, and R. P. Par-
We modified the mount daemon (which melee, ‘‘Computing in Higher Education:
handles NFS mount requests on server systems) The Athena Experience,’’ Communications
to accept a new transaction type, the Kerberos of the ACM 28(11), pp. 1214-1224, ACM
authentication mapping request. Basically, as (November, 1985).
part of the mounting process, the client system
provides a Kerberos authenticator along with an 3. R. M. Needham and M. D. Schroeder,
indication of her/his UID−ON−CLIENT ‘‘Using Encryption for Authentication in
(encrypted in the Kerberos authenticator) on the Large Networks of Computers,’’ Communi-
workstation. The server’s mount daemon con- cations of the ACM 21(12), pp. 993-999
verts the Kerberos principal name into a local (December, 1978).
username. This username is then looked up in a 4. V. L. Voydock and S. T. Kent, ‘‘Security
special file to yield the user’s UID and GIDs list. Mechanisms in High-Level Network Proto-
For efficiency, this file is a ndbm database file cols,’’ Computing Surveys 15(2), ACM
with the username as the key. From this informa- (June 1983).
tion, an NFS credential is constructed and handed 5. National Bureau of Standards, ‘‘Data
- 15 -