Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC)...

32
Fakult ¨ at f ¨ ur Informatik Technische Universit¨ at M ¨ unchen Network Security Kerberos and other Frameworks for Client Authentication Dr. Heiko Niedermayer Cornelius Diekmann Lehrstuhl f ¨ ur Netzarchitekturen und Netzdienste Institut f ¨ ur Informatik Technische Universit¨ at M ¨ unchen Version: January 12, 2016 IN2101, WS 15/16, Network Security 1

Transcript of Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC)...

Page 1: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Network SecurityKerberos and other Frameworks for Client Authentication

Dr. Heiko NiedermayerCornelius Diekmann

Lehrstuhl fur Netzarchitekturen und NetzdiensteInstitut fur Informatik

Technische Universitat Munchen

Version: January 12, 2016

IN2101, WS 15/16, Network Security 1

Page 2: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Acknowledgements

I This course is based to some extend on slides provided byGunter Schafer, author of the book ”Netzsicherheit -Algorithmische Grundlagen und Protokolle”, available in Germanfrom dpunkt Verlag.

I The English version of the book is entitled “Security in Fixed andWireless Networks: An Introduction to Securing DataCommunications” and is published by Wiley is also available. Wegratefully acknowledge his support.

I The slide set has been reworked by Heiko Niedermayer, AliFessi, Ralph Holz, Cornelius Diekmann, and Georg Carle.

IN2101, WS 15/16, Network Security 2

Page 3: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Explanation Pony and Exercises

I Slides called ”- Explanation” and usually marked with are notfor the lecture, but they contain further explanations for yourlearning at home.

I Parts called ”Exercise” are voluntary exercises for discussion inlecture as well as for your reworking of the slides and learning athome.

IN2101, WS 15/16, Network Security 3

Page 4: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Agenda

1 Introduction

2 Learning Goals

3 Frameworks for Client Authentication

4 Kerberos

5 Conclusions - What have we learned

IN2101, WS 15/16, Network Security 4

Page 5: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Introduction

IN2101, WS 15/16, Network Security: Introduction 5

Page 6: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Introduction

I User Authentication

IN2101, WS 15/16, Network Security: Introduction 6

Page 7: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Introduction

I User AuthenticationI UsernameI Credential

I Credential usually:I Password / Shared KeyI Signature (less frequent)

I Multiple FactorsI Know passwordI Possess cardI ....I Benefit of multiple factors is to have multiple lines of defense.

Makes attacks more complicated, not impossible.

IN2101, WS 15/16, Network Security: Introduction 7

Page 8: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Login to Services on the Network

I The service needs to know user and a credential.I In this chapter, we usually assume the use of symmetric

cryptography.I Keys derived from password or other factor.

IN2101, WS 15/16, Network Security: Introduction 8

Page 9: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Learning Goals

IN2101, WS 15/16, Network Security: Learning Goals 9

Page 10: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Learning Goals

I Basic understanding of the Kerberos protocolI Remember and explainI Apply what you learned in crypto prots on it and modified protocols

I Ticket conceptI Remember and explainI Apply in modified setting

I Inclusion of Authentication BackendsI Know of concept, know names of some backendsI Where does user authentication come from?

IN2101, WS 15/16, Network Security: Learning Goals 10

Page 11: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Frameworks for ClientAuthentication

IN2101, WS 15/16, Network Security: Frameworks for Client Authentication 11

Page 12: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Authenticating to a Server

Client (A) Server (S1)User name and Password protected in some form.

I A client has accounts at each of the servers it uses.I Each server has a user database and operates as authentication

server.I Disadvantages: hard to manage, number of passwords, ...

IN2101, WS 15/16, Network Security: Frameworks for Client Authentication 12

Page 13: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Authenticating to a Server with Authentication Server

Client (A) Server (S1)

Authentication Server (AS)

User name and Password protected in some form.

User name and Password protected in some form.

I An Authentication Server (AS) manages the accounts.I Authentication has to happen via the AS.

IN2101, WS 15/16, Network Security: Frameworks for Client Authentication 13

Page 14: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Authentication with external AS

I Option: S1 uses the credentials provided by A to run acryptographic protocol with AS.

I Common practice for local authentication within one infrastructure(Kerberos might be used).

I Alternative (better): End-to-end Authentication between A andAS. S1 relays messages and AS informs S1 about outcome(ACCEPT / DENY).

I Found in more public infrastructures.I Link Layer Access: Extensible Authentication Protocol (EAP), ...

I Alternative (better): A runs protocol with AS, interaction results ininformation A and S1 can use to mutually authenticate.

I Can happen before A and S1 interact or in-between.I OpenID, OAuth, ...I Kerberos (original idea)

IN2101, WS 15/16, Network Security: Frameworks for Client Authentication 14

Page 15: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Authentication with external AS

I Local infrastructures may want to use different authenticationservices

I Make authentication services accessible via a generic API, e.g.PAM, GSSAPI, ...

I Many authentication services themselves operate primarily asgeneric transport protocols for cryptographic protocol messages aswell as authentication and authorization results (e.g. EAP, Radius,...).

