COEN 350 Kerberos Kerberos n n Provide authentication
COEN 350 Kerberos
Kerberos n n Provide authentication for a user that works on a workstation. Uses secret key technology n n n Because public key technology still had patent projection. Implements authentication by Needham & Schroeder. On the market in versions 4 and 5.
Kerberos n Kerberos consists of n Key Distribution Center (KDC) n n Runs on a physically secure node Library of Subroutines n Modifies known UNIX libraries such as telnet, rlogin, …
Key Distribution Center n KDC: n Alice Database of keys for all users Alice KAlice{wants KAB for. Bob } n KDC KBob{KAB for Alice} Invents and hands out keys for each transaction between clients. Bob
Key Distribution Center n Message from KDC to Bob has some problems. n n Timing problem: Alice needs to wait to make sure that Bob got the key. Change the protocol so that Alice receives a ticket to talk to Bob.
Key Distribution Center Alice KDC KI’m {Use Kmy Bob} Alice wants AB for Bob Alice, ticket is KBob{Use KAB for Alice}for Bob : = Ticket KBob{Use KAB for Alice} Bob
Key Distribution Center n Needham Schroeder: n n Combines KDC operation with authentication. Uses nonces instead of timestamps to prevent replay attacks. n A (sequential / random) number used only once.
Needham Schroeder Alice N 1, Alice, Bob KDC Bob KAlice{N 1, Bob, KAB, ticket to Bob} Ticket, KAB{N 2} KAB{N 2 -1, N 3} KAB{N 3 -1} Ticket = KBob{KAB, Alice}
Needham Schroeder Alice N 1, Alice, Bob Trudy KDC (KDC) Bob as Bob Trudy KAlice{N 1, Bob, KAB, ticket to Bob} Ticket = KBob{KAB, Alice}, … But the nonces make all messages unique! Trudy can successfully authenticate herself to Trudy impersonates KDC replays Trudywaits now until incorporates Alicethe makes Bob. aand request to the old KDC. Purpose of now the nonce is the following scenario: Alice as Bob. captured message, which looks like a normal Assume message. that Trudy has stolen an old key of Bob’s and stolen the message where Alice previously has requested a key. Bob has in the meantime changed his key.
Needham Schroeder n Message 2: KAlice{N 1, Bob, KAB, ticket} with ticket = KBob{KAB, Alice} n n n N 1 prevents replay attacks. “Bob” to prevent Trudy from trying to play Bob. Ticket does not have to be sent encrypted with Alice’s key.
Needham Schroeder n Message 3: ticket, KAB{N 2} n n n Alice presents a challenge together with her ticket. Bob decodes ticket to find KAB. He decodes the latter part of the message to find the challenge.
Needham Schroeder n Message 4: KAB{N 2 -1, N 3} n n Bob solves Alice’s challenge. Bob sends Alice his own challenge. n Your turn: What is the vulnerability if message 4 were to read: KAB{N 2 -1}, KAB{N 3} ? Answer on next two slides.
Needham Schroeder n Answer: n Trudy eavesdrops on an exchange and then splices her own messages to Bob:
Needham Schroeder Alice Bob Ticket, KAB{N 2 -1}, KAB 2}{N 3} Trudy (later) KAB{N 2 -1} Replays Ticket, KAB{NK 4}AB{N 2} Trudy now resumes her first connection: KAB{N 4 -1} and is Ticket, KAB{N authenticated KAB{N 4 -1} KAB 4}{N 5} Trudy (second connection)
Needham Schroeder n Expanded Needham Schroeder n Prevents replay attacks after Alice’s master key was stolen and Alice changed her master key.
Needham Schroeder n Vulnerability Scenario n n n Alice has a previous key JAlice that Trudy captured. Alice has changed her key to KAlice. Trudy has captured a previous login request from Alice to KDC: n KDC sent JAlice{N 1, Bob, JAB, KBob{JAB, Alice}}
Needham Schroeder n Vulnerability Scenario n Trudy has JAlice{N 1, Bob, JAB, KBob{JAB, Alice}} n Trudy calculates JAB and KBob{JAB, Alice} with JAlice. n Trudy now impersonates Alice to Bob. She sends her round 3 message to Bob: N 2, KBob{JAB, Alice} n She can complete the Needham Schroeder protocol with Bob. n Since the KDC no longer participates, informing the KDC of the change does not prevent Trudy from succeeding impersonating Alice to Bob.
Needham Schroeder Vulnerability Scenario n Trudy has n JAlice{N 1, Bob, JAB, KBob{JAB, Alice}}, JAB. KBob{JAB, Alice}. n Trudy to Bob: JAB{N 2}, KBob{JAB, Alice} Bob to Trudy: JAB{N 2– 1, N 3} Trudy to Bob: JAB{N 3– 1} n Trudy and Bob are mutually authenticated! n n
Needham Schroeder n Solution: n Prevent replays after long duration: Clock and date. n Certificate from Bob. n n Extended Needham Schroeder picks the latter.
Extended Needham Schroeder Alice to Bob: Bob to Alice: Alice to KDC: KDC to Alice: Alice to Bob: Bob to Alice: Alice to Bob: I want to talk to you. KBob{NB} N 1, “Alice wants Bob”, KBob{NB} KAlice{N 1, “Bob”, KAB, KBob{KAB, “Alice”, NB}} KBob{KAB, “Alice”, NB}, KAB{N 2} KAB{N 2 -1, N 3} KAB{N 3 -1}. NB prevents the previous attack. Bob can determine whether Alice is using the key that the KDC has.
Extended Needham Schroeder n Alice now needs to receive a certificate from Bob before starting standard Needham Schroeder.
Otway Rees n n n Replaces extended Needham Schroeder Uses only 5 messages Speed-up results from the “suspicious party” (Bob) going to the KDC.
Otway Rees Alice to Bob: Bob to KDC: KDC to Bob to Alice: Alice to Bob: NC, Alice Bob KAlice{NA, NC, “A. ”, “B. ”} KAlice{NA, NC, Alice, Bob, KBob{NB, NC, “A. ”, “B. ”} NC, KAlice{NA, KAB}, KBob{NB, KAB} KAlice{NA, KAB} KAB{NC}
Kerberos n n Based on Needham Schroeder, but uses time instead of nonces. Approximate time is easy in distributed systems.
Kerberos n Kerberos Authentication Service: Alice to KDC to Alice to Bob to Alice N 1 “Alice wants Bob” KAlice{N 1, “Bob”, KAB, KBob{KAB, Alice, expir. Time}} KBob{KAB, “Alice”, expir. Time}, KAB{cur. Time} KAB{cur. Time +1}
Kerberos n Kerberos Setup n n Master key shared by KDC with each principal. When Alice logs into her machine, her station asks the KDC for a session key for Alice. The KDC also gives her a Ticket Granting Ticket. (TGT) Alice’s workstation retains only the session key and the TGT. Alice’s workstation uses the TGT to receive other tickets from the Ticket Granting Service (TGS).
Kerberos n Two entities: n n n Key distribution center. n Authentication Server (AS) Ticket granting server (TGS). Both need the same database, so they are usually on the same machine.
Kerberos n Kerberos V. 4 Logging in: Alice KAlice Workstation AS_REQ{Alice} AS AS_REP{KAlice{SAlice, TGT}} Workstation calculates session key SAlice and TGT, throws KAlice away. TGT = KKDC{Alice, SA}
Kerberos n Why wait for the password? n n Workstation should know Alice’s password for minimum time. Kerberos v. 5 changes this. n The workstation would contain data on which a password cracker could be run.
Kerberos n Kerberos V. 5 Logging in: Alice Workstation AS_REQ{Alice} AS AS_REP{KAlice{SAlice, TGT}} Password? KAlice Workstation calculates session key SAlice and TGT, throws KAlice away. TGT = KKDC{Alice, SA}
Kerberos n Purpose of TGT n n AS, TGS does not need to retain session state. Can recuperate quickly from a crash.
Kerberos n Remote Login n n Step 1: Get a ticket for Bob. Step 2: Use the ticket to log into Bob.
Kerberos Alice rlogin Bob Workstation TGS_REQ{ Alice to Bob, TGT, SA{timestamp}} Gets SA from TGT, verifies timestamp, creates ticket to Bob KBob{ Alice, KAB } TGS_REP{ SA{“Bob”, KAB, KBob{Alice, KAB}}
Kerberos Bob A’s Workstation AP_REQ{ KBob{Alice, KAB}, KAB{timestamp}} Bob decrypts the ticket to find KAB. He then checks the timestamp. AP_REP{ KAB {timestamp + 1}} Workstation authenticates Bob because Bob has proven he knows K AB.
Kerberos n n After the successful rlogin, Alice and Bob are not forced to use KAB But they can.
Kerberos n Replicated KDC n n n To remedy single point of failure. To remedy bottleneck. Critical design point is the master key database. Can be made read-only at replicated KDC and updated by a single master. Updates of the master key database need to be protected against substitution attacks.
Kerberos n Realms n n n Every entity in a Kerberos realm trusts the Kerberos TGS & AS. Each realm has its own master key database. Principals in one realm can be authenticated to principals in another realm.
Kerberos Realm 1 Alice Request and ticket for KDC in Realm 2 Request and ticket for KDC in Realm 3 Realm 2 Request Realm 3
Kerberos n Realms V 4: n Principal names have three strings: n NAME n n INSTANCE n n n service typically server on which service runs REALM Version 5: Uses ASN. 1 n NAME n n now arbitrary number of fields Realm
Kerberos n A single rogue KDC cannot subvert this process and grant tickets for things in other realms.
Kerberos n Tickets contain n Newly minted authentication key KAB Name of requestor Expiration Time n At most 23 hours
Kerberos n Keys contain version numbers. n n n Network resources (incl. KDC) remember several versions of their master keys. This allows a key change without invalidating all pending requests. Important for batch jobs when additional authentication is not possible.
Kerberos n Encryption is used to prevent disclosure and modification. n n n Key: Cannot be disclosed nor modified Name: cannot be modified. Version 4: Proprietary system with a few flaws n Plaintext Cipher Block Chaining
Kerberos: PCBC n n n Modifying any Ci results in modifying all subsequent Ci. At end of message, put in something recognizable. Flaw: Swapping to adjacent blocks, subsequent blocks are back in order.
Kerberos n Kerberos V. 4 uses a checksum mechanism for integrity. n n Algorithm is suspect, but not proven broken. Kerberos V. 5 uses a suite of possible checksum algorithms
Kerberos n n Kerberos messages contain network addresses in the TGT. The TGS checks for the network address when granting tickets. n This is not much of a protection n n It is easy to fake network addresses But together with a firewall might be useful to thwart attackers from outside.
Kerberos n n n Kerberos puts 4 B IPv 4 address inside a ticket. Recipient of ticket checks whether the source IP address is the same as in the ticket. Prevents use of a stolen session key and TGT. n n n Probably not worth the trouble, since it is easy to spoof IP addresses. Generates problems with NAT. Makes delegation of rights difficult / impossible.
Kerberos n Version 5 updates n ASN. 1 data representation language n n No fixed message formats. Adds considerable overhead. ASN. 1 is presented in COEN 351.
Kerberos n Optional delegation of Rights: n Delegation of rights allows someone to give them their access rights for a limited scope and limited time. n n n Important to allow access to resources by a long-lasting batch-job. Cannot be done by handing out the master key, or there would be no limitation to the delegation. Handing tickets to the batch-job will not work if they are used after they expire.
Kerberos n Optional delegation. n n Kerberos v. 5 allows Alice to ask for a TGT with a network address different from her address. This TGT is not usable by Alice, but can be used by some entity to act on Alice’s behalf.
Kerberos n Optional delegation. n Limited Delegation n Alice can give Bob tickets to the specific service that he will need acting on her behalf. n n Instead of giving Bob a TGT. Alice can give Bob a TGT with the AUTHORIZATIONDATA field specified. n n n This field is interpreted by the application, not Kerberos. Application reads the field to determine what Bob can do. OSF/DCE and Windows 2000 use this field extensively.
Kerberos n Optional Delegation n Flag in TGT indicates whether delegation is allowed: n Forwardable Flag n n TGT can be exchanged for a TGT with a different network layer address. n Alice decides whether the new TGT still has the forwardable flag set. In this way, Bob can ask Carol to act for him on behalf of Alice, … Proxiable Flag n TGT can be used to request tickets (but not TGTs) with a different network address.
Kerberos n Ticket Lifetimes n n There is a need for longer lived tickets, but granting them in general poses security risks. K v. 5 allows n n Specifying a start time. An end time. Authorization time. Renew till times.
Kerberos n Alice can: n Get a renewable ticket. n n n Ticket is valid for 100 years. But Alice needs to renew it daily. Renewing a ticket is done by n n Giving the ticket to the KDC and have the KDC reissue it. If there is something wrong, the KDC can be told to not renew the ticket. KDC only needs to retain revocation data for the ticket lifetime. Uses the renewable flag.
Kerberos n Alice can: n Get a postdated ticket. n n Used to run a batch-job sometimes in the future. Kerberos uses the Start-Time field to indicate the future moment when the ticket becomes valid. Original post-dated ticket is marked invalid. If Bob wants to use the ticket, Bob has to present it to the KDC, which clears the invalid field. n This allows revocation of postdated tickets.
Kerberos n Key Versions n KDC maintains versions of keys. n Stored as n n key (encrypted version of Alice’s key) p_kvno (Alice’s key version number) k_kvno (Version of KDC key used to obtain key) Needed for n n Post-dated tickets Renewable tickets
Kerberos n Making Master Keys Different n n Master keys in different realms should be different, when generated with the same password. Kerberos v. 5 uses a password to key hash function that has the realm name as an additional parameter. n Keys are different in different realms in an unpredictable way.
- Slides: 57