[資安小常識] 透過 Azure Rights Management 服務在雲端上安全地管理文件

編者:Cho-Han Wu


 

01

圖一、 Windows Azure Rights Management 服務讓您更輕易地管理雲端文件 (圖片來源)

 

Rights Management Services (RMS) 是一款提供企業在分享檔案和文件時,能夠同時保護機敏資訊安全的解決方案。最新的 RMS 讓企業組織能夠輕易的分享各種檔案類型的機敏性資料,同時也支援跨平台行動裝置的讀取。而新版 RMS 新增的 Azure RMS 功能,更簡化了舊版 RMS 繁瑣的分享步驟,讓使用者可以直接透過 Azure 雲端服務來進行權限的驗證,也讓 RMS 的建置成本大幅下降。本次的資安小常識,將提供您如何透過 Azure RMS 來管理雲端上的機敏文件。

 

不管在資料庫管理和伺服器管理,撰寫系統記錄 (logging) 都是保護及監控系統安全最簡單的好方法。系統記錄會記錄下管理者的動作以及文件讀取的歷史紀錄。因此監控系統記錄可以達到以下三個目的:

1. 監控資料是否被濫用

建議的系統記錄時間應該小於15分鐘,這樣可以提供一個針對您的 RMS 資料的連續性監控。
若某特定對象在非業務時間大量的存取機敏資料,或是在同一個時間區段內 (15分鐘) 從不同的 IP 登入,抑或是在沒有辦公據點的 IP 位置登入,那這些舉動即可能被視為資料的濫用。

2. 分析資料讀取記錄,了解讀取背後的意義

您可以藉由讀取記錄了解某特定使用者的資料讀取記錄,以及讀取的地點訊息等等,這些資源方便您了解使用者的行為。

3. 當做事件發生的證物

當資安事件發生時,管理者可以藉由系統記錄來查詢最後存取系統的使用者,並了解他所讀取的東西。這些訊息方便管理者對機敏資料流向得掌控。

 

 

在開始設定之前

在設定Azure RMS 的系統記錄之前,有三件事必須要先準備好:

1. 您的企業必須是 Microsoft RMS 的訂戶
使用免費的 RMS 個人帳戶將不提供系統記錄的功能。

2. 您必須是 Windows Azure 的訂戶
因為系統記錄必須存放在 Azure 之中,所以您必須是 Azure 的用戶,尚未擁有 Azure 帳戶的可在此申請, 目前 Azure 一個月免費試用

3. 您的系統必須安裝 Windows PowerShell for right management
因為在設定和管理的過程需要用到 PowerShell 來設定,所以您的系統必須安裝 PowerShell,下載網址

 

 

設定 Azure 儲存空間

開啟您的 Azure 入口網站,在左側的功能列表中點選 STORAGE -> NEW -> QUICK CREATE。

 

02

圖二、 在 Azure 中新增儲存空間 (圖片來源)

 

創建完成後,選取剛新增的實例,並按下下方的 MANAGE ACCESS KEYS 按鈕,來管理您的儲存空間存取金鑰。

 

03

圖三、 選取新增的儲存空間實例 (圖片來源)

 

04

圖四、 複製存取金鑰 (圖片來源)

 

 

設定儲存帳號和啟用系統記錄功能

在安裝完 PowerShell 後,就要利用一些Command 來開啟系統記錄的功能。
1. 匯入 Microsoft RMS 模組並連接至 Azure RMS

PS C:\Windows\system32>Import-Module AADRM
PS C:\Windows\system32>Connect-AadrmService -verbose

 

2. 當系統跳出認證請求時,輸入管理者的帳號和密碼加以認證。

 

3. 輸入 Command 告訴 Azure RMS 您的記錄在 Azure 上存放的位置,將剛剛的存取金鑰輸入在底下。

PS C:\Windows\system32> $accesskey = ConvertTo-SecureString"wUjKVV14XXUCrdpuLsIa8yQ5IgUmLSOLmlgS/CcHNZXiurEORjTItdtPf4OpCaIwGNyijjMPxvDEOG21HRKR7A==" –asplaintext –force

PS C:\Windows\System32>Set-AadrmUsageLogStorageAccount -StorageAccount RMSBILogs -AccessKey $accesskey

RMSBILogs was set as the storage account for the usage log feature for the Rights management service.

PS C:\Windows\system32>

 

4. 開啟系統記錄的功能。

PS C:\Windows\system32> Enable-AadrmUsageLogFeature

The usage log feature is enabled for the Rights management service.

