1개의 프로젝트에 대해 미사용 데이터 암호화 구성 업데이트
클라우드 공급자를 통해 관리하는 키를 사용하여 미사용 데이터 암호화에 대한 구성을 업데이트합니다. MongoDB Cloud는 자체 키 관리를 사용하지 않더라도 모든 스토리지를 암호화합니다. 이 리소스를 사용하려면, 요청하는 서비스 계정 또는 API 키에 프로젝트 소유자 역할이 있어야 합니다. 이 기능은 M0
무료 클러스터, M2
, M5
또는 서버리스 클러스터에는 사용할 수 없습니다.
MongoDB Cloud 프로젝트에 대해 고객 키 관리 공급자를 사용하여 하나 이상의 저장소 암호화를 구성하면 프로젝트 소유자는 암호화가 필요한 각 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
입니다. -
응답 본문이 프리티프린트 형식이어야 하는지 여부를 나타내는 플래그입니다.
기본값은
false
입니다.Prettyprint
body
필수 사항
필수 매개 변수는 고객 키 관리를 사용하여 미사용 데이터 암호화를 활성화했는지 여부에 따라 다릅니다.
CMK(고객 키 관리)를 사용하여 저장 시 암호화를 활성화한 경우 Atlas는 원하는 암호화 공급자에 대한 모든 매개 변수를 요구합니다.
- AWS KMS(키 관리 서비스)를 사용하려면 MongoDB Cloud에서 awsKms 객체에 모든 필드가 제공되어야 합니다.
- Azure Key Vault를 사용하려면 MongoDB Cloud에서 azureKeyVault 객체에 모든 필드가 제공되어야 합니다.
- Google Cloud 키 관리 서비스(KMS ) 인증 사용하려면 MongoDB Cloud는 googleCloudKms 객체 의 모든 필드 자격 증명 요구합니다 . 더 이상 지원되지 않습니다.
고객 키 관리를 사용하여 미사용 데이터 암호화를 활성화한 경우 관리자는 awsKms, azureKeyVault 또는 googleCloudKms 객체에서 변경된 필드만 전달하여 이 엔드포인트에 구성을 업데이트할 수 있습니다.
-
AWS(Amazon Web Services) KMS 구성 세부 정보 및 지정된 프로젝트에 설정된 미사용 데이터 암호화 구성.
Amazon Web Services 키 관리 서비스 -
AKV(Azure Key Vault)를 사용한 미사용 데이터 암호화 구성을 정의하는 세부 정보.
Azure Key Vault -
지정된 프로젝트에서 전용 검색 노드에 대한 미사용 데이터 암호화가 활성화되었는지 여부를 나타내는 플래그입니다.
-
Google Cloud KMS(키 관리 서비스)를 사용한 미사용 데이터 암호화 구성을 정의하는 세부 정보.
Google Cloud 키 관리 서비스
atlas api encryptionAtRestUsingCustomerKeyManagement updateGroupEncryptionAtRest --help
import (
"os"
"context"
"log"
sdk "go.mongodb.org/atlas-sdk/v20240530001/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.2024-05-30+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.2024-05-30+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"
}