---
title: Enabling server-side encryption with Key Management Service (SSE-KMS) using the AWS CLI
description: Enable server-side encryption with Key Management Service (SSE-KMS) for Scaleway Object Storage.
tags: object storage server side encryption sse kms cli scaleway own keys
dates:
  validation: 2026-06-04
  posted: 2026-06-04
---

This page explains how to use SSE-KMS with the AWS CLI. To use it with the Scaleway console, refer to the [dedicated documentation](/en/docs/object-storage/how-to/enable-sse-kms/).

**S**erver-**S**ide **E**ncryption with **K**ey **M**anagement **S**ervice (SSE-KMS) is an encryption-at-rest option for Object Storage that uses a Key Management Service to handle encryption keys. It allows you to encrypt data when it is uploaded, and decrypt it when accessed, with your organization managing encryption keys (AES-256-GCM) through Scaleway's [Key Manager](/en/docs/key-manager/concepts/).

When you use SSE-KMS, you set up a symmetric [key encryption key (KEK)](/en/docs/key-manager/concepts/#key-encryption-key-kek) via Key Manager and associate that KEK with a bucket. This KEK encrypts and decrypts the [data encryption keys (DEKs)](/en/docs/key-manager/concepts/#data-encryption-key-dek) that Object Storage uses to encrypt and decrypt the objects added to the bucket.

The KEK is generated, stored, and managed via Key Manager, whereas DEKs are generated and operated by Object Storage and encrypted by the KEK.

Both key types have associated security best practices:

* [Regularly rotate your KEK](/en/docs/key-manager/how-to/rotate-kem-keys/)
* [Secure your DEKs](/en/docs/key-manager/reference-content/security-recommendations/)

Scaleway SSE-KMS behaves similarly to Server-side Encryption with AWS Key Management Service (AWS KMS) keys (SSE-KMS).

> **Note**
>
> Scaleway also supports:
>
> * [Server-Side Encryption with Object Native Encryption (SSE-ONE)](/en/docs/object-storage/how-to/enable-sse-one/)
> * [Server-Side Encryption with Customer-provided keys (SSE-C)](/en/docs/object-storage/api-cli/enable-sse-c/)

When it comes to setting up your key architecture, the recommended practice is to always set default bucket encryption by enabling a Bucket Key via [PutBucketEncryption](/en/docs/object-storage/api-cli/bucket-operations/#putbucketencryption). When this is active and you have configured SSE‑KMS, Object Storage automatically creates a Bucket Key that is encrypted with your KMS key (the KEK). The Bucket Key, in turn, encrypts the per‑object data encryption keys (DEKs) that protect the actual object data.

In cases when you have some objects that are stored without SSE‑KMS, you can:

* Re‑upload an object and [enable SSE‑KMS for that specific object upload](#enabling-sse-kms-for-an-object-upload)
* Copy an object using the same bucket as the source and the destination and [enable SSE‑KMS for that specific copy operation](#enable-ssekms-for-a-specific-copy-operation)

## Before you start

To complete the following actions, you must have:

* A Scaleway account logged into the [console](https://console.scaleway.com)

* [Owner](/en/docs/iam/concepts/glossary/#owner) status or [IAM permissions](/en/docs/iam/concepts/glossary/#permission) allowing you to perform actions in the intended Organization

* An [Object Storage bucket](/en/docs/object-storage/how-to/create-a-bucket/)

* Installed and initialized the [AWS CLI](/en/docs/object-storage/api-cli/object-storage-aws-cli/)

* [Key Manager permission sets](/en/docs/iam/policies-permissions/permission-sets/#key-manager) for every [principal](/en/docs/iam/concepts/glossary/#principal) that reads or writes objects in the bucket:

  * `KeyManagerKeyEncrypt` for: `PutObject`, `UploadPart`, `CompleteMultipartUpload`, `CopyObject`, and `UploadPartCopy`
  * `KeyManagerKeyDecrypt` for: `GetObject`, `HeadObject`, `CopyObject`, `UploadPartCopy`, and `PostObject`

> **Important**
>
> Object Storage permission sets alone are not sufficient to read (`ObjectStorageReadOnly`, `ObjectStorageObjectsRead`) and write (`ObjectStorageObjectsWrite`, `ObjectStorageObjectsDelete`) objects encrypted with SSE-KMS. For example, when an [application](/en/docs/iam/concepts/glossary/#application) has only `ObjectStorageFullAccess` and no Key Manager permission set, it receives an "access denied" error when it calls `PutObject` on a bucket that has default encryption enabled, even when the KEK and the bucket are in the same Project.

## Enabling SSE-KMS for an object upload

In a terminal, run the following command. Remember to replace placeholders with actual values.

```bash
aws s3api put-object \
--bucket <your-bucket-name> \
--key <your-object-key> \
--server-side-encryption aws:kms \
--bucket-key-enabled 
--ssekms-key-id <your-kms-key-id> \ 
--body <path-to-file-to-upload>
```

An output similar to the following displays:

```json
{
"ETag": "\"<object-metadata>\"",
"ChecksumCRC64NVME": "<checksum-value>",
"ChecksumType": "FULL_OBJECT",
"ServerSideEncryption": "aws:kms",
"SSEKMSKeyId": "<your-kms-key-id>",
"BucketKeyEnabled": true
}
```

## Enable SSE‑KMS for a specific copy operation

In a terminal, run the following command. Remember to replace placeholders with actual values.

```bash
aws s3api copy-object \
--copy-source <your-bucket-name>/<your-object-filename> \
--key <your-object-key> \
--bucket <your-bucket-name> \
--server-side-encryption aws:kms \
--bucket-key-enabled \
--sse-kms-key-id <your-kms-key-id>
```

An output similar to the following displays:

```json
  {
    "ServerSideEncryption": "aws:kms",
    "SSEKMSKeyId": "<your-kms-key-id>",
    "BucketKeyEnabled": true,
    "CopyObjectResult": {
        "ETag": "\"<object-metadata>\"",
        "LastModified": "yyyy-MM-ddTHH:mm:ss.SSSZ",
        "ChecksumCRC64NVME": "<checksum-value>"
    }
}
```
