-
Notifications
You must be signed in to change notification settings - Fork 260
feat(key-manager): add documentation for GA #4169
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
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
10b521c
docs(key-manager): add doc
nerda-codes fbe799c
docs(key-manager): add
nerda-codes d746a49
docs(key-manager): dates & menu
nerda-codes 3aea8a0
docs(key-manager): seo descriptions
nerda-codes 914e676
docs(km): add missing page
nerda-codes 95b9516
docs(key-manager): change schema
nerda-codes 3dadd46
docs(key-manager): reviews bene & lulu
nerda-codes 2ee29a5
docs(key-manager): add info about petry + feedback cyril
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
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,39 @@ | ||
| --- | ||
| meta: | ||
| title: Key Manager FAQ | ||
| description: Explore Scaleway Key Manager with our comprehensive FAQ covering security, key types, and more. | ||
| content: | ||
| h1: Key Manager | ||
| dates: | ||
| validation: 2025-01-06 | ||
| category: identity-and-access-management | ||
| productIcon: KeyManagerProductIcon | ||
| --- | ||
|
|
||
| ## Why should you use Scaleway Key Manager? | ||
|
|
||
| Key Manager helps organizations achieve secure key management by handling low-level and error-prone cryptographic details for you. | ||
|
|
||
| ## What features does Scaleway Key Manager include? | ||
|
|
||
| Scaleway Key Manager allows you to create, manage and use cryptographic keys in a centralized and secure service. All your cryptographic operations can be delegated to Key Manager, which in turn ensures the security and availability of your keys. | ||
|
|
||
| ## Which management methods can I use with Key Manager? | ||
|
|
||
| Read our [dedicated documentation](/identity-and-access-management/key-manager/reference-content/understanding-key-manager/#management-methods-you-can-use-with-key-manager) to find out about the management methods Key Manager provides. | ||
|
|
||
| ## Which cryptographic operations does Key Manager support? | ||
|
|
||
| Key Manager supports the three following cryptographic operations: | ||
|
|
||
| - [Encryption](/identity-and-access-management/key-manager/concepts/#encryption) | ||
| - [Decryption](/identity-and-access-management/key-manager/concepts/#decryption) | ||
| - [Data encryption key](/identity-and-access-management/key-manager/concepts/#data-encryption-key-dek) generation | ||
|
|
||
| ## Which algorithms and key usage does Key Manager support? | ||
|
|
||
| <Macro id="encryption" /> | ||
|
|
||
| Keys with a [key usage](/identity-and-access-management/key-manager/concepts/#key-usage) set to `symmetric_encryption` are **used to encrypt and decrypt data**. | ||
|
|
||
| Refer to our [dedicated documentation](/identity-and-access-management/key-manager/reference-content/understanding-key-manager/) to find out more about Key Manager. |
79 changes: 79 additions & 0 deletions
79
identity-and-access-management/key-manager/api-cli/create-dek-api-cli.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,79 @@ | ||
| --- | ||
| meta: | ||
| title: Creating a data encryption key using the Scaleway API and the Scaleway CLI | ||
| description: Learn how to generate a data encryption key (DEK) using the Scaleway CLI or API, leveraging Key Manager with AES encryption for secure data handling. | ||
| content: | ||
| h1: Creating a data encryption key using the Scaleway API and the Scaleway CLI | ||
| paragraph: Learn how to generate a data encryption key (DEK) using the Scaleway CLI or API, leveraging Key Manager with AES encryption for secure data handling. | ||
| tags: key-management dek data-encryption-key cli sdk api encryption | ||
| dates: | ||
| validation: 2025-01-06 | ||
| posted: 2025-01-06 | ||
| categories: | ||
| - identity-and-access-management | ||
| --- | ||
|
|
||
| <Macro id="requirements" /> | ||
|
|
||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - Created a key encryption key either from the [Scaleway console](/identity-and-access-management/key-manager/how-to/create-km-key) or the [Key Manager API](https://www.scaleway.com/en/developers/api/key-manager/#path-keys-create-a-key) | ||
| - Retrieved your key encryption key's ID | ||
| - Created an [API key](/identity-and-access-management/iam/how-to/create-api-keys/) | ||
| - Downloaded and configured the [Scaleway CLI](https://github.com/scaleway/scaleway-cli?tab=readme-ov-file#getting-started) | ||
|
|
||
| ## Generate a DEK using the Scaleway CLI | ||
|
|
||
| 1. Open a terminal and paste the following commands to export your environment variables. Make sure that you replace the placeholder values with your own. | ||
| ```bash | ||
| export SCW_ACCESS_KEY=<SCALEWAY_API_ACCESS_KEY> | ||
| export SCW_SECRET_KEY=<SCALEWAY_API_SECRET_KEY> | ||
| export SCW_DEFAULT_ORGANIZATION_ID=<SCALEWAY_ORGANIZATION_ID> | ||
| export SCW_PROJECT_ID=<SCALEWAY_PROJECT_ID> | ||
| export SCW_DEFAULT_REGION="fr-par" | ||
| export SCW_API_URL="https://api.scaleway.com" | ||
| ``` | ||
|
|
||
| 2. Paste the following command to generate a data encryption key via the Scaleway CLI. Make sure that you replace `<your_kek_id>` with the ID of your key encryption key. | ||
| ```bash | ||
| scw keymanager key generate-data-key key-id=<your_kek_id> algorithm=aes_256_gcm | ||
| ``` | ||
|
|
||
| An output similar to the following should display: | ||
| ```bash | ||
| KeyID <kek_id> | ||
| Algorithm <algorithm_used_to_encrypt_your_key> | ||
| Ciphertext <your_base64_encrypted_dek> | ||
| Plaintext <your_base64_decrypted_dek> | ||
| CreatedAt <creation_date> | ||
| ``` | ||
|
|
||
| <Message type="important"> | ||
| For convenience, Key Manager returns the plaintext version of the DEK, but it should never be stored in this form. Storing the decrypted plaintext of your DEK undermines the security provided by Key Manager, rendering it ineffective. | ||
| </Message> | ||
|
|
||
| ## Generate a DEK using the API | ||
|
|
||
| Paste the following command to create your data encryption key via the Key Manager API. Make sure that you replace the placeholder values with your own. | ||
| ```bash | ||
| curl --location 'https://api.scaleway.com/key-manager/v1alpha1/regions/fr-par/keys/<your_key_id>/generate-data-key' \ | ||
| --header 'Content-Type: application/json' \ | ||
| --header 'X-Auth-Token: <your_secret_key>' \ | ||
| --data '{ | ||
| "algorithm": "aes_256_gcm" | ||
| }' | ||
| ``` | ||
|
|
||
| Key Manager also supports the `GenerateDataKey` request without a plaintext operation, which only returns an encrypted data encryption key. | ||
|
|
||
| If you need to use your DEK, you can decrypt it using the [Decrypt data operation](https://www.scaleway.com/en/developers/api/key-manager/#path-keys-decrypt-data) specifying the `kek_id` parameter used to encrypt it. | ||
|
|
||
| **Key Manager does not handle direct data encryption**. It is specifically designed to **encrypt and decrypt Data Encryption Keys (DEKs) and is limited to processing inputs up to 64KB in size**. | ||
|
|
||
| However, you can use the DEK independently from Key Manager, for example with the [Tink extension](/encrypt-decrypt-dek-/#encrypt-and-decrypt-data-with-tink-and-key-manager) or with [OpenSSL](/encrypt-decrypt-dek/#manually-encrypt-and-decrypt-data-with-a-key-manager-dek). | ||
|
|
||
| <Message type="important"> | ||
| The way the KEK is generated, its length, and the encryption algorithm used, **cannot be changed or customized after creation**. However, unlike the KEK, you have the flexibility to choose any encryption algorithm (cipher) you prefer for encrypting and decrypting your data with the DEK. You are not restricted to a specific encryption method for the data itself. | ||
| **We highly recommend that you use standard and well-established ciphers (and the proper mode), as well as a library like Tink, that chooses the right cryptosystem according to your use-case.** | ||
| </Message> | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
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.