[IT-Security-1] Kerberos
Kerberos
Notes from RWTH Aachen University course
“IT security 1” Wintersemester 2019/20
professor: Meyer, Ulrike Michaela
什麼是Kerberos
- 在網路中提供authentication及key agreement的協定們
- 使網路應用程式可以授權他們的peers
- 基於shared secret key
- 基於Needham and Schroeder protocol (in Authentication)
- 在網路中提供authentication及key agreement的協定們
流程:
- A 用帳號密碼登入工作站
- A 向 Key Distribution Center (KDC) 請求 Ticket
- A 用 Ticket 向 File system 取得授權
Key Distribution Center (KDC)
- 包含:
- Kerberos Authentication Server (AS)
- Kerberos Ticket Granting Server (TGS)
- KDC提供ticket和session key
- 包含:
Principle Identifiers
- form: {name}:instance@realm
- realm 說明domain
- instance 說明裝置種類(ex. printer)
- name 是在特殊 realm 中特殊 instance 的實際名稱
protocol
- Long-term keys:
- KDC 有一把自己的密鑰 kKDC
- KDC 跟 user A 有一把 secret master key kA (從 A 的密碼而來)
- KDC 跟 resource R 有一把 secret master key kR
- KDC 用 kKDC 加密這些key,並從在database
- Ticket Granting Tickets:
- A 登入後,工作站向 KDC 請求session key
- KDC:
- 產生session key SA
- 產生 ticket granting ticket (TGT)
TGT=kKDC{"Alice",SA,timestamp, lifetime} TGT 用來給 SA,且 KDC 不儲存任何狀態資訊
- 傳送 kA{"KDC", SA , TGT} 給工作站
- 工作站用 A 的密碼解密,得到session key SA
用session key而不是master key減少對password的使用
password的攻擊更困難
- Tickets :
- Ticket request: A 向 KDC 要求對 R 的權限
- 工作站傳送 TGT, "R", SA(timestamp)
- KDC 解開 TGT,得到 SA
- KDC 產生
- session key kAR
- ticketR=kR{"Alice",kAR,timestamp, lifetime}
- KDC 回傳 SA{"R", kAR , ticketR}
- Login into the Resource R:
- A 對 R 傳送 (ticketR,kAR(timestamp))
- R 回傳kAR(timestamp+1)
Multiple KDC
- 因為一個主要的KDC會有failure或流量過大的問題
- Kerberos支援realm 1的使用者請求realm 2的資源
- Realm 2的KDC像Realm 1的resource
Key Version Numbers
- 若 A 有了ticket但 R 更改了master key則會有問題
- 因此需要定義key version
- R 需要有前一個key,並在pre-defined的時間刪除
保障Encryption及Integrity:
- 用DES in PCBC (Plaintext-Cipher-Block-Chaining) mode
- PCBC:
- encryption:
- c0:=IV
m0:=0 - cn+1:=Ek(mn+1⊕cn⊕mn)
- c0:=IV
- decryption:
- mn+1=Dk(cn+1)⊕cn⊕mn
mn+1=Dk(cn+1)⊕cn⊕Dk(cn+n)⊕cn−1⊕mn−1
mn+1=Dk(cn+1)⊕cn⊕Dk(cn+n)⊕cn−1⊕...⊕Dk(c1)⊕c0
- 跟CBC不同的是:CBC的ci經過竄改後只會影響mi和mi+1,PCBC會影響mi,...,mn
- Problem:
- 攻擊者仍可對調 ci,cj 使解密還是正確
- 不提供 integrity
Network Layer Addresses in the Tickets
- KDC 應檢查 TGT 中的 IP address是否跟request時的IP address一樣
- 使攻擊更難因為需偽造IP address
Kerberos v4的限制:
- 觀念上:
- 只能用DES in PCBC mode保障encryption和integrity
- usable only on top of IP(!?)
- Message byte傳送的順序是sender決定的
- ticket lifetime太短
- 不支援委託(ticket無法轉移)
- principle naming的問題:無法在 name 加入 “.”
- Ticket’s Double encryption
- 技術上:
- PCBC mode: non-standard DES mode,沒有integrity保障
- replay
- Password attacks:因為密文包含 "KDC",所以會被猜測密碼
- 觀念上:
Kerberos 5
- 支援不同的加密演算法
- private-message type:
- DES-CBC-Hash
- Hash: CRC, MD4, MD5
- safe-message type:
- RSA-MD5-DES
- DES-MAC
- DES-MAC-k (not recommanded)
- RSA-MD4-DES
- RSA-MD4-DES-k (not recommanded)
- 還有Specification 2
- CBC with Cipher Stealing
- 不只用IP,還有支援其他address type
- Principal naming限制更少
- Encoding problems (byte ordering) solved by the use of standard encodings (ANS.1 syntax with the Basic Encoding Rules)
- TGT跟ticket的改變
- 不再加密"KDC"到TGT中
Kerberos 4 Kerberos 5 TGT-Reply kA{"KDC", SA , TGT} kA{SA}, TGT Ticket-Reply SA{"R",kAR,ticketR} SA{"R",kAR}, ticketR 不會雙重加密 TGT,ticketR
- New features:
- 另外的授權機制,在TGT-request中的pre-authenticated data
- 用sequence number取代timestamp
- 支援代理機制
- A 向 ADC 請求 P 的 ticket(有 P 的address)
- P 的行為代表 A
- A 可以控制 P 的權限
- 可以有Flag標註是 P 還是 A
- 有Proxiable Ticket Flag和Forwardable Ticket Flag
- 供應用程式決定要不要接受此ticket
- ticket lifetime
- 時間更彈性
- 可以renew
- 可以要求之後的ticket
- 階層性的realm
- 可以有short-cut,減少request次數
- Pre-authentication
- 送出 TGT-request 時加上 pre-authentication data
- 避免字典攻擊、denial of service攻擊(過量的request)
- 可以用public key crytographic
- KDC儲存certificate而不是password
Readings
Kaufman Chapter 13 and 14
J. Kohl, B. Neuman: “The Evolution of the Kerberos
Authentication Service”, 1994
RFC 4120: “The Kerberos Network Authentication Service (V5)“, 2005
RFC 4556: “Public Key Cryptography for Initial Authentication in Kerberos (PKINIT)”, 2006
留言
張貼留言