> ## Documentation Index
> Fetch the complete documentation index at: https://tyk.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Default Secrets Configuration Reference

> Tyk packages, Docker images and Helm charts ship with sample values for secrets, so that a new installation starts without extra configuration. This page lists the secrets for each Tyk component that you must change when deploying to production.

For the steps to change these secrets, start at [Planning for Production](https://tyk.io/docs/planning-for-production.md#change-all-the-shared-secrets).

## Tyk Gateway

| Field | Environment variable | When to change | Description |
| :- | :- | :- | :- |
| [secret](https://tyk.io/docs/tyk-oss-gateway/configuration.md#secret) | `TYK_GW_SECRET` | Always | Set the same value as `tyk_api_config.secret` in Tyk Dashboard. Tyk Gateway writes the sample value to a new configuration file when it starts without one. |
| [node\_secret](https://tyk.io/docs/tyk-oss-gateway/configuration.md#node_secret) | `TYK_GW_NODESECRET` | Always, including deployments without Tyk Dashboard | Set the same value as `shared_node_secret` in Tyk Dashboard. |
| [security.private\_certificate\_encoding\_secret](https://tyk.io/docs/tyk-oss-gateway/configuration.md#security-private_certificate_encoding_secret) | `TYK_GW_SECURITY_PRIVATECERTIFICATEENCODINGSECRET` | Before you add certificates to the [Tyk Certificate Store](https://tyk.io/docs/api-management/certificates.md#encryption-of-the-private-key) | When it is empty, Tyk Gateway uses `secret`. Set the same value in Tyk Gateway, Tyk Dashboard and Tyk MDCB. See [Change the API Secret Safely](#change-the-api-secret-safely). |
| [storage.password](https://tyk.io/docs/tyk-oss-gateway/configuration.md#storage-password) | `TYK_GW_STORAGE_PASSWORD` | When your Redis requires a password | |

## Tyk Dashboard

| Field | Environment variable | When to change | Description |
| :- | :- | :- | :- |
| [admin\_secret](https://tyk.io/docs/tyk-dashboard/configuration.md#admin_secret) | `TYK_DB_ADMINSECRET` | Always | It gives full access to the [Tyk Dashboard Admin API](https://tyk.io/docs/dashboard-admin-api.md). |
| [tyk\_api\_config.secret](https://tyk.io/docs/tyk-dashboard/configuration.md#tyk_api_config-secret) | `TYK_DB_TYKAPI_SECRET` | Always | Set the same value as `secret` in Tyk Gateway. |
| [shared\_node\_secret](https://tyk.io/docs/tyk-dashboard/configuration.md#shared_node_secret) | `TYK_DB_NODESECRET` | Always | Set the same value as `node_secret` in Tyk Gateway. |
| [portal\_session\_secret](https://tyk.io/docs/tyk-dashboard/configuration.md#portal_session_secret) | `TYK_DB_PORTALSESSIONSECRET` | If you use the Classic Portal | When it is empty, Tyk Dashboard uses a built-in value. |
| [identity\_broker.host.secret](https://tyk.io/docs/tyk-dashboard/configuration.md#identity_broker-host-secret) | `TYK_DB_TIB_HOST_SECRET` | If you use an external Tyk Identity Broker | Set the same value as the secret in TIB. |
| None (environment variable only) | `TYK_IB_SESSION_SECRET` | If you use single sign-on through the TIB inside Tyk Dashboard | When it is empty, Tyk Dashboard uses `admin_secret` and logs a notice. |
| [security.private\_certificate\_encoding\_secret](https://tyk.io/docs/tyk-dashboard/configuration.md#security-private_certificate_encoding_secret) | `TYK_DB_SECURITY_PRIVATECERTIFICATEENCODINGSECRET` | Before you add certificates | When it is empty, Tyk Dashboard uses `tyk_api_config.secret`. Set the same value in Tyk Gateway, Tyk Dashboard and Tyk MDCB. |
| [redis\_password](https://tyk.io/docs/tyk-dashboard/configuration.md#redis_password) | `TYK_DB_REDISPASSWORD` | When your Redis requires a password | |
| [storage.main.connection\_string](https://tyk.io/docs/tyk-dashboard/configuration.md#storage-main-connection_string) | `TYK_DB_STORAGE_MAIN_CONNECTIONSTRING` | When your MongoDB or PostgreSQL requires credentials | |

### Admin User From the Setup Script

The script `/opt/tyk-dashboard/install/bootstrap.sh` creates a Tyk Dashboard user with a fixed password, which is the same in every installation. If you use this script, change the password of that user after you log in for the first time.

The script calls the Tyk Dashboard Admin API with the sample value of `admin_secret`. If you change `admin_secret` before you run the script, edit the script first, or create the first user in the Tyk Dashboard UI.

## Tyk MDCB

Tyk MDCB does not ship sample secrets. Set these values before you go to production.

| Field | Environment variable | When to change | Description |
| :- | :- | :- | :- |
| `security.secret` | `TYK_MDCB_SECURITY_SECRET` | If you set `security.enable_http_secure_endpoints` to `true` | Tyk MDCB does not start if the endpoints are enabled and the secret is empty. |
| [security.private\_certificate\_encoding\_secret](https://tyk.io/docs/tyk-multi-data-centre/mdcb-configuration-options.md#security-private_certificate_encoding_secret) | `TYK_MDCB_SECURITY_PRIVATECERTIFICATEENCODINGSECRET` | If you use the Tyk Certificate Store | Set the same value as Tyk Gateway and Tyk Dashboard in the Control Plane. Tyk MDCB does not fall back to another value. |
| [storage.password](https://tyk.io/docs/tyk-multi-data-centre/mdcb-configuration-options.md#storage-password) | `TYK_MDCB_STORAGE_PASSWORD` | When your Redis requires a password | |
| [analytics.connection\_string](https://tyk.io/docs/tyk-multi-data-centre/mdcb-configuration-options.md#analytics-connection_string) | `TYK_MDCB_ANALYTICSCONFIG_CONNECTIONSTRING` | When your analytics database requires credentials | |

## Tyk Pump

Tyk Pump does not ship sample secrets. Set the credentials for each data store that it uses.

| Field | Environment variable | When to change | Description |
| :- | :- | :- | :- |
| [analytics\_storage\_config.password](https://tyk.io/docs/tyk-pump/tyk-pump-configuration/tyk-pump-environment-variables.md#analytics_storage_config-password) | `TYK_PMP_ANALYTICSSTORAGECONFIG_PASSWORD` | When your Redis requires a password | |
| [pumps.\<name>.meta](https://tyk.io/docs/tyk-pump/tyk-pump-configuration/tyk-pump-environment-variables.md#pumps) | `TYK_PMP_PUMPS_<NAME>_META_...` | For each pump whose data store requires credentials | |

## Tyk Developer Portal

| Field | Environment variable | When to change | Description |
| :- | :- | :- | :- |
| [PortalAPISecret](https://tyk.io/docs/product-stack/tyk-enterprise-developer-portal/deploy/configuration.md#portal_api_secret) | `TYK_PORTAL_PORTALAPISECRET` or `PORTAL_API_SECRET` | Always | If you use a standalone TIB, set the same value in its profile. |
| [JwtSigningKey](https://tyk.io/docs/product-stack/tyk-enterprise-developer-portal/deploy/configuration.md#portal_jwtsigningkey) | `TYK_PORTAL_JWTSIGNINGKEY` | Always | Use at least 32 characters, and the same value on every Portal instance. |
| [Database.ConnectionString](https://tyk.io/docs/product-stack/tyk-enterprise-developer-portal/deploy/configuration.md#portal_database_connectionstring) | `PORTAL_DATABASE_CONNECTIONSTRING` | When your database requires credentials | |
| [S3.AccessKey](https://tyk.io/docs/product-stack/tyk-enterprise-developer-portal/deploy/configuration.md#portal_s3_aws_access_key_id), [S3.SecretKey](https://tyk.io/docs/product-stack/tyk-enterprise-developer-portal/deploy/configuration.md#portal_s3_aws_secret_access_key) | `PORTAL_S3_AWS_ACCESS_KEY_ID`, `PORTAL_S3_AWS_SECRET_ACCESS_KEY` | If you store assets in S3 | |

## Tyk AI Studio

The Linux packages install `/etc/default/tyk-ai-studio` with placeholder values. The AI Studio Helm chart leaves the same values empty.

| Environment variable | When to change | Description |
| :- | :- | :- |
| [TYK\_AI\_SECRET\_KEY](https://tyk.io/docs/ai-management/ai-studio/ai-studio-env.md#tyk_ai_secret_key) | Always | When it is empty, AI Studio stores secrets such as LLM API keys without encryption. AI Studio accepts the placeholder value. |
| [GRPC\_AUTH\_TOKEN](https://tyk.io/docs/ai-management/ai-studio/ai-studio-env.md#grpc_auth_token) | If you use Edge Gateways | Set the same value as `EDGE_AUTH_TOKEN` on each Edge Gateway. AI Studio accepts the placeholder value. |
| `MICROGATEWAY_ENCRYPTION_KEY` | If you use Edge Gateways | Use exactly 32 characters, and the same value as `ENCRYPTION_KEY` on each Edge Gateway. |

Some example `.env` files in the AI Studio repository contain sample encryption keys of exactly 32 characters. AI Studio and Edge Gateways accept these values. Do not copy them into a deployment.

The AI Studio Helm chart also has these defaults:

| Value | Default | Description |
| :- | :- | :- |
| `database.password` | Sample value | The database password. The chart puts the database URL, with this password, in a ConfigMap. |
| `config.allowRegistrations` | `"true"` | Lets anyone who can reach AI Studio register a user. |
| `config.grpcTlsInsecure` | `"true"` | Disables TLS on the connection between AI Studio and Edge Gateways. |

For the AI Studio settings, see [AI Studio Environment Variables](https://tyk.io/docs/ai-management/ai-studio/ai-studio-env.md).

## Tyk Helm Charts

The Tyk Helm charts do not generate secrets, with one exception: the Tyk Dashboard admin password, when you set it to an empty value. Set these values, or supply them from Kubernetes Secrets.

| Value | Default | Becomes |
| :- | :- | :- |
| `global.secrets.APISecret` | Sample value | `TYK_GW_SECRET`, `TYK_GW_NODESECRET`, `TYK_DB_TYKAPI_SECRET` and `TYK_DB_NODESECRET`. In the `tyk-oss` chart, also the API secret that Tyk Operator uses. |
| `global.secrets.AdminSecret` | Sample value | `TYK_DB_ADMINSECRET` |
| `global.adminUser.email`, `global.adminUser.password` | Sample values | The first Tyk Dashboard user, and the first Developer Portal admin user. The chart generates a random Tyk Dashboard password only when `password` is empty. |
| `tyk-mdcb.mdcb.security.secret` | Sample value | `TYK_MDCB_SECURITY_SECRET` |
| `global.tls.useDefaultTykCertificate` | `true` | When TLS is enabled for Tyk Gateway (`global.tls.gateway: true`), the chart uses a sample certificate and private key that are included in the chart. Set it to `false` and give your own certificate in `tyk-gateway.gateway.tls.secretName`. |
| `global.redis.pass` | Empty | The Redis password |
| `global.postgres.user`, `global.postgres.password`, `global.postgres.sslmode` | `postgres`, no password, `disable` | The PostgreSQL connection of Tyk Dashboard, Tyk MDCB and Tyk Pump |
| `global.mongo.mongoURL` | `mongodb://mongo.<namespace>.svc:27017/tyk_analytics` when it is not set | The MongoDB connection, with no credentials |
| `tyk-dev-portal.storage.s3.awsAccessKeyid`, `tyk-dev-portal.storage.s3.awsSecretAccessKey` | Placeholder values | The S3 credentials of the Developer Portal |

### Supply Helm Values From Kubernetes Secrets

Create the Kubernetes Secret first, then refer to it in your values file. When you refer to a Secret, the chart ignores the plain-text value.

| Values field | Keys in the Kubernetes Secret |
| :- | :- |
| `global.secrets.useSecretName` | `APISecret`, `AdminSecret`, `DashLicense`, `OperatorLicense` |
| `global.adminUser.useSecretName` | `adminUserFirstName`, `adminUserLastName`, `adminUserEmail`, `adminUserPassword` |
| `tyk-mdcb.mdcb.useSecretName` | `MDCBLicense`, `securitySecret` |
| `global.remoteControlPlane.useSecretName` (`tyk-data-plane`) | `orgId`, `userApiKey`, `groupID` |
| `global.remoteControlPlane.connectionStringSecretName` (`tyk-data-plane`) | The key in `connectionStringSecretKey`, default `connectionString` |
| `tyk-dev-portal.useSecretName` | `DevPortalLicense`, `DevPortalDatabaseConnectionString`, `DevPortalAwsAccessKeyId`, `DevPortalAwsSecretAccessKey` |
| `tyk-dev-portal.storage.s3.secretRef` | `name`, with the keys in `accessKeyIdKey` and `secretAccessKeyKey` |
| `global.redis.passSecret` | `name`, with the key in `keyName`, default `redisPass` |
| `global.mongo.connectionURLSecret` | `name`, with the key in `keyName`, default `mongoURL` |
| `global.postgres.connectionStringSecret` | `name`, with the key in `keyName`, default `pgConnectionString` |
| `tyk-gateway.gateway.tls.secretName`, `tyk-dashboard.dashboard.tls.secretName`, `tyk-mdcb.mdcb.tls.secretName` | A Kubernetes TLS Secret |

For example, to supply the API secret and the admin secret:

```bash theme={null}
kubectl create secret generic tyk-secrets -n tyk \
  --from-literal=APISecret="$(openssl rand -hex 32)" \
  --from-literal=AdminSecret="$(openssl rand -hex 32)" \
  --from-literal=DashLicense="$TYK_DASHBOARD_LICENSE"
```

```yaml theme={null}
global:
  secrets:
    useSecretName: "tyk-secrets"
```

For more detail, see the chart pages: [tyk-stack](https://tyk.io/docs/product-stack/tyk-charts/tyk-stack-chart.md), [tyk-control-plane](https://tyk.io/docs/product-stack/tyk-charts/tyk-control-plane-chart.md), [tyk-data-plane](https://tyk.io/docs/product-stack/tyk-charts/tyk-data-plane-chart.md) and [tyk-oss](https://tyk.io/docs/product-stack/tyk-charts/tyk-oss-chart.md).

## Change the API Secret Safely

When `security.private_certificate_encoding_secret` is empty, Tyk Gateway encrypts the private keys in the Tyk Certificate Store with `secret`, and Tyk Dashboard uses `tyk_api_config.secret`. If you change the API secret, Tyk can no longer read the private keys that it stored before.

To change the API secret on an existing installation:

1. Set `security.private_certificate_encoding_secret` to the current value of `secret` in Tyk Gateway, Tyk Dashboard and Tyk MDCB.
2. Restart the components.
3. Change `secret` in Tyk Gateway and `tyk_api_config.secret` in Tyk Dashboard to the new value.
4. Restart the components.

On a new installation, set `security.private_certificate_encoding_secret` to its own random value before you add certificates.
