Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(backups): encryption algorithms #8266

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

thomas-dkmt
Copy link
Contributor

Explain how backups are encrypted by Xen Orchestra, what each encryption algorithm (AES-256-GCM and ChaCha20-Poly1305) does, and how it works with Amazon S3.

Explain how backups are encrypted by Xen Orchestra,
what each encryption algorithm does,
and how it works with Amazon S3

Signed-off-by: Thomas Moraine <[email protected]>
@@ -26,6 +26,43 @@ Each backups' job execution is identified by a `runId`. You can find this `runId

![](./assets/log-runId.png)

## Backup Encryption

Xen Orchestra ensures robust data security for backups stored in Amazon S3 by leveraging advanced encryption algorithms. Here’s a closer look at how encryption works and the technology behind it:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encryption is compatible will all remotes, not only Amazon S3.

Encryption is opt-in and requires configuring an encryption key on the remote (page Settings/Remotes), I think we should show that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 6587b3a


Currently, backups use the `AES-256-GCM` encryption algorithm. While this is a highly secure option, it does have a file size limitation of 64 GiB. This isn’t an issue when working with Amazon S3, as the data is split into smaller blocks, making it fully compatible with the platform.

In addition, this algorithm is fully compliant with [ANSSI guidelines](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In addition, this algorithm is fully compliant with [ANSSI guidelines](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf).
In addition, this algorithm is fully compliant with [ANSSI guidelines 🇫🇷](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by e4be723.

Replaced the flag with a 'French' label. Flags aren't good practice, as per https://www.flagsarenotlanguages.com/


### Current Encryption Algorithm: `AES-256-GCM`

Currently, backups use the `AES-256-GCM` encryption algorithm. While this is a highly secure option, it does have a file size limitation of 64 GiB. This isn’t an issue when working with Amazon S3, as the data is split into smaller blocks, making it fully compatible with the platform.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Currently, backups use the `AES-256-GCM` encryption algorithm. While this is a highly secure option, it does have a file size limitation of 64 GiB. This isn’t an issue when working with Amazon S3, as the data is split into smaller blocks, making it fully compatible with the platform.
Currently, backups use the [`AES-256-GCM`](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) encryption algorithm. While this is a highly secure option, it does have a file size limitation of 64 GiB. This isn’t an issue when working with Amazon S3, as the data is split into smaller blocks, making it fully compatible with the platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 259124a


To improve flexibility and performance, Xen Orchestra will transition to the `ChaCha20-Poly1305` encryption algorithm by February 2025. This update addresses the file size limitations of `AES-256-GCM` while maintaining a high level of security and compliance with ANSSI guidelines.

Backup repositories that were encrypted with `AES-256-GCM` will remain accessible, to ensure a smooth transition.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Backup repositories that were encrypted with `AES-256-GCM` will remain accessible, to ensure a smooth transition.
Backup repositories that were encrypted with `AES-256-GCM` will remain accessible, to ensure a smooth transition.
This algorithm is also fully compliant with [ANSSI guidelines 🇫🇷](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf).

Copy link
Contributor Author

@thomas-dkmt thomas-dkmt Jan 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by e4be723.

Replaced the flag with a 'French' label. Flags aren't good practice, as per https://www.flagsarenotlanguages.com


### Upcoming Change: `ChaCha20-Poly1305`

To improve flexibility and performance, Xen Orchestra will transition to the `ChaCha20-Poly1305` encryption algorithm by February 2025. This update addresses the file size limitations of `AES-256-GCM` while maintaining a high level of security and compliance with ANSSI guidelines.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To improve flexibility and performance, Xen Orchestra will transition to the `ChaCha20-Poly1305` encryption algorithm by February 2025. This update addresses the file size limitations of `AES-256-GCM` while maintaining a high level of security and compliance with ANSSI guidelines.
To improve flexibility and performance, Xen Orchestra will transition to the [`ChaCha20-Poly1305`](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) encryption algorithm by February 2025. This update addresses the file size limitations of `AES-256-GCM` while maintaining a high level of security and compliance with ANSSI guidelines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 259124a

Comment on lines 45 to 64
### How It Works

#### AES-256-GCM

`AES-256-GCM` is a symmetric-key cryptographic block cipher, which is a method for encrypting data that ensures both confidentiality and integrity.

This method uses a 256-bit secret key and a unique initialization vector (IV) to encrypt data with the AES algorithm, transforming it into unreadable blocks.
The "GCM" part (Galois/Counter Mode) adds a verification tag to detect any tampering with the encrypted data. To decrypt, the same key and IV are required, and the tag ensures the data hasn’t been altered.

It’s a fast and secure system, commonly used in applications like secure web browsing and messaging.

#### ChaCha20-Poly1305

`ChaCha20-Poly1305` is a stream cypher, which is a method for encrypting messages.

Stream cyphers generate a random-looking sequence of bits, called a keystream, that matches the length of the message. This keystream is created using a secret key and an additional starting value called an initialization vector (IV).

To encrypt the message, the cipher combines each bit of the message with the corresponding bit of the keystream using a simple XOR operation (a basic "bit-flipping" process).

The result is the encrypted message, or ciphertext. Modern stream ciphers are designed to ensure the keystream appears completely random, even if someone tries to manipulate the initialization vector.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it is quite interesting, I don't think it makes sense to put in our documentation. 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by afcdbd8

@thomas-dkmt thomas-dkmt force-pushed the doc-encryption-details branch from a77fdbf to 515c20b Compare January 23, 2025 18:09
@thomas-dkmt thomas-dkmt force-pushed the doc-encryption-details branch from 347e4ea to 259124a Compare January 23, 2025 18:10
@thomas-dkmt thomas-dkmt requested a review from julien-f January 23, 2025 18:11
2. Go to the section called **New file system remote**, or edit an existing remote.
3. In the subsection called **Encrypt all new data sent to this remote** you will find a text area. Enter your encryption key there.
4. Click the **Save configuration** Button to finish the encryption setup.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encryption is only compatible with block based remote. (Full backup don't care, but incremental backup will fail if not )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 4d784b0

Encryption is opt-in and requires configuring an encryption key on the remote.

1. Go to the Settings → Remote menu.
2. Go to the section called **New file system remote**, or edit an existing remote.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

encryption can't be changed if a remote contains any backup (either enabling/disabling of changing the key )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 4d784b0

### Current Encryption Algorithm: `AES-256-GCM`
Currently, backups use the [`AES-256-GCM`](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) encryption algorithm. While this is a highly secure option, it does have a file size limitation of 64 GiB. This isn't an issue when working with Amazon S3, as the data is split into smaller blocks, making it fully compatible with the platform.

In addition, this algorithm is fully compliant with [ANSSI guidelines (in French)](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this algorithm is authenticated, that means an additional metadata is put at the end of any saved file. This is used on restore to ensure that the data restored are exactly the data that were encrypted, thus detecting bit rot or a malicious attacker without the key. Note this is not a recoverable error, the file will be unusable
https://en.wikipedia.org/wiki/Authenticated_encryption

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by 4d784b0

Copy link
Contributor Author

@thomas-dkmt thomas-dkmt Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO : it's the same for the other algorithm


To improve flexibility and performance, Xen Orchestra will transition to the [`ChaCha20-Poly1305`](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) encryption algorithm by February 2025. This update addresses the file size limitations of `AES-256-GCM` while maintaining a high level of security and compliance with ANSSI guidelines.

Backup repositories that were encrypted with `AES-256-GCM` will remain accessible, to ensure a smooth transition.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as aes-256-gcm , chacha20-poly1305 is authenticated

docs/docs/backups.md Outdated Show resolved Hide resolved
thomas-dkmt and others added 3 commits January 24, 2025 10:23
Add requirements on block-based remotes
Warn that encryption can't be saved if remote contains a backup
Explain how authentication works with AES-256-GCM

Signed-off-by: Thomas Moraine <[email protected]>
Co-authored-by: Florent BEAUCHAMP <[email protected]>
@julien-f julien-f changed the title Doc(XO): Explain backup encryption algorithms docs(backups): encryption algorithms Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants