Sébastien Laframboise

Protect WordPress backups from unauthorized access

Protect WordPress backups from unauthorized access

To secure WordPress backups, it’s not enough to create them automatically or to copy them off the server. An archive can contain the site’s files, the database, accounts, forms, orders, or uploaded documents. If an unauthorized person obtains that copy, they can access data that should no longer be circulating.

Backup protection therefore addresses two distinct risks: unauthorized viewing and malicious deletion. You must protect the archive, the account that hosts it, the keys or passwords that allow its decryption, and the restore procedure.

Start by identifying what your backups expose

One a full backup usually gathers the files and the database into a single logical set. WordPress documentation even recommends treating these two elements as the same backup set, created at roughly the same time. See the WordPress backup guide to check what your procedure should cover.

Before changing your settings, open a recent archive in a controlled environment. Then make a short list of the data it contains:

  • administrative accounts and profile data;
  • private content, drafts, and unpublished media;
  • form submissions and email addresses;
  • order data, if your site uses a store;
  • settings, integration tokens, or other secrets stored by plugins.

This step helps you choose a realistic level of protection. The more sensitive information the archive contains, the fewer people should have access to it and the less it should be kept indefinitely.

Limit access before thinking about encryption

Encryption protects a lost or copied archive. However, it does not replace access control. If someone can open the destination account and use the decryption key, they can read the backup.

Use an account reserved for backups

Avoid sending archives to a personal account shared for other uses. Instead, create a storage space reserved for backups, with a separate account if your provider allows it. That way, a compromise of another service does not automatically give access to the archives.

Grant only the necessary rights. For example, the automated process should be able to deposit a new copy, but it doesn’t always need to delete the full history or change account settings. The principle of least privilege is precisely about giving only the essential rights for a task. WordPress also follows this logic with its roles and capabilities, as explained in its user documentation.

Likewise, review human access. Remove former collaborators, replace shared credentials, and record who can administer the backup destination. For this review, also use your method to manage inactive WordPress accounts and former access.

Protect the transfer path and storage space

When you upload or retrieve an archive from a server, favor an encrypted protocol offered by the host, such as SFTP. The WordPress hardening guide notes that SFTP encrypts credentials and data during transfer.

Also don’t leave a downloadable archive at a public address, even if its name seems hard to guess. An unprotected link can be forwarded, saved in history, or exposed by mistake. The destination should require authentication and restrict read rights to the people responsible.

Choose encryption that includes key management

Encryption is useful for protecting data at rest. However, it shouldn’t be treated as a simple check box. A serious solution must explain where it stores the key or password, who can access it, and how you’ll be able to restore an archive later.

The OWASP guide on encrypted storage recommends adding strong access controls around encrypted data. It also advises, when architecture allows, separating encryption keys from the data they protect.

Concretely, avoid keeping in the same folder or account:

  • the encrypted archive;
  • the password or key to open it;
  • notes explaining where to find these items.

If your backup tool offers an archive password, choose a unique secret and store it in a password manager or an appropriate secrets management mechanism. Don’t write it in a document shared with the archives. Also, plan a controlled procedure to retrieve it if the responsible person is absent.

Don’t develop your own encryption system. OWASP recommends using recognized and maintained mechanisms rather than homegrown algorithms. Your role is mainly to verify the actual functions of your plugin, host, or storage destination, and each party’s responsibilities.

Limit deletions and monitor sensitive actions

An attacker who compromises the site may try to delete backups before encrypting or altering data. An off-site copy remains useful, but it’s still vulnerable if the same account can modify the site and erase all history.

So maintain separation between site administration and destination administration. When your provider allows it, enable protections against modifying or deleting copies for a defined period. The WordPress hardening guide also cites encryption, an independent integrity log, and read-only media as ways to increase confidence in backups.

Enable available alerts for logins, deletions, permission changes, and backup failures. Then review those alerts at regular intervals. An ignored notification offers no real protection.

Retention also reduces exposure

Keeping too many archives increases the number of sensitive files an intruder could view. Conversely, keeping too few copies can prevent reverting to a healthy version. Define a retention period that considers your obligations, frequency of changes, and recovery needs.

Retention does not replace encryption. It rather shortens the period during which old data remains accessible. To balance the number of copies and their spread over time, consult the article on the WordPress backup retention policy.

Test restoring a protected copy

An encrypted archive that can no longer be opened won’t help you during an incident. You must therefore test restoration with the same protections used in a real situation. Do it in an isolated environment, never directly on the public site.

During the test, validate that you can access the archive, decrypt it, recover the files and data, and then open a functional version of the site. Also verify that the authorized person knows where to obtain the necessary rights without having to search an email inbox or request emergency access.

OWASP recommends regularly testing and auditing restoration procedures, encrypting backups, reducing storage rights, and monitoring unauthorized access. These measures are described in its guide on secrets management.

Before each trial, also ensure the copy is complete and recent. You can follow the proposed method to verify that a WordPress backup is complete and recent, then perform a scheduled restoration test.

Checklist to apply

  • Inventory the sensitive data present in each type of archive.
  • Use an account and destination reserved for backups.
  • Grant minimal rights to the automated process and to responsible individuals.
  • Encrypt archives when the risk warrants it, without storing the key with the data.
  • Protect transfers and avoid any public link to an archive.
  • Monitor deletions, failures, and access changes.
  • Apply retention proportional to the data and to your obligations.
  • Periodically test the full restoration of a protected copy.

A useful backup must remain available to you but useless to anyone else. By combining reduced rights, properly managed encryption, a separate destination, and regular tests, you significantly reduce the risk that an archive itself becomes a data leak.