> 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/workflows/define-workflow-settings/action-settings/query/data-scan/run-a-data-scan.md).

# Run a data scan

To manage your sensitive data at scale, you can scan assets for:

* [Data classifiers](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan/data-classifier-list.md) - These terms categorize data based on sensitivity category or regulatory requirements. You can scan for individual data classifiers, or compliance standards and sensitivity categories that include a number of data classifiers:
  * [Compliance standards](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md#compliance-standards) - Depending on your business sector and customer region, different compliance standards apply, such as GDPR, PCI or HIPAA. When scanning files for data classifiers, select the compliance standards that are most relevant to your organization.
  * [Data categories](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md#data-categories) - Depending on your business sector and customer population, different data categories apply, such as financial, government, or medical. When scanning files for data classifiers, select the categories that are most relevant to your organization.
* [Regex patterns](#regex-patterns) - Strings that meet regular expression or pattern criteria, for example, a string that refers to a confidential topic, or a predefined regex pattern, such as a social security number.&#x20;

Running a data scan involves defining 2 action steps:

1. [Data scan action](#define-data-scan-action)
2. [Conditional action](#define-conditional-action)

{% hint style="success" %}
DoControl provides you with out-of-the-box playbooks to leverage the data scan action in Google Drive and Slack Enterprise workflows:

* [Remediate external sharing of sensitive content in Google Drive](https://docs.docontrol.io/docontrol-user-guide/risk-management/threat-model-coverage/external-collaborator-sharing/google-drive-playbooks-for-external-sharing#remediate-external-sharing-of-sensitive-content)
* [Scan Slack Enterprise direct messages for sensitive content](https://docs.docontrol.io/docontrol-user-guide/risk-management/threat-model-coverage/sensitive-data-movement/slack-enterprise-playbooks-for-sensitive-data-movement#scan-slack-enterprise-direct-messages-for-sensitive-content)
  {% endhint %}

## Define data scan action

Scan your assets for sensitive data classifiers or regex patterns. You can scan files in Google Drive and Slack, or files and messages in Slack Enterprise.

{% hint style="warning" %}

* You need to choose at least one data classifier **or** regex pattern to scan, or both.
* You can select multiple [compliance standards](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md#compliance-standards) or [data categories](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md#data-categories) to scan for. Each one includes all relevant data classifiers, so you don't have to select them one-by-one. For example: the Financial category includes credit card, bank account number, social security information, etc.
* You can add up to 50 classifiers for each data scan.
  {% endhint %}

1. Select the relevant **App** and trigger.

2. From the Actions pane, select **Query** **> Data scan,** drag it to the canvas and connect it to the trigger.

3. Click the action to open its settings.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FwxVZxU3nTfdre5VL2ohZ%2Fdata%20scan%20updated.png?alt=media&amp;token=ed4171af-74fd-496a-8f93-8bc9a7f32158" alt=""><figcaption></figcaption></figure></div>

4. Select data classifiers to search for, up to 50 classifiers.

5. If you select one or more [compliance standards](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md#compliance-standards), all relevant data classifiers are scanned for.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FoxoMYAVC6zCv35dWFL6l%2Fdata%20class%20compliance.png?alt=media&amp;token=68d60110-0a86-4412-97e6-b9e894a67dea" alt=""><figcaption></figcaption></figure></div>

6. If you select one or more [data categories](/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/data-scan.md#data-categories), all relevant data classifiers are scanned for.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FunoDGQ6S7MofLxDaNflf%2Fdata%20class%20categories.png?alt=media&amp;token=f7307bdb-e119-476a-ae17-a2f7ba335bbc" alt=""><figcaption></figcaption></figure></div>

7. You can also define a custom regex pattern, between 5-1000 characters.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2Fxfa62ALa1XEFHvQjYFuI%2Fdata%20scan%20regex.png?alt=media&amp;token=655d1126-f17e-4bee-bc86-81610e36de61" alt=""><figcaption></figcaption></figure></div>

8. Define the error handling.

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2Fewk83ohdvzDaywWzVI6d%2Ferror%20handling%20new.png?alt=media&amp;token=c8727c55-c464-42c5-b5eb-14bc23ee347a" alt=""><figcaption></figcaption></figure></div>

9. Continue to [Define conditional action](#define-conditional-action).

## Define conditional action

After defining the Data scan step, you need to define the **Conditional** action to determine the match criteria.

1. Define the **match probability**, which is the likelihood of a classifier appearing in a file or conversation: 
   * **High probability** - Between 71-100% likelihood there is a match
   * **Medium probability** - Between 31-70% likelihood there is a match
   * **Low probability** - Between 0-30% likelihood there is a match<br>

     <figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2F8KFTCyuOSBpXURDyCph2%2Fconditional%20new.png?alt=media&amp;token=ea73d557-5f66-4398-aebd-de82044cfe30" alt=""><figcaption></figcaption></figure>

2. Customize the **True** branch by adding an **Event filter** step to retrieve all assets with high probability matches (above 70 precent). Proceed to customize the workflow in accordance with your organization's security policies.

3. Customize the **False** branch with an **End workflow** action.


---

# 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/workflows/define-workflow-settings/action-settings/query/data-scan/run-a-data-scan.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.