IN2101, WS 15/16, Network Security: Frameworks for Client Authentication 15

Page 16: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos

IN2101, WS 15/16, Network Security: Kerberos 16

Page 17: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos

Kerberos is an authentication and access controlservice for work-station clusters that wasdesigned at the MIT during the late 1980s

I Design goals:I Security: eavesdroppers or active attackers should not be able to

obtain the necessary information to impersonate a user whenaccessing a service

I Reliability: as every use of a service requires prior authentication,Kerberos should be highly reliable and available

I Transparency: the authentication process should be transparent tothe user beyond the requirement to enter a password

I Scalability: the system should be able to support a large number ofclients and servers

IN2101, WS 15/16, Network Security: Kerberos 17

Page 18: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Concept

Client (A)

Server (S1)

Key Distribution Center (KDC)

Authentication Server (AS)

Ticket Granting Server (TGS)

1. I am Alice, give me a ticket.

2. Key and ticket. Provides Authentication,

only Alice can use ticket

3. Here is my ticket, give me a ticket for S1.4. Key and ticket for S1. Provides Authorization,

Alice allowed to use S1?5. Dear S1, here is my ticket and authentication.

6. S1 authenticates.

IN2101, WS 15/16, Network Security: Kerberos 18

Page 19: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Concept

Client (A)

Server (S1)

Key Distribution Center (KDC)

Authentication Server (AS)

Ticket Granting Server (TGS)

1. I am Alice, give me a ticket.

2. Key and ticket.

3. Here is my ticket, give me a ticket for S1.4. Key and ticket for S1.

5. Dear S1, here is my ticket and authentication.

6. S1 authenticates.

Kerberos Realm of A, AS, TGS, and S1

IN2101, WS 15/16, Network Security: Kerberos 18

Page 20: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Needham-Schroeder

I Conceptually, Kerberos is based on the Needham-SchroederSymmetric Key Protocol

I uses timestamps instead of nonces (random numbers)I Key Distribution Center

I provides authentication and authorizationI generates and provides the keys for the next steps

I TicketI like in Needham-Schroeder binds key and identity of clientI binds ticket to IP address of client

I RealmI Kerberos operates in organizational realmsI Operation is limited to realmI Multi-realm possible if realms cooperate

I PasswordI Shared key with AS derived from user password, traditionally

kA,AS = md5(PasswordA)

IN2101, WS 15/16, Network Security: Kerberos 19

Page 21: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Concept

Client (A)

Server (S1)

Authentication Server (AS)

Ticket Granting Server (TGS)

0. know each other,

have longterm shared key kAS,A = h(PasswordA)

0.know

eachother,

haveshared

keyk

AS,TG

S

0.know

eachother,

haveshared

keyk

TGS,S

1

IN2101, WS 15/16, Network Security: Kerberos 20

Page 22: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Protocol

Client (A)

Server (S1)

Authentication Server (AS)

Ticket Granting Server (TGS)

1. A, tA, TGS, RequestedTicketLifetimeTGS

2. {KA,TGS , TGS, tAS , LifetimeTicketTGS , TicketTGS}KA,AS

with TicketTGS = {KA,TGS , A, AddrA, TGS, tAS , LifetimeTicketTGS}KAS,TGS

3. S1, TicketTGS , AuthenticatorA,TGS

with AuthenticatorA,TGS = {A, AddrA, t1A}KA,TGS

4. {KA,S1, S1, tTGS , TicketS1}KA,TGS

with TicketS1 = {KA,S1, A, AddrA, S1, tTGS , LifetimeTicketS1}KTGS,S1

5. TicketS1, AuthenticatorA,S1

with AuthenticatorA,S1 = {A, AddrA, t2A}KA,S1

6. {t2A + 1}KA,S1

IN2101, WS 15/16, Network Security: Kerberos 21

Page 23: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Protocol

I 1. A → AS : A, tA,TGS,RequestedTicketLifetimeTGSI The first message does not use cryptography.I Fields are the user name, timestamp, a valid Ticket Granting

Server, and the requested lifetime to the tickets.I 2. AS → A : {KA,TGS,TGS, tAS,LifetimeTicketTGS,TicketTGS}KA,AS

withTicketTGS = {KA,TGS,A,AddrA,TGS, tAS,LifetimeTicketTGS}KAS,TGS

I This message is protected with the shared key of A and AS(”password of A”), which is part of the user database of the AS.

I The first part of the message is information Alice needs to use theticket, e.g. the new shared key KA,TGS with the TGS.

I The second part of the message is the ticket, which Alice cannotdecrypt or modify.

I In general, the ticket concepts needs to give the ticket holderenough information to be able to use the ticket. The ticket isprotected from the ticket holder. The ticket itself contains similarinformation, yet for the server that verifies the ticket.

IN2101, WS 15/16, Network Security: Kerberos 22

Page 24: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Protocol

I 3. A → TGS : S1,TicketTGS,AuthenticatorA,TGS withAuthenticatorA,TGS = {A,AddrA, t1A}KA,TGS

I With the Authenticator Alice shows to the TGS that she is thelegitimate ticket holder.

