クラウドプロバイダーを通じて管理するキーを使用して、保管時の暗号化の構成を更新します。MongoDB Cloud は、独自のキー管理を使用しない場合でも、すべてのストレージを暗号化します。このリソースには、リクエスト元のサービス アカウントまたは API キーにプロジェクト オーナーのロールが必要です。この機能は、M0 無料クラスター、M2、M5、サーバーレス クラスターでは使用できません。
MongoDB Cloud プロジェクトでカスタマー キー管理プロバイダーを使った保管時の暗号化を少なくとも 1 つ設定すると、プロジェクトオーナーは暗号化が必要な MongoDB Cloud クラスターごとにカスタマーキー管理を使った保管時の暗号化を有効にできます。カスタマー キー管理プロバイダーを使用した保管時の暗号化は、クラスター クラウド サービス プロバイダーと一致する必要はありません。MongoDB Cloud は、ユーザーが管理する暗号化キーを自動的にローテーションしません。キー ローテーションのベストプラクティスについては、カスタマー キー管理プロバイダーのドキュメントとガイダンスを利用して、ご希望の保管時の暗号化を行ってください。MongoDB Cloud プロジェクトでキー管理を使って、カスタマー キー管理を使った保管時の暗号化を設定すると、MongoDB Cloud は自動的に 90 日間のキー ローテーション アラートを作成します。MongoDB Cloud は、独自のキー管理を使用するかどうかに関係なく、すべてのストレージを暗号化します。
プロジェクトを識別する一意の 24 桁の 16 進数文字列。 認証済みユーザーがアクセスできるすべてのプロジェクトを取得するには、 /groups エンドポイントを使用します。
注: グループとプロジェクトは同義語です。そのため、グループ ID はプロジェクト ID と同じです。既存のグループの場合、グループ/プロジェクト ID は同じままです。リソースおよび対応するエンドポイントでは、グループという用語が使用されます。
形式は次のパターンと一致する必要があります: ^([a-f0-9]{24})$。
アプリケーションがレスポンスを envelope JSON オブジェクトにラップするかどうかを示すフラグ。一部の API クライアントは、HTTP レスポンス ヘッダーまたはステータス コードにアクセスできません。これを修正するには、クエリで envelope=true を設定します。結果のリストを返すエンドポイントは、結果オブジェクトをエンベロープとして使用します。アプリケーションは、レスポンス本体にステータス パラメータを追加します。
デフォルト値はfalseです。
レスポンス本体を pretty-print 形式にするかどうかを示すフラグ。
デフォルト値はfalseです。
必要なパラメーターは、カスタマー キー管理を使用して保管時の暗号化を有効にしているかどうかによって異なります。
CMK(Customer Key Management、カスタマー キー管理)を使用して保管時の暗号化を有効にした場合、Atlas には目的の暗号化プロバイダーの全パラメーターが必要です。
カスタマー キー管理を使用して保管時の暗号化を有効にした場合、管理者は awsKms、azureKeyVault、または googleCloudKms オブジェクトの変更されたフィールドのみを渡して、このエンドポイントへの構成を更新できます。
AWS(Amazon Web Services)KMS 設定の詳細と、指定されたプロジェクトの保管時の暗号化の設定セット。
AKV(Azure Key Vault)を使用した保管時の暗号化の設定を定義する詳細。
指定したプロジェクトで専用検索ノードに対し保管時の暗号化が有効になっているかどうかを示すフラグ。
Google Cloud KMS(Key Management Service)を使用した保管時の暗号化の設定を定義する詳細。
atlas api encryptionAtRestUsingCustomerKeyManagement updateEncryptionAtRest --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20250312001/admin"
)
func main() {
ctx := context.Background()
clientID := os.Getenv("MONGODB_ATLAS_CLIENT_ID")
clientSecret := os.Getenv("MONGODB_ATLAS_CLIENT_SECRET")
// See https://dochub.mongodb.org/core/atlas-go-sdk-oauth
client, err := sdk.NewClient(sdk.UseOAuthAuth(clientID, clientSecret))
if err != nil {
log.Fatalf("Error: %v", err)
}
params = &sdk.UpdateGroupEncryptionAtRestApiParams{}
sdkResp, httpResp, err := client.EncryptionatRestusingCustomerKeyManagementApi.
UpdateGroupEncryptionAtRestWithParams(ctx, params).
Execute()
}
curl --include --header "Authorization: Bearer ${ACCESS_TOKEN}" \
--header "Accept: application/vnd.atlas.2025-03-12+json" \
--header "Content-Type: application/json" \
-X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest" \
-d '{ <Payload> }'
curl --user "${PUBLIC_KEY}:${PRIVATE_KEY}" \
--digest --include \
--header "Accept: application/vnd.atlas.2025-03-12+json" \
--header "Content-Type: application/json" \
-X PATCH "https://cloud.mongodb.com/api/atlas/v2/groups/{groupId}/encryptionAtRest" \
-d '{ <Payload> }'
{
"awsKms": {
"accessKeyID": "019dd98d94b4bb778e7552e4",
"customerMasterKeyID": "string",
"enabled": true,
"region": "US_GOV_WEST_1",
"requirePrivateNetworking": true,
"roleId": "32b6e34b3d91647abb20e7b8",
"secretAccessKey": "string"
},
"azureKeyVault": {
"azureEnvironment": "AZURE",
"clientID": "string",
"enabled": true,
"keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
"keyVaultName": "string",
"requirePrivateNetworking": true,
"resourceGroupName": "string",
"secret": "string",
"subscriptionID": "string",
"tenantID": "string"
},
"enabledForSearchNodes": true,
"googleCloudKms": {
"enabled": true,
"keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
"roleId": "32b6e34b3d91647abb20e7b8",
"serviceAccountKey": "string"
}
}
{
"awsKms": {
"accessKeyID": "019dd98d94b4bb778e7552e4",
"customerMasterKeyID": "string",
"enabled": true,
"region": "US_GOV_WEST_1",
"requirePrivateNetworking": true,
"valid": true
},
"azureKeyVault": {
"azureEnvironment": "AZURE",
"clientID": "string",
"enabled": true,
"keyIdentifier": "https://EXAMPLEKeyVault.vault.azure.net/keys/EXAMPLEKey/d891821e3d364e9eb88fbd3d11807b86",
"keyVaultName": "string",
"requirePrivateNetworking": true,
"resourceGroupName": "string",
"subscriptionID": "string",
"tenantID": "string",
"valid": true
},
"enabledForSearchNodes": true,
"googleCloudKms": {
"enabled": true,
"keyVersionResourceID": "projects/my-project-common-0/locations/us-east4/keyRings/my-key-ring-0/cryptoKeys/my-key-0/cryptoKeyVersions/1",
"roleId": "32b6e34b3d91647abb20e7b8",
"valid": true
}
}
{
"error": 400,
"detail": "(This is just an example, the exception may not be related to this endpoint) No provider AWS exists.",
"reason": "Bad Request",
"errorCode": "VALIDATION_ERROR"
}
{
"error": 401,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Unauthorized",
"errorCode": "NOT_ORG_GROUP_CREATOR"
}
{
"error": 403,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Forbidden",
"errorCode": "CANNOT_CHANGE_GROUP_NAME"
}
{
"error": 404,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot find resource AWS",
"reason": "Not Found",
"errorCode": "RESOURCE_NOT_FOUND"
}
{
"error": 409,
"detail": "(This is just an example, the exception may not be related to this endpoint) Cannot delete organization link while there is active migration in following project ids: 60c4fd418ebe251047c50554",
"reason": "Conflict",
"errorCode": "CANNOT_DELETE_ORG_ACTIVE_LIVE_MIGRATION_ATLAS_ORG_LINK"
}
{
"error": 500,
"detail": "(This is just an example, the exception may not be related to this endpoint)",
"reason": "Internal Server Error",
"errorCode": "UNEXPECTED_ERROR"
}