hosting-handbook icon indicating copy to clipboard operation
hosting-handbook copied to clipboard

Security page changes (7): Cache (Object)

Open javiercasares opened this issue 4 years ago • 1 comments

Some minor changes.

OLD TEXT:

Object Caching Security

There are several solutions for providing database object caching for WordPress. Each comes with its own configuration requirements for providing a secure environment while using database object caching.

Redis

Redis is a lightweight, high-performance key-value database server commonly used to cache the results from WordPress database queries. In its default configuration, Redis uses a single database and does not require a username and password to access the database. Redis should also only be accessible from authorized network hosts.

Redis databases

Redis provides 16 databases, number 0 to 15 by default. Redis clients should be configured to use different databases instead of the default database (number 0). Redis can be configured to have additional databases, but that is outside the scope of this document.

Redis user credentials

If Redis is going to be used for database object caching, the Redis server should be configured to require access credentials.

Redis network hosts

The Redis server in its default configuration listens on port 6379. The port can be changed in Redis's configuration, but whatever port is used should be protected by a firewall to prevent unauthorized access.

Redis cache key salt

If using Redis for database object caching, using a unique Redis cache key salt will help prevent cache collisions -- when two websites try to cache content using the same key. Cache collisions can result in websites accessing the cached data for other websites and can cause other undesirable and unexpected behaviors. The Redis cache key salt is usually configured through the Redis caching plugin or Redis client used to enable Redis database object caching in WordPress websites.

Memcached

Memcached is a memory object caching solution commonly used to provide database object caching for WordPress. One of the most important configuration concerns for memcached is preventing memcached from being accessed by the public internet. Putting memcached servers behind a firewall is one of the most important parts of using memcached securely for WordPress database object caching.

NEW PROPOSAL:

Object Caching Security

Redis

In its default configuration Redis uses a single database and does not require a username and password to access the database. Redis should be accessible only from authorized network hosts.

Databases

Redis provides 16 databases, (number 0 to 15 by default). Redis clients must be configured to use different databases instead of the default database (number 0).

Credentials

If Redis is to be used for caching database objects, the Redis server must be configured to require access credentials.

Port

The Redis server in its default configuration listens on port 6379. The port can be changed in the Redis configuration, but any port used must be protected by a firewall to prevent unauthorized access.

Random key

If you use Redis for caching database objects, the use of a single Redis cache key will help avoid cache collisions when two websites try to cache content using the same key. Cache collisions can result in Web sites accessing cached data from other Web sites and can cause other unexpected behavior.

The random key is usually set through the Redis cache plugin used to enable object caching. Also, can be configured on the wp-config.php.

define( 'WP_CACHE_KEY_SALT', random_thing_here' );

Memcached

Memcached is a memory object caching solution.

One of the most important configuration concerns for memcached is preventing memcached from being accessed through the public Internet. Putting memcached servers behind a firewall is one of the most important parts of using memcached securely for caching WordPress database objects.

javiercasares avatar Jun 06 '20 07:06 javiercasares

#15

javiercasares avatar Jun 06 '20 07:06 javiercasares

Moved to https://github.com/WordPress/Advanced-administration-handbook/issues/159

javiercasares avatar Feb 17 '23 07:02 javiercasares