企業級大數據的安全方案 & Kerberos 的 expire 及 renew說明

企業級大數據集羣有兩個層面的安全系統:

一個是每一臺服務器的本地有個linux的賬戶系統,這個可以批量處理配置。爲每個服務器建立一個本地的賬號和組。用這個賬號去SSH登錄。

另一個就是大數據集羣,即Hadoop的賬號系統,是Hadoop通過 Kerberos 協議實現的。Kerberos是一個協議,而具體實現這種協議的組件有幾個,一般比較廣泛使用的是FreeIPA(顧名思義:免費的)。所以在每臺節點上,會裝一個ipa client, 用這個 client 向 裝了ipa server的服務器申請票據。票據就是登錄的一個憑證。

得到票據後,這個principal (principal 簡單理解就是賬號的意思)具體有哪些權限呢?

這時候LDAP登場了,他來判定這個賬號的權限。FreeIPA 裏集成了 ldap 的功能。

 

一些備註:

https://www.systutorials.com/docs/linux/man/1-ipa-getkeytab/

https://www.freebuf.com/sectool/125387.html

Most people will not use Kerberos by itself; once an user is authenticated (Kerberos), we need to figure out what this user can do (authorization). And that would be the job of programs such as LDAP.

 

這裏講一下Kerberos:

kerberos可以用kinit得到一個ticket(又叫tgt), 在這個ticket生效期間不用輸入密碼, ticket可以不停續期, 有一個expire日期,下面的例子是12月07到12月08的一天時間, 但是生效期內可以通過 kinit -R 來續期這個ticket, 但是還有個renew until, 表示最長可以續期多久, 下面例子表示12/12號以後,  kinit -R 就不能續期了.

這個ticket和keytab無關, keytab是一個密碼文件, 加密了你的密碼而已.

Execute a klist command to verify the values that the system actually granted you.

Ticket cache: FILE:/tmp/krb5cc_1234
Default principal:[email protected]
Valid starting Expires Service principal
12/07/15 13:00:05 12/08/15 13:00:01 krbtgt/[email protected]
renew until 12/12/15 15:48:44

The ticket will expire like an ordinary ticket in 24 hours, but you can renew multiple times before its expiration, until the final expiration date (Dec 12 in the example above). You must do the kinit command interactively because you will have to provide your Kerberos passphrase; this cannot be put into a cron job or other unattended situation.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章