PostgreSQL differs from certain other databases as it lacks a native solution to encrypt data on disk transparently. At Percona, we are in the process of developing PG_TDE, a tool designed to encrypt data using the AES-CTR encryption algorithm. This code is currently under development, and we are seeking your assistance in testing it.

This blog will cover what you need to get PG_TDE running on a Ubuntu 22.04 LTS environment.

But first, some background information.

Transparent Data Encryption

PG_TDE is an experimental transparent data encryption access method for PostgreSQL 16 and beyond that I reviewed last October. There have been a lot of changes that covered in this post. This software is under active development. In the spirit of open and transparent communication, we would appreciate your feedback and invite PostgreSQL users to test the extension and provide feedback via the GitHub repository or in the forum.

We need your help

Transparent Data Encryption (TDE) offers encryption at the file level and solves the problem of protecting data at rest. This capability is available in other databases but not provided in upstream, vanilla Postgres.

Percona has received user feedback that this would be a feature, so we are working on this as an open-source extension for Postgres that anyone can deploy. Percona co-founder Peter Zaitsev’s blog on why PostgreSQL needs TDE highlights the technical and business reasons why you might want TDE. Since PostgreSQL doesn’t have TDE features yet, Percona will provide the TDE feature as an extension to PostgreSQL.

But we need your help. Transparent Data Encryption is a complex environment that needs extensive testing. Please download PG_TDE to a test machine, test the pg_tde, and let us know your experience – good, bad, or indifferent. Percona would like this code hammered as hard as possible to ensure it is robust and ready to become part of a future version of PostgreSQL. Please test.

Ubuntu and PG_TDE

You will need an Ubuntu 22.04 LTS system before you continue, and other similar Linux distros should work similarly. I also installed the ‘generic’ PostgreSQL from the Ubuntu distro. Percona has a wonderful distribution of PostgreSQL that I usually use, but I wanted to see if PG_TDE worked with Ubuntu.

The first step is to get PG_TDE. Please note that the documentation can be found at HERE.

Install the pgtde-pgdg16.deb

The needed libraries need to be preloaded, so login to your instance as postgres and issue the command:

Restart PostgreSQL

As postgres, log into your PostgreSQL instance and get ready to test.

Test

Let us start this test by creating a database and connecting to it.

I borrow heavily from the blog Using the Transparent Data Encryption Extension PG_TDE With PostgreSQL for the next several steps as they beautifully illustrate how to take advantage of PG_TDE. Please note in the first CREATE TABLE the use of ‘USING pg_tde’ to encrypt the data.

If you see an error message about the pg_tde access method missing, please use the following:

You might be asking yourself if there is any discernable difference when you request data from the encrypted version versus the unencrypted. Nope.

But you can use pgtde_is_encrypted(<table name>) to determine if the table is encrypted.

Please test

Percona is committed to delivering PG_TDE, but we need your help. The more instances of this software running and from which we get feedback, the better the product will be. This is your chance to help drive PostgreSQL forward by hammering on this code as hard as possible. This will also help keep you from being an ‘edge case’ where some obscure problem delays your ability to protect your data.

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments