Support for automatic backup encryption (GPG?)

Hi there,

I’m one of the IT officers of Pirate Party Australia, and last year set up a self-hosted Discourse instance for the party which has been going quite well. While we use the automated backup functionality, sadly we can’t use the built-in S3 upload functionality, as internal policy mandates that any data stored with third-party services must be encrypted locally.

While it’s not too difficult to simply write some external script invoked via cron to encrypt the backup archives then upload to S3 outside of Discourse, it’s admittedly a bit of a hack. Since Discourse itself supports automatic backups (& upload to S3), it’d be great if there was support for automatically encrypting (ideally via GPG, since that’s already widely used and due to its asymmetric nature, no passphrases would be required during back up operations) backup archives before uploading to S3.

Is there any possibility of such functionality being implemented?

6 Likes

Yeah we support such a change, if anyone feels like picking it up let us know. Otherwise, maybe for next release or the release after.

Word of advice: you (in particular) will likely want to rename, let’s say one backup a month, to a name that Discourse won’t auto-delete when it reaches the maximum daily backups limit, and mirror that selected one elsewhere.

Just breaking the date format should suffice to avoid the auto-deletion (e.g. 2015-02-11 into 2015_Feb or something like that).

You’ll also be able to be a bit more lax in where you put the backups, because they’re encrypted and the private key is offline.

(Further explaining that: Backups contain all the private messages and drafts stored on the server! Which is why there’s a standard admonishment to not let non-admins get backups.)

Two ideas to consider for the future:

Instead, why not let us run custom scripts after/before/during backup. That way we can customize it however we want.

Hi @sam

I know this post is a few years old but I was wondering if automatic encryption has been implemented?

Thanks

This is generally handled by the operating system, so files are automatically encrypted as they are written to the disk. It’s much easier to think about this way.

Internally for our hosting we do also encrypt each backup as an extra step in the process before shipping it to Amazon S3.

1 Like

Great thanks for your swift response :smile:

2 Likes