tyk.conf
and tyk_analytics.conf
files to include:
max_idle
value to something large, we usually leave it at around 2000
for HA deployments, and then set your max_active
to your upper limit (as in, how many additional connections over the idle pool should be used).
Protection of Redis data
Tyk uses Redis to store API tokens and OAuth clients, so it is advisable to not treat Redis instances as ephemeral. The exception to this is when you are using Tyk Multi Data Center Bridge, but you will still need to retain the master Redis instance.
You must ensure that Redis is persisted, or at least in a configuration where it is easy to restore or failover. So, for example, with Elasticache, making sure there are many read-replicas and regular snapshots can ensure that your data survives a failure.
Redis Encryption
Redis supports SSL/TLS encryption from version 6 as an optional feature, enhancing the security of data in transit. To configure TLS or mTLS connections between an application and Redis, consider the following settings in Tyk’s configuration files:
storage.use_ssl
: Set this to true to enable TLS encryption for the connection.
storage.ssl_insecure_skip_verify
: A flag that, when set to true, instructs the application not to verify the Redis server’s TLS certificate. This is not recommended for production due to the risk of man-in-the-middle
attacks.
storage.ca_file
: Path to the Certificate Authority (CA) file for verifying the Redis server’s certificate.
storage.cert_file
and storage.key_file
: Paths to your application’s certificate and private key files, necessary for mTLS where both parties verify each other’s identity.
storage.max_version
and storage.min_version
: Define the acceptable range of TLS versions, enhancing security by restricting connections to secure TLS protocols (1.2 or 1.3).
"use_ssl": true
, you encrypt the connection."ssl_insecure_skip_verify": true
bypasses the server’s certificate verification, suitable only for non-production environments.use_ssl
is set to true
.ssl_insecure_skip_verify
to false
to enforce certificate verification against the CA specified in ca_file
.ca_file
for server certificate verification.min_version
and max_version
to secure TLS versions, ideally 1.2 and 1.3.cert_file
and key_file
for your application’s TLS certificate and private key, enabling Redis server to verify your application’s identity.mongo-go
driver).mongo-go
driver has been available since Tyk 5.0.2 and is the default from Tyk 5.3.0.
mgo
driver which supported MongoDB 3.x to 4.4.x, but we no longer test MongoDB versions prior to 5.0 since they are EOL.main
part of the storage
section of your tyk-analytics.conf
:Migrating 'tyk_apis' collection. Records found: 7
.
mongo_url
(or TYK_DB_MONGOURL
environment variable) from your tyk-analytics.conf