docusaurus/platform_versioned_docs/version-1.7/understanding-airbyte/secrets.md
Airbyte store secrets in the configured secret persistence layer as Source and Destinations are created.
This page focuses on understanding how Airbyte uses secrets. Please refer to the Secret Management for more information on how to configure various secret persistence layers.
Airbyte stores configuration for various internal models as JSON blobs in the database. By declaring airbyte_secret = true, models mark sensitive fields
when defining their spec. Airbyte uses this property to understand which fields should be treated as secrets.
While this is most often seen in Connector configuration, this hold true for all models, including Platform models such as webhook configuration.
A secret field:
The last point is particularly important as a security best practice - it's possible to deploy Airbyte so users with deployment access do not have secret access. This increases Airbyte's deployment flexibility.
Airbyte obfuscates secrets within a spec by:
<airbyte-workspace>_<workspace-id>_secret_<uuid>_<version>. e.g. airbyte_workspace_024eaa40-75ae-4014-941d-b9e938c3a363_secret_5675437d-ea6b-4f9a-9a0c-d76066004841_v1.{
"email": { "type": "string" }
"api_token": { "type": "string" , "airbyte_secret": true}
}
and a corresponding raw json of:
{
"email":"[email protected]",
"api_token": "fake-token"
}
Airbyte saves the following JSON blob:
{
"email":"[email protected]",
"api_token":{
"_secret":"airbyte_workspace_4e7d7911-0307-40fe-9b79-f00c0dfbb082_secret_d66baab6-3c8d-4ae5-91a6-ca8d904c4780_v1"
}
}
Upon any operation, Airbyte reads the obfuscated JSON spec, extracts the secret coordinate and hydrates the correct secret value before passing it to consumers.
airbyte_workspace_024eaa40-75ae-4014-941d-b9e938c3a363_secret_5675437d-ea6b-4f9a-9a0c-d76066004841_v1 -> airbyte_workspace_024eaa40-75ae-4014-941d-b9e938c3a363_secret_5675437d-ea6b-4f9a-9a0c-d76066004841_v2.00000000-0000-0000-0000-000000000000. Whenever possible, Airbyte attempts to expire these secrets after 2 hours for security and cost reasons.