> 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/private-account-sharing/google-drive-playbooks-for-private-account-sharing.md).

# Google Drive playbooks for private account sharing

To mitigate the risk associated with private account sharing in Google Drive, you can define automated workflows for these use cases:&#x20;

* [Auto-expire sharing with private accounts](#auto-expire-sharing-with-private-accounts)
* [Remove sharing with private accounts when offboarding](#remove-sharing-with-private-accounts-when-offboarding)
* [Remove sharing with private accounts](#remove-sharing-with-private-accounts)

{% hint style="success" %}
See the DoControl [demo video](https://youtu.be/pRgMPmwK4eA) to configure auto-expiry of Google Drive assets shared with private email accounts.
{% endhint %}

## Auto-expire sharing with private accounts

When someone shares an asset from Google Drive with a private account, the actor is notified by email, and any external collaborators who have private email domains are removed after 30 days.

{% hint style="info" %}
When an asset exists in a parent folder, collaborator access is removed from all assets in the folder.
{% endhint %}

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to the Google Drive app, and select the **Auto-expire sharing with private accounts** playbook.
3. Give an action name.
4. Under the **Change user access** event, define the relevant conditions:
   * The `Added collaborators` condition contains at least one private email domain from your [keyword list](/docontrol-user-guide/system-management/settings/lexical-lists.md).
   * The `Has added collaborators` condition is true.
   * The `Added collaborators` condition has at least one collaborator that's not from a trusted domain.
5. Add any relevant conditions.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FjcsBZPooo9Kk8gYvCI0P%2FAuto-expire%20private%20sharing%20GD.png?alt=media&amp;token=b221e6c3-04ec-4828-9472-2ed25c8614cc" alt=""><figcaption></figcaption></figure>
6. Customize the **Notify by email** action to notify the actor who shared the file with a private account, and explain that sharing permissions will be removed:\
   "The file sharing will be removed in 30 days from now, as this sharing violates organizational policy."
7. Customize the **Wait** action to wait 30 days.
8. Customize the **Array filter** to filter out collaborators from the private email domain keyword list.
9. Customize the **Remove collaborator** action:
   * Make sure the `Get document ID` and filtered collaborator macros are selected.
   * Specify error handling in case an error occurs.

## Remove sharing with private accounts when offboarding

When an about-to-leave employee shares an asset from Google Drive with a private account, the SecOps team is notified by Slack, and any external collaborators who have private email domains are automatically removed.

{% hint style="info" %}
When an asset exists in a parent folder, collaborator access is removed from all assets in the folder.
{% endhint %}

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to the Google Drive app, and select the **Remove sharing with private accounts when offboarding** playbook.
3. Give an action name.
4. Under the **Change user access** event, define the relevant conditions:
   * The `Added collaborators` condition contains at least one private email domain from your [keyword list](/docontrol-user-guide/system-management/settings/lexical-lists.md).
   * The `Has added collaborators` condition is true.
   * The `Get actor email` condition is from the `About to be terminated` HRIS group.
5. Add any relevant conditions.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2Faf1KCEfzkfuvD6xSst4d%2FPrivate%20account%20offboarding%20GDrive.png?alt=media&amp;token=27636912-b636-465a-a863-9d52e21eb8a9" alt=""><figcaption></figcaption></figure>
6. Customize the **Notify in Slack** action to notify the SecOps team that an about-to-leave actor shared a Google Drive asset with an external user having a private account, and that sharing permissions will be removed:\
   "The file sharing will be removed immediately, as this sharing violates organizational policy."
7. Customize the **Array filter** to filter out collaborators from the private email domain keyword list.
8. Customize the **Remove collaborator** action:
   * &#x20;Make sure the `Get document ID` and filtered collaborator macros are selected.
   * Specify error handling in case an error occurs.

## Remove sharing with private accounts

When someone shares an asset from Google Drive with a private email account, or with a specific email domain, the actor is notified by Slack, and any external collaborators from these domains are automatically removed.

{% hint style="info" %}
When an asset exists in a parent folder, collaborator access is removed from all assets in the folder.
{% endhint %}

1. In Workflows, select **Playbooks**.
2. Filter the playbooks according to the Google Drive app, and select the **Remove sharing with private accounts** playbook.
3. Give the workflow a description.
4. Under the **Change user access** event, the relevant conditions are already pre-populated:
   * **Collaborators in private email domain** - At least one collaborator is from a private email domain
   * **New collaborators were added** -`Has added collaborators` condition is true.
5. Add any relevant conditions.<br>

   <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2F8lq1g7nIL0L1oEyIkDJi%2FPrivate%20acct%20prevent%20sharing%20GD.png?alt=media&amp;token=3748882e-0f25-49f1-a9aa-2647be8ca2f9" alt=""><figcaption></figcaption></figure>
6. Customize the **Array filter** action to filter any collaborators from private email domains OR collaborators having a specific private domain.
7. The **Conditional** action is pre-populated to determine if the file is shared with a private email domain:
   * If **false** - The workflow ends.
   * If **true** - Customize the Notify in Slack action to notify the actor that sharing files with private email accounts violates organizational policy, so sharing links will be removed immediately.\
     The **Remove collaborator** action is populated to automatically remove all external collaborators with private email domains, or a specific email domain.


---

# 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/private-account-sharing/google-drive-playbooks-for-private-account-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.