I She uses the relevant key KA,TGS , which is part of the ticket.I She has the right IP address AddrA.I Authenticator and Ticket are fresh due to fresh enough timestamps.

I 4. TGS → A : {KA,S1,S1, tTGS,TicketS1}KA,TGS withTicketS1 = {KA,S1,A,AddrA,S1, tTGS,LifetimeTicketS1}KTGS,S1

I Similar to 2.I 5. A → S1 : TicketS1,AuthenticatorA,S1 with

AuthenticatorA,S1 = {A,AddrA, t2A}KA,S1

I Similar to 3.I 6. S1 → A : {t2A + 1}KA,S1

I S1 uses the relevant shared key and answers with Alice’stimestamp as nonce. Alice knows she uses the right server.

IN2101, WS 15/16, Network Security: Kerberos 23

Page 25: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Multi-Realm

Client (A)

Server S2

AS

TGS

AS

TGS

0.know

eachother,

havelongterm

sharedkey

kTG

S1,TG

S2

Realm 1

Realm 2

IN2101, WS 15/16, Network Security: Kerberos 24

Page 26: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Multi-Realm

Client (A)

Server S2

AS

TGS

AS

TGS

...

0.know

eachother,

havelongterm

sharedkey

kTG

S1,TG

S2

4. Key and Ticket for TGS25. Here is my ticket, give me ticket for S2

6. Ticket for S2

7. Here is my ticket and authentication

8. S2 authenticates

Realm 1

Realm 2

IN2101, WS 15/16, Network Security: Kerberos 24

Page 27: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Pre-Authentication Preliminaries

I Weakness Password AuthenticationI Remember message 1: A, tA,TGS,RequestedTicketLifetimeTGSI Message 1 is not protected. An attacker can request a ticket for

someone else. The AS will send message 2 to the attacker.I Remember Message 2:

{KA,TGS ,TGS, tAS , LifetimeTicketTGS ,TicketTGS}KA,AS withKA,AS = h(PasswordA)

I Now the attacker has ciphertext encrypted with a low-entropy keyderived from the password.

I Attack the key with suitable attack (e.g. dictionary attack)

IN2101, WS 15/16, Network Security: Kerberos 25

Page 28: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Pre-Authentication

I Kerberos Pre-AuthenticationI Pre-Authentication is a concept developed for Kerberos1 to extend

the protocol messages (optional).I Protocol principles prove their identity before their message is

further processed.I To avoid the attack above, PA-ENC-TIMESTAMP was proposed in

Kerberos 5.I Pre-Authentication as generic concept supports all kinds of

authentication concepts.I PA-ENC-TIMESTAMP

I Add {tA}KA,AS as pre-authentication in message 1.I AS will only reply if a current timestamp protected with Alice’s key

was sent.I Thus, ciphertext using key KA,AS will not be sent to the attacker.2

1IETF RFC 61132Our Dolev-Yao attacker will see Alice’s communication and see such ciphertext

nonetheless.IN2101, WS 15/16, Network Security: Kerberos 26

Page 29: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Design Goals?

I Remember the design goals:I Security: eavesdroppers or active attackers should not be able to

obtain the necessary information to impersonate a user whenaccessing a service

I Modern versions of Kerberos use state-of-the-art cryptography,(optional) pre-Authentication helps with password issues

I Reliability: as every use of a service requires prior authentication,Kerberos should be highly reliable and available

I The design allows redundant servers and tickets can be reused withintheir lifetime.

I Transparency: the authentication process should be transparent tothe user beyond the requirement to enter a password

I Kerberos is a single-sign-on solution. Applications can use ticketswithin their lifetime.

I General APIs like PAM help with Kerberos integration in applications.I Scalability: the system should be able to support a large number of

clients and serversI The design allows redundant servers.

IN2101, WS 15/16, Network Security: Kerberos 27

Page 30: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Kerberos - Reality Check

I In most environments, Kerberos is used in the backend betweenServer and Key Distribution Center, but not on client side.

I Pluggable Authentication Modules (PAM) in Linux demonstratethe situation:

I The services of the system use PAM to do their authentication.I PAM provides an API for these services with.I Kerberos is one PAM authentication service module, but there are

others like LDAP, RADIUS, . . .

FTP Server Web Server SSH Server IMAP Server

PAM APIPAM Configuration

Kerberos LDAP RADIUS

IN2101, WS 15/16, Network Security: Kerberos 28

Page 31: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

Conclusions - What havewe learned

IN2101, WS 15/16, Network Security: Conclusions - What have we learned 29

Page 32: Network Security - Kerberos and other Frameworks for ... · Key Distribution Center (KDC) Authentication Server (AS) Ticket Granting Server (TGS) 1. I am Alice, give me a ticket.

Fakultat fur Informatik Technische Universitat Munchen

What have we learned

I Authentication BackendsI User AuthenticationI APIs, Credentials, Transport of Credentials, Protocols

I KerberosI Example for password authenticationI Ticket ConceptI Today’s use usually differs from original idea.

IN2101, WS 15/16, Network Security: Conclusions - What have we learned 30