共用方式為


如何與 Microsoft Teams 資料外洩防護原則整合

重要

本文所述的功能目前處於公開預覽狀態。 此預覽版本沒有服務等級協定,不建議用於處理生產工作負載。 可能不支援特定功能,或可能已經限制功能。 如需詳細資訊,請參閱 Microsoft Azure 預覽版增補使用條款

Microsoft Teams 系統管理員可以設定數據外洩防護原則,以防止 Teams 使用者在 Teams 會議期間洩漏敏感性資訊。 開發人員可以選擇在Teams會議中整合聊天功能與 Azure 通訊服務。 這可以透過 Azure 通訊服務 UI 連結庫或自定義整合來完成。 本文說明如何在不使用 UI 連結庫的情況下納入數據外洩防護。

您必須設定應用程式以接聽訊息編輯的即時更新。 如果 Teams 使用者傳送包含敏感性內容的訊息,訊息將會自動取代為空白訊息,並標幟為 “policyViolation” 結果。 您的應用程式應該更新其使用者介面,以反映已封鎖訊息。 例如,顯示訊息,例如「訊息已封鎖,因為它包含敏感性資訊」。請注意,在傳送訊息和偵測到原則違規並套用時,可能會有短暫的延遲,通常是幾秒鐘。 您可以在下方找到這類程式碼的範例。

請務必注意,DLP 原則僅適用於 Teams 用戶傳送的訊息,且不會防止 Azure 通訊使用者傳送敏感性資訊。

訂閱即時聊天通知的資料外洩防護

let endpointUrl = '<replace with your resource endpoint>'; 

// The user access token generated as part of the pre-requisites 
let userAccessToken = '<USER_ACCESS_TOKEN>'; 

let chatClient = new ChatClient(endpointUrl, new AzureCommunicationTokenCredential(userAccessToken)); 

await chatClient.startRealtimeNotifications(); 
chatClient.on("chatMessageEdited", (e) => { 
    if (e.policyViolation?.result == "contentBlocked") {
        // Show UI message blocked
    }
});

擷取先前聊天訊息的資料外洩防護

const messages = chatThreadClient.listMessages();
for await (const message of messages) {
    if (message.policyViolation?.result == "contentBlocked") {
        // Show UI message blocked 
    }
}

下一步