# Specialized File Detectors

Nightfall supports Detectors that will scan for file names, file types, and file finger prints.

## Detecting File Names

In addition to scanning the content of files, you may configure the Detectors to scan file names as well.

This is done through the “scope” attribute of a Detector.

The scope attribute allows you to scan either within file contents, the file name, or both the file contents and file name.

File extensions can be scanned for by creating a Regular Expression type custom Detector with a `scope` to scan only file names ("File") or both the content and file name ("ContentAndFile"), as shown in the example request below.

```sh
curl --request POST \
     --url https://api.nightfall.ai/v3/upload/<fileid>/scan \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer  NF-<yourNightfallKey> \
     --header 'Content-Type: application/json' \
     --data '
{
     "policy": {
          "detectionRules": [
               {
                    "detectors": [
                         {
                              "regex": {
                                   "pattern": "*\.txt",
                                   "isCaseSensitive": false
                              },
                              "detectorType": "REGEX",
                              "scope": "ContentAndFile"
                         }
                    ],
                    "name": "File Name Detector",
                    "logicalOp": "ANY"
               }
          ]
     }
}

```

In addition to scanning based on file name, you may also use a[ File Type Detector](/developer-api/key-concepts/file_scan/special_file_detectors.md#detecting-file-types) which allows you to scan for files based on their mime-type.

Note that confidence sensitivity does not apply to file names. Sensitive findings will always be reported on.

## Detecting File Types

Nightfall’s File Type detection allows you to implement compliance policies that detect and alert you when particular file types that are not allowed in a given location are discovered.

This functionality is implemented by creating a specific Detector called a “File Type Detector”

To create a File Type Detector, select “Detectors” from the left hand navigation and click the button labeled “+New Detector” in the upper right hand corner. From there a drop down list of Detector types will be displayed which will include the “File Type” Detector type.

<figure><img src="/files/aFx31bz1tmMwlyheAYyo" alt=""><figcaption></figcaption></figure>

You will then select one or more file types for which to scan by selecting from a list of [mime-types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)

<figure><img src="/files/Jqj7LFHGsw9Wkf9zzwNP" alt=""><figcaption></figcaption></figure>

You can either scroll through the list of mime-types in the select box or you may type in a portion of the mime-type and the contents of the select box will be filtered to match your input.

Nightfall supports detection for a wide variety of mime-types. See the Internet Assigned Numbers Authority’s (IANA) website for a definitive list of [mime-types](https://www.iana.org/assignments/media-types/media-types.xhtml). Note however that Nightfall does not support the detection of audio and video related mime-types.

Detection of file types is done based on the file contents, not its extension. However, you can create [Detectors that scan file names](/developer-api/key-concepts/file_scan/special_file_detectors.md) by setting the `scope` attribute.

File Type Detectors vary from other Nightfall Detectors in that the attributes of `scope` and `confidence` are not relevant to File Type Detectors

Once you have added all the mime-types you wish to scan for, save your new Detector. You may then add your new Detector to[ Detection Rules](broken://pages/Y2C5etcb9VXDyLMaLngr) and[ Policies](/developer-api/key-concepts/setup/policies.md).

## Detecting Files Through Fingerprinting

Nightfall allows you to discover the location of specific files that you have deemed sensitive and want to avoid sharing.

This discovery is done through document fingerprinting. Fingerprinting is the process of algorithmically creating a unique identifier for a file by mapping the data of the document to a signature that can be recalled quickly. This allows the file to be identified in a manner akin to how human fingerprints uniquely identify individual people.

This functionality is achieved in Nightfall by creating a specific Detector type called a File Fingerprint Detector.

The Fingerprint Detector allows you to create a fingerprint for one more files (a sort “handful” of fingerprints, if you would).

To create a Fingerprint Detector, select “Detectors” from the left hand navigation and click the button labeled “+New Detector” in the upper right hand corner. From there a drop down list of Detector types will be displayed which will include the “Fingerprint” Detector type.

<figure><img src="/files/qce7QbsFj9xm9lE7OWbY" alt=""><figcaption></figcaption></figure>

When you create a File Fingerprint Detector you can upload up to 50 files that need to be fingerprinted. The file size limit is 25MB.

<figure><img src="/files/5evBIJkSJ6vKww1y1Cmq" alt=""><figcaption></figcaption></figure>

Once the fingerprint is generated, the actual content of the file is discarded so no sensitive content is stored on Nightfall’s system.

These Detectors may only be created through the console.

{% hint style="info" %}

### Updates to Fingerprinted Files

You can not update Fingerprint Detectors, so any modification to the original file or underlying requires that you create a brand new Fingerprint Detector.
{% endhint %}

You may then treat the Fingerprint detector like any other [Detector ](broken://pages/QyqtGxcghEFrZ6rlufJI)and incorporate it into a [Detection Rule](broken://pages/Y2C5etcb9VXDyLMaLngr) using its unique Detector identifier.

You may incorporate these Detectors into [Policies](/developer-api/key-concepts/file_scan/special_file_detectors.md) that will alert you whenever files that match the fingerprint are detected.


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.nightfall.ai/developer-api/key-concepts/file_scan/special_file_detectors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
