Книга: Distributed operating systems
10.6.4. Authenticated RPC
10.6.4. Authenticated RPC
The sequence from logging in to the point where the first authenticated RPC is possible typically requires five steps. Each step consists of a message from the client to some server, followed by a reply back from the server to the client. The steps are summarized in Fig. 10-27 and are described below. For simplicity, most of the fields, including the cells, message IDs, lifetimes, and identifiers have been omitted. The emphasis is on the security fundamentals: keys, tickets, authenticators, and PACs.
Principals
A: Authentication server (handles authentication)
C: Client (user)
P: Privilege server (issues PACs)
S: Application server (does the real work)
T: Ticket-granting server (issues tickets)
Step 1: client gets a ticket for the ticket-granting server using a password
C?A: C (just the client's name, in plaintext)
C?A: {K1, {K1, C}KA}}KC
Step 2: client uses the previous ticket to get a ticket for the privilege server
C?T: {K1, C}KA, {C, MD-5 checksum, Timestamp}K1
C?T: {K2,{C, K2}KP}K,
Step 3: client asks the privilege server for the initial PAC
C?P: {C, K2}KP, {C, MD-5 checksum, Timestamp}K2
C?P: {K3,{PAC, K3}KA}K2
Step 4: client asks the ticket-granting server for a PAC usable by S
C?T: {K3,{PAC, K3}KA}K3, {C, MD-5 checksum, Timestamp}K3
C?T: {K4,{PAC, K4}KS}K3
Step 5: client establishes a key with the application server
C?S: {PAC, K4}KS,{C, MD-5checksum, Timestamp}K4
C?S: {K5, Timestamp}K4
Fig. 10-27. From login to authenticated RPC in five easy steps.
When a user sits down at a DCE terminal, the login program asks for his login name. The program then sends this login name to the authentication server in plaintext. The authentication server looks it up in the registry and finds the user's secret key. It then generates a random number for use as a session key and sends back a message encrypted by the user's secret key, KC, containing the first session key, K1, and a ticket good for later use with the ticket-granting server. These messages are shown in Fig. 10-27 in step 1. Note that this figure shows 10 messages, and for each the source and destination are given before the message, with the arrow pointing from the source to the destination.
When the encrypted message arrives at the login program, the user is prompted for his password. The password is immediately run through the oneway function that generates secret keys from passwords. As soon as the secret key, KC has been generated from the password, the password is removed from memory. This procedure minimizes the chance of password disclosure in the event of a client crash. Then the message from the authentication server is decrypted to get the session key and the ticket. When that has been done, the client's secret key can also be erased from memory.
Note that if an intruder intercepts the reply message, it will be unable to decrypt it and thus unable to obtain the session key and ticket inside it. If it spends enough time, the intruder might eventually be able to break the message, but even then the damage will be limited because session keys and tickets are valid only for relatively short periods of time.
In step 2 of Fig. 10-27, the client sends the ticket to the ticket-granting server (in fact, the authentication server under a different name) and asks for a ticket to talk to the privilege server. Except for the initial authentication in step 1, talking to a server in an authenticated way always requires a ticket encrypted with that server's private key. These tickets can be obtained from the ticket-granting server as in step 2.
When the ticket-granting server gets the message, it uses its own private key, KAto decrypt the message. When it finds the session key, K1, it looks in the registry and verifies that it recently assigned this key to client C. Since only C knows KC, the ticket-granting server knows that only C was able to decrypt the reply sent in step 1, and this request must have come from C.
The request also contains an authenticator, basically, a timestamped crypto-graphically strong checksum of the rest of the message, including the cell name, request, and other fields not shown in the figure. This scheme makes it impossible for an intruder to modify the message without detection, yet does not require the client to encrypt the entire message, which would be expensive for a long message. (In this case the message is not so long, but authenticators are used all the time, for simplicity.) The timestamp in the authenticator guards against an intruder capturing the message and playing in back later because the authentication server will process a request only if it is accompanied by a fresh authenticator.
In this example, we generate and use a new session key at each step. This much paranoia is not required, but the protocol allows it and doing so allows very short lifetimes for each key if the clocks are well synchronized.
Armed with a ticket for the privilege server, the client now asks for a PAC. Unlike a ticket, which contains only the user's login name (in ASCII), a PAC contains the user's identity (in binary as a UUID) plus a list of all the groups to which he belongs. These are important because resources (e.g., a certain printer) are often available to all the members of certain groups (e.g., the marketing department). A PAC is proof that the user named in it belongs to the groups listed in it.
The PAC obtained in step 3 is encrypted with the authentication server/ticket-granting server's secret key. The importance of this choice is that throughout the session, the client may need PACs for several application servers. To get a PAC for use with an application server, the client executes step 4. Here the PAC is sent to the ticket-granting server, which first decrypts it. Since the decryption works, the ticket-granting server is immediately convinced that the PAC is legitimate, and then it reencrypts it for the client's choice of server, in this case, S.
Note that the ticket-granting server does not have to understand the format of a PAC. All it is doing in step 4 is decrypting something encrypted with its own key and then reencrypting it with another key it gets from the registry. While it is at it, the ticket-granting server throws in a new session key, but this action is optional. If the client needs PACs for other servers later, it repeats step 4 with the original PAC as often as needed, specifying the desired server each time.
In step 5, the client sends the new PAC to the application server, which decrypts it, exposing key K4 used to encrypt the authenticator as well as the client's ID and groups. The server responds with the last key, known only to the client and server. Using this key, the client and server can now communicate securely.
This protocol is complicated, but the complexity is due to the fact that it has been designed to be resistant to a large variety of possible attacks (Bellovin and Merritt, 1991). It also has many features and options that we have not discussed. For example, it can be used to establish secure communication with a server in a distant cell, possibly transiting several potentially untrustworthy cells on every RPC, and can verify the server to the client to prevent spoofing (an intruder masquerading as a trusted server).
Once authenticated RPC has been established, it is up to the client and server to determine how much protection is desired. In some cases client authentication or mutual authentication is enough. In others, every packet is authenticated against tampering. Finally, when industrial-strength security is required, all traffic in both directions can be encrypted.
- 15.10 Пример сообщении RPC версии 2
- Choosing an Authenticated or Anonymous Server
- 15.7.1 Назначение rpcbind
- PowerPC-Based Linux Distributions
- 3.2.1. PowerPC
- 3.2.2. AMCC PowerPC
- 3.2.3. Freescale PowerPC
- 2.4.1. Basic RPC Operation
- 2.4.4. RPC Semantics in the Presence of Failures
- 10.3.1. Goals of DCE RPC
- 10.3.4. Performing an RPC
- 15.3 Программы и процедуры RPC