> For the complete documentation index, see [llms.txt](https://docs.privado.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.privado.ai/customizing-privado/add-a-new-storage-sink.md).

# Add a new Storage Sink

Storage sinks are the databases, file systems or cloud services where data is stored. Example: MySQL, MongoDB, AWS S3, etc. You can review existing storage sinks in [`rules/sinks/storages`](https://github.com/Privado-Inc/privado/tree/main/rules/sinks/storages)&#x20;

**List of fields for defining a storage sink**:

| Field      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `id`       | <p>It is unique identifier for the storage sink. It has format “Storages“ + Vendor Name ( without spaces and special characters ) + “Read“ or “Write“<br>\</brExample:>Example: For MongoDB system, you can have “Storages.MongoDB.Read” or “Storages.MongoDB.Write”</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `name`     | It is name of the storage Example: MongoDB ( Read )                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `patterns` | <p>It is an array of regex patterns for the storage sink. This regex will be used to search method names and to further check if data elements are going to the identified methods. Matching methods with data flows will be tagged for this storage sink.<br><br>Example: Mark specific method from a known class<br>class name: <code>com.privado.MySinkClass</code><br>method name: <code>mySinkMethod()</code><br>pattern: <code>com.privado.MySinkClass.mySinkMethod</code><br><br>Example: Mark all methods from a known class<br>class name: <code>com.privado.MySinkClass</code><br>method one: <code>mySinkMethod1()</code><br>method two: <code>mySinkMethod2()</code><br>pattern: <code>com.privado.MySinkClass.\*</code><br><br>Example: Mark a specific method across the classes<br>class name: <code>com.privado.MySinkClass</code><br>method one: <code>mySinkMethod()</code><br>class name: <code>com.privado.MySinkClass2</code><br>method one: <code>mySinkMethod()</code><br>pattern: <code>.\*mySinkMethod</code></p> |
| `tags`     | <p>It's an object of key-value pairs. This is useful to group and filter data leakages.<br>Example: you can tag applicable laws for the data leakages.<br><br><code>tags:</code><br><code>laws: GDPR, HIPAA</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

High level key is `sinks` which is an array of storages. Once the storage `sink` object is defined, we can add it to the array of sinks.

For a new vendor, you can create sub-directory with the vendor name under directory `rules/sinks/storages/`. You can create a language specific file - `java.yaml` and add the storage sink definition to it.

Once the new storage sink is added, Privado will detect and track data flows to this storage sink.
