---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/concepts/datamodel/secrets.md
  - https://ydb.tech/docs/ru/concepts/datamodel/secrets.md
  - href: en/concepts/datamodel/secrets.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/concepts/datamodel/secrets.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Secrets

Various access credentials are used for authentication in external systems. These credentials are stored in separate objects called secrets. Secrets are only available for writing and updating; their values cannot be retrieved.
In YDB, secrets are used, for example, in [federated queries](https://ydb.tech/docs/en/concepts/query_execution/federated_query/index.md) and [data transfers](https://ydb.tech/docs/en/concepts/transfer.md).

## Syntax {#syntax}

The following YQL operators are used to manage secrets:

- [CREATE SECRET](https://ydb.tech/docs/en/yql/reference/syntax/create-secret.md) — create a secret.
- [ALTER SECRET](https://ydb.tech/docs/en/yql/reference/syntax/alter-secret.md) — modify an existing secret.
- [DROP SECRET](https://ydb.tech/docs/en/yql/reference/syntax/drop-secret.md) — delete a secret.

## Usage {#secret-usage}

Examples of using secrets and working with them are provided in the following sections:

* [Configuring Time to Live (TTL)](https://ydb.tech/docs/en/yql/reference/recipes/ttl.md)
* [Import and export of data to column tables](https://ydb.tech/docs/en/recipes/import-export-column-tables.md)

## Access management {#secret_access}

Secrets are schema objects, so rights to them are granted using the [GRANT](https://ydb.tech/docs/en/yql/reference/syntax/grant.md) command and revoked using the [REVOKE](https://ydb.tech/docs/en/yql/reference/syntax/revoke.md) command. To use a secret in a query, for example, when creating an [external data source](https://ydb.tech/docs/en/yql/reference/syntax/create-external-data-source.md) or [data transfer](https://ydb.tech/docs/en/yql/reference/syntax/create-transfer.md), the [right](https://ydb.tech/docs/en/yql/reference/syntax/grant.md#permissions-list) `SELECT ROW` is required.
