> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/risk-management/threat-model-coverage/sensitive-data-movement/teams-playbooks-for-sensitive-data-movement.md).

# Teams playbooks for sensitive data movement

To mitigate the risk associated with sensitive data movement in Teams, you can define automated workflows for these use cases:&#x20;

* [Notify on sharing sensitive files via Teams channel](#notify-on-sharing-sensitive-files-via-teams-channel)
* [Remediate sharing of sensitive OneDrive files via private chat in Teams](#remediate-sharing-of-sensitive-onedrive-files-via-private-chat-in-teams)

## Notify on sharing sensitive files via Teams channel

When a user shares a sensitive file in Teams, the Security team is automatically notified by email and a Teams webhook.

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to sensitive data movement, and select the **Notify on sharing sensitive files via Teams channel** playbook.&#x20;
3. Give an action name.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FLlImnhotV0JwFE6WiHih%2FPB%20Teams%20sensitive%20mvt.png?alt=media&amp;token=eaf0ec03-72ad-4f7d-9025-208ca8482c1a" alt=""><figcaption></figcaption></figure>
4. Under the **File uploaded** event, make sure that the:
   * `event.enriched.eventContext.isSharingEvent` macro is true.
   * Add any relevant conditions.
5. Customize the **PII scan** step that scans the file uploaded to SharePoint for PII labels:
   * Make sure that the `Get asset ID` macro is selected.
   * Specify which PII labels to scan for, such as `credit debit number` or `SSN.`
   * Customize the error handling step in case of an error.
6. Customize the **Conditional** step:
   * If the PII scan didn't detect the specified label, end the workflow with `success` status.
   * If the PII scan detected the specified label, customize the email message to **Notify** the Security team:\
     `We noticed that <get actor> shared a sensitive document in this Teams channel: <$split($split(assetInternalLink, 'Shared Documents/')[1]>`

     `File name: <Get file name>`

     `File URL: <Get the URL>`
7. Customize the **Notify by webhook** step to send a Teams message to the Security Ops team, notifying them that:\
   `DoControl detected that <get actor> shared a sensitive document in this Teams channel: $split($split(assetInternalLink, 'Shared Documents/')[1].`

   `File name: <Get file name>`

   `File URL: <Get the URL>`

## Remediate sharing of sensitive OneDrive files via private chat in Teams

When a user shares a sensitive OneDrive file in Teams, the Security team is automatically notified by email and a Teams webhook, and any public sharing links are automatically removed.

1. In Workflows, select **Playbooks**.

2. Filter the playbooks according to the Sensitive data movement category, and select the **Remediate sharing of sensitive OneDrive files via private chat in Teams** playbook.

3. Give the workflow a description.

4. The **Anonymous link created** event is automatically populated with the condition for when a file is shared via a private chat in Teams.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2F6FRoGHgQKK3UOQT64UUr%2FPrevent%20sharing%20sensitive%20OD%20files%20in%20Teams.png?alt=media&amp;token=cb6d35cb-5a6b-4deb-b07b-06ee3af42683" alt=""><figcaption></figcaption></figure>

5. Add any relevant conditions.

6. Customize the **PII scan** step:
   * Scan the shared file for PII labels you want, such as `credit debit number` or `SSN.`
   * Customize the error handling step in case of an error.

7. Customize the **Conditional** step:
   * If PII was not found, the workflow ends with `success` status.
   * If PII was found, customize the email message to **Notify** the SecOps team:\
     `We noticed that <User ID> shared a public document containing sensitive info in a private Teams chat.`

     `File name: <Get file name>`

     `File URL: <Object ID>`\
     `Do you allow this public share?`

     `If not, we'll remediate the public sharing link, but please note the file can still be downloaded via the Teams channel.`

8. Customize the **Notify by webhook** step to send a Teams message to the Security Ops team, notifying them about the public document being shared in a private Teams chat.

9. The **Remove sharing links** action automatically removes any public links from the OneDrive file.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/risk-management/threat-model-coverage/sensitive-data-movement/teams-playbooks-for-sensitive-data-movement.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