PS C:\Windows\system32>

 

 

如何使用和存取 RMS 系統記錄

您可以用以下三種方法存取 RMS 的系統記錄

1. 使用 Windows PowerShell Cmdlet
使用Get-AadrmUsageLog cmdlet 能夠讓使用者下載每一筆區塊的資料到本機端。

2. 使用 Windows Azure Storage SDK
利用 Azure Storage SDK 讓您能夠更彈性地使用Get-AadrmUsageLog 所提供的功能,Windows Azure Storage SDK 的介紹如下

3. 使用 Microsoft Power BI
使用 Microsoft Power BI 讓您能夠將使用的記錄下載成 Excel 使用。

 

 

如何解析 RMS 系統記錄

RMS 的系統記錄範例如下:

#Software: RMS
#Version: 1.0
#Fields: date time row-id request-type user-id result correlation-id content-id c-info c-ip

2013-09-19 13:46:44 0d07036b-c66c-4e92-b887-f59ecd61dc96 AcquireLicense 'janet@corp-contoso.com' 'Success' ad18e935-bcf9-4b51-9d34-cf3391c451ef {9312A0DF-DA57-4854-9160- 603A1ED06CB3} 'MSIPC;version=1.0.622.36;AppName=WINWORD.EXE;AppVersion=15.0.4535.1000;AppArch=x86;OSName=Windows;OSVersion=6.2.9200;OSArch=x86' 94.245.87.113

 

表一、RMS 系統記錄欄位對照表

欄位名稱

W3C 資料型態

欄位描述

範例

Date

Date

UTC Date when the request was served. The source is the local clock on the server that served the request.

2013-09-19

Time

Time

UTC Time in 24H format when the request was served. The source is the local clock on the server that served the request.

13:46:44

row-id

Text

Unique GUID for this log record. This is useful for provenance when you aggregate logs or copy logs into another format.

0d07036b-c66c-4e92-b887-f59ecd61dc96

request-type

Name

Name of the RMS API that was requested

AcquireLicense

user-id

String

The user who made the request. The value is enclosed in single quotes. Some request types are anonymous, in which case this field is ‘’.

'janet@corp-contoso.com'

Result

String

‘Success’ if the request was served successfully. The error type in single quotes if the request failed.

‘Success’

correlation-id

Text

GUID that is common between RMS client log and server log for a given request. This helps in troubleshooting client issues.

ad18e935-bcf9-4b51-9d34-cf3391c451ef

content-id

Text

GUID, enclosed in curly braces, that identifies the protected content e.g. a document. This field has a value only if request-type is AcquireLicense, it is blank for all other request types.

{9312A0DF-DA57-4854-9160-603A1ED06CB3}

c-info

String

Information about the client platform making the request. The specific string varies depending on the application, OS, browser.

'MSIPC;version=1.0.622.36;...OSArch=x86'

c-ip

Address

IP address of the client making the request

94.245.87.113

 

表二、常見的請求對照表

欄位名稱

欄位描述

AcquireLicense

Client is requesting a license for a specific piece of content, from a Windows computer.

FECreateEndUserLicenseV1

This is similar to the AcquireLicence request. This endpoint is for mobile clients.

Certify

Client is requesting a certificate (which is later used to get a license) from a Windows computer.

GetClientLicensorCert

Client is requesting a publishing certificate (which is later used to protect content) from a Windows computer.

FECreatePublishingLicenseV1

This is the same as the previous two combined, from mobile clients.

FindServiceLocationsForUser

This is sometimes anonymous, and sometimes with authenticated. This is an innocuous request that queries for the URLs to certify and acquire license from.

Decrypt

You will see this only if you brought in your own key (BYOK, see whitepaper https://technet.microsoft.com/en-us/library/dn440580.aspx). The Microsoft Rights Management service logs this when your key is used for decrypt – typically once per AcquireLicense and Certify.

Sign

You will see this only if you brought in your own key (BYOK). RMS logs this when your key is used for signing – typically once per one time per AcquireLicence (or FECreateEndUserLicenseV1), Certify, and GetClientLicensorCert (or FECreatePublishingLicenseV1).

 

透過 Azure RMS 的系統記錄功能,不但可以達到監控系統機敏文件存取記錄的功能,同時將記錄檔存放在雲端服務上,又可以減少企業維護系統的成本,可說是一舉數得。若您想要追蹤最新的RMS 技術,也歡迎到 RMS 的官方部落格 (英文) 來取得最新的資訊。

 

參考資料