> 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/public-sharing/sharepoint-playbooks-for-public-sharing.md).

# SharePoint playbooks for public sharing

To mitigate the risk associated with public sharing in SharePoint, you can define automated workflows for these use cases:&#x20;

* [Notify on public sharing](#notify-on-public-sharing)
* [Remove public sharing on-demand](#remove-public-sharing-on-demand)
* [Notify and remediate public sharing of sensitive PII](#notify-and-remediate-public-sharing-of-sensitive-pii)

## Notify on public sharing

When someone from a specific group shares a file publicly in SharePoint, the security team is notified in Slack.

{% hint style="info" %}
See the DoControl [demo video](https://youtu.be/cDF_3jWs7Tw) to configure auto-expiry of publicly shared files in SharePoint. DoControl's best practices will help you to minimize data overexposure, and mitigate the risk of data loss.
{% endhint %}

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to the SharePoint app, and select the **Notify on public sharing** playbook.
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%2FGpKSY85QcwYWHb7JYhyU%2FNotify%20public%20share%20SP%20PB.png?alt=media&amp;token=cceb6e5c-85a2-4d0a-8aa9-5a7505223a76" alt=""><figcaption></figcaption></figure>
4. Under the **Anonymous link created** event, define the relevant conditions:
   * The `Get actor` condition is in a specific group
   * Add any relevant conditions.
5. Customize the Slack message to send to the Security team, notifying them that the actor publicly shared a file in SharePoint.

## Remove public sharing on-demand

You can trigger an inventory action to remove shared links from SharePoint assets on-demand.

{% hint style="success" %}
You can customize [inventory actions](/docontrol-user-guide/workflows/inventory-actions-quick-actions.md) to meet your organization's requirements.
{% endhint %}

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to Public sharing, and select the **Remove public sharing on-demand** playbook for SharePoint.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2Fo7yqThqg4MdRi6AFbHa7%2FSharePoint%20remove%20public%20sharing.png?alt=media&amp;token=57679de8-b347-48c3-b827-55cd787e8b87" alt=""><figcaption></figcaption></figure>
3. Select the link type to remove:
   * Public
   * Organization
4. Save the workflow.

## Notify and remediate public sharing of sensitive PII

When someone publicly shares a file in SharePoint, the file is scanned for PII labels. If PII labels are found, the relevant manager or security team is notified by email and webhook, and the public links are removed from the file.

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to the SharePoint app, and select the **Notify and remediate public sharing of sensitive PII** playbook.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2Fs4Px04mD9x906RpPAJcn%2Fpublic%20sharing%20of%20PII%20SharePoint.png?alt=media&amp;token=1f6119f6-f01e-40ae-9f48-ade0acc095e0" alt=""><figcaption></figcaption></figure>
3. Give an action name.
4. Under the **Anonymous link created** event, define the relevant conditions:
   * The `Get target` condition is not in a trusted domain
   * Add any relevant conditions.
5. Customize the **PII scan** to search for specific keywords, such as `bank account number, credit debit CVV`.
6. In the **Conditional** step, define the true/false branches:
   * If **false**, the workflow ends.
   * If **true**, the relevant personnel are notified and the publicly shared link is removed:
     * **Notify by email** - Customize the email to send to the approving manager or Security team informing about a sensitive file that was shared via a public link.
     * **Notify by webhook** - Customize the webhook message to send to the approving manager or Security team informing about a sensitive file that was shared via a public link.
     * **Remove sharing links** - Remove the public URL from the shared 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/public-sharing/sharepoint-playbooks-for-public-sharing.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.
