Code Section

Monday, July 30, 2018

Fortinet FGT 動手做 - 整合免費的 Google Authenticator 兩步驟驗證 Part 2

因此我不禁思考,FortiGate 可以採用自家產品 FortiToken 作為 OTP Token 來進行兩階段驗證,但是我們能不能改成使用 Google Authenticator 來作為我們 FortiGate 的「兩步驟驗證」工具呢?

原先我有幾個想法 (Theory):
(T-1) FortiGate 可支援透過 Radius 通訊協定,與 3rd Party 的認證設備做身份驗證的溝通。(如下圖說明)
[✖] (T1-A) Google Authentication 並未提供 Radius 的溝通方式。

下圖為 T1 的實踐方式,FortiGate 與 RSA Authentication Manager 透過 Radius 通訊協定整合,使用者輸入帳號及 Passcode 登入。
<註>登入時先查看 Token 產生的動態密碼,並將原先的密碼 (Password)與 Token 動態密碼 (Token Code)合併為 Passcode。

(T2) 利用 Radius Server 作為 FortiGate 的遠端認證主機,由 Radius Server 往外將第二道認證拋給 Google Authentication。
[✖] (T2-A1) 原本考慮 Radius Server 採用 Microsoft NPS (Network Policy Server) on Windows,視窗介面較好操作,但 NPS 不直接支援這種做法。(下段有說明原因)
[✔] (T2-A2) Radius Server 採用 FreeRADIUS on Linux,再由 FreeRADIUS 拋給 Google Authentication 作動態密碼驗證。

來說說 T2-A1 的原因,Microsoft NPS 無法自由調整設定或客制,但 NPS 能設定條件,將符合條件的往外丟給其他 Remote Radius Server 作驗證:
(1) 如同文章開頭提到的,Google Authentication 並無提供 Radius 溝通方式,所以此路不通。
(2) 有些商用的 2-Factor Authentication 設備可支援 Radius 通訊協定,同樣也有提供 App 下載可作為 Mobile Token,就可與 NPS 做到 2FA 認證整合,至於授權計費方式就不細究,因為已經背離此篇的討論方向。

所以就朝 T2-A2 的方向,在 Linux 上安裝 FreeRADIUS,加上 Google Authenticator 認證機制,用這台來當作 FortiGate 的外部 Radius Server,看是否能達到使用 Google Authenticator 作為 FortiGate 的「兩步驟驗證」工具。

首先準備好 CentOS 6.7 64-bit 環境,為什麼是這個版本呢?因為我手上剛好有之前安裝好的 VM,不需要從頭開始安裝,而且 CentOS 也很容易安裝,這邊就不贅述如何安裝 Linux 作業系統,當然你要採用更新的 CentOS 7 應該也是沒問題的。

至於如何安裝 FreeRADIUS 及 Google Authenticator Module 做到 2FA 整合呢?下一篇我會再來詳細說明。



<<參考資料>>

1 comment:

  1. 請問如何安裝 FreeRADIUS 及 Google Authenticator Module 做到 2FA 整合~有說明嗎?!

    ReplyDelete