-
Notifications
You must be signed in to change notification settings - Fork 243
docs(km): add docs on cryptographic details #4940
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
4bd3790
docs(km): add docs on cryptographic details
enzzc 61eb5f7
docs(review): review neda
nerda-codes c8fa359
Update cryptographic-details-key-manager.mdx
nerda-codes 20d2522
Update pages/key-manager/reference-content/cryptographic-details-key-…
nerda-codes f570f9a
Update pages/key-manager/reference-content/cryptographic-details-key-…
nerda-codes a95ad5a
Merge branch 'scaleway:main' into main
enzzc 673bde5
Apply suggestions from code review
nerda-codes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
pages/key-manager/reference-content/cryptographic-details-key-manager.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
meta: | ||
title: Cryptographic details of Scaleway Key Manager | ||
description: This page describes the cryptographic mechanisms used by Scaleway Key Manager, in accordance with ANSSI-PA-079 recommendations. | ||
content: | ||
h1: Cryptographic details of Scaleway Key Manager | ||
paragraph: This page describes the cryptographic mechanisms used by Scaleway Key Manager, in accordance with ANSSI-PA-079 recommendations. | ||
tags: key-manager security | ||
categories: | ||
- identity-and-access-management | ||
dates: | ||
validation: 2025-05-12 | ||
posted: 2025-05-12 | ||
--- | ||
|
||
## Cryptographic primitives in Scaleway Key Manager | ||
|
||
This page provides information on the core cryptographic mechanisms used by Key Manager. It explains how cryptographic keys are generated, managed, and used to encrypt data. Key Manager uses cryptographic mechanisms in compliance with cryptographic guidelines issued by [France's national cybersecurity agency](https://cyber.gouv.fr/) in the ANSSI-PA-079 recommendations. to ensure the confidentiality and integrity of customer data. | ||
|
||
### Random number generation | ||
|
||
#### Key encryption key (KEK) generation | ||
|
||
Scaleway Key Manager uses a **C**ryptographically **S**ecure **P**seudorandom **N**umber **G**enerator (CSPRNG) to generate both keying material for managed keys and cryptographically unique initialization vectors (IVs). | ||
|
||
This CSPRNG is based on the ChaCha-based pseudorandom number generator provided by modern Linux kernels. It is seeded with high-entropy, unpredictable sources, such as: | ||
|
||
- Timing variations from hardware events | ||
- True Random Number Generators (TRNGs), including the `RDSEED` and `RDRAND` instructions available on AMD64 processors | ||
|
||
<Message type="note"> | ||
The section above is in compliance with [ANSSI-PA-079 Recommendation R14](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf), which mandates the use of a cryptographically secure and appropriately seeded pseudorandom generator for key and IV material. | ||
</Message> | ||
|
||
<Message type="important"> | ||
The information above applies only to keys generated by Key Manager. If you import a key using the Bring Your Own Key (BYOK) mechanism, these safeguards are not applied to your key material. | ||
</Message> | ||
|
||
|
||
#### Customer-provided KEKs (BYOK) | ||
|
||
Scaleway Key Manager supports Bring Your Own Key (BYOK), allowing customers to import their own key material. In this model, Scaleway does not generate keys on behalf of the customer. Instead, the responsibility for generating strong key material lies with the user. | ||
|
||
To protect against direct reuse, imported key material is not used directly. Instead, it is processed using the HKDF algorithm (HMAC-based Key Derivation Function) with SHA-256 as the hash algorithm, incorporating secure random bytes added as a salt value. | ||
|
||
### Symmetric encryption | ||
|
||
Scaleway Key Manager uses **AES-256-GCM** (AES with a 256-bit key in Galois/Counter Mode) with authenticated associated data (AEAD) for encrypting and decrypting user payloads. | ||
|
||
To reduce the risk of key overuse, plaintext payloads are limited to a maximum size of 64 KiB. a unique 96-bit initialization vector (IV) is generated using the CSPRNG described in the section above. | ||
nerda-codes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<Message type="note"> | ||
The section above is in compliance with ANSSI-PA-079 Recommendations R1, R4, and R12 regarding the choice of secure, authenticated symmetric encryption (R1), key and IV uniqueness (R4), and payload size limitations and proper use of AEAD modes (R12). Refer to the ANSSI-PA-079 recommendations [documentation](https://cyber.gouv.fr/sites/default/files/2021/03/anssi-guide-selection_crypto-1.0.pdf) for more details. | ||
nerda-codes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</Message> | ||
|
||
<Message type="important"> | ||
While Key Manager internally uses AES-256-GCM, this does not restrict users to the same algorithm for their data encryption keys (DEKs). | ||
We recommend using cryptographic libraries like Tink, which handle DEK management with robust and reviewed algorithms. | ||
Scaleway provides Tink integrations for Go and Python, which is the preferred integration method. | ||
|
||
- [Tink Python integration](https://github.com/scaleway/tink-py-scwkms) | ||
- [Ting Go integration](https://github.com/scaleway/tink-go-scwkms) | ||
|
||
</Message> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.